1/* 2 * Copyright (C) 2006 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17package com.android.internal.telephony.cat; 18 19import android.graphics.Bitmap; 20import android.os.Parcel; 21import android.os.Parcelable; 22 23/** 24 * Represents an Item COMPREHENSION-TLV object. 25 * 26 * {@hide} 27 */ 28public class Item implements Parcelable { 29 /** Identifier of the item. */ 30 public int id; 31 /** Text string of the item. */ 32 public String text; 33 /** Icon of the item */ 34 public Bitmap icon; 35 36 public Item(int id, String text) { 37 this.id = id; 38 this.text = text; 39 this.icon = null; 40 } 41 42 public Item(Parcel in) { 43 id = in.readInt(); 44 text = in.readString(); 45 icon = in.readParcelable(null); 46 } 47 48 public int describeContents() { 49 return 0; 50 } 51 52 public void writeToParcel(Parcel dest, int flags) { 53 dest.writeInt(id); 54 dest.writeString(text); 55 dest.writeParcelable(icon, flags); 56 } 57 58 public static final Parcelable.Creator<Item> CREATOR = new Parcelable.Creator<Item>() { 59 public Item createFromParcel(Parcel in) { 60 return new Item(in); 61 } 62 63 public Item[] newArray(int size) { 64 return new Item[size]; 65 } 66 }; 67 68 public String toString() { 69 return text; 70 } 71} 72