1/* 2** Copyright 2013, 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; 18 19import android.os.Parcel; 20import android.os.Parcelable; 21 22/** 23 * A parcelable holder class of Call information data. 24 */ 25public class CallInfo implements Parcelable { 26 27 /** 28 * Endpoint to which the call is connected. 29 * This could be the dialed value for outgoing calls or the caller id of incoming calls. 30 */ 31 private String handle; 32 33 public CallInfo(String handle) { 34 this.handle = handle; 35 } 36 37 public String getHandle() { 38 return handle; 39 } 40 41 // 42 // Parcelling related code below here. 43 // 44 45 /** 46 * Responsible for creating CallInfo objects for deserialized Parcels. 47 */ 48 public static final Parcelable.Creator<CallInfo> CREATOR 49 = new Parcelable.Creator<CallInfo> () { 50 51 @Override 52 public CallInfo createFromParcel(Parcel source) { 53 return new CallInfo(source.readString()); 54 } 55 56 @Override 57 public CallInfo[] newArray(int size) { 58 return new CallInfo[size]; 59 } 60 }; 61 62 /** 63 * {@inheritDoc} 64 */ 65 @Override 66 public int describeContents() { 67 return 0; 68 } 69 70 /** 71 * Writes CallInfo object into a serializeable Parcel. 72 */ 73 @Override 74 public void writeToParcel(Parcel destination, int flags) { 75 destination.writeString(handle); 76 } 77} 78