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 @Override 49 public int describeContents() { 50 return 0; 51 } 52 53 @Override 54 public void writeToParcel(Parcel dest, int flags) { 55 dest.writeInt(id); 56 dest.writeString(text); 57 dest.writeParcelable(icon, flags); 58 } 59 60 public static final Parcelable.Creator<Item> CREATOR = new Parcelable.Creator<Item>() { 61 @Override 62 public Item createFromParcel(Parcel in) { 63 return new Item(in); 64 } 65 66 @Override 67 public Item[] newArray(int size) { 68 return new Item[size]; 69 } 70 }; 71 72 @Override 73 public String toString() { 74 return text; 75 } 76} 77