Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2014, 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 | |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 17 | package android.telecom; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 18 | |
| 19 | import android.net.Uri; |
Nancy Chen | 10798dc | 2014-08-08 14:00:25 -0700 | [diff] [blame] | 20 | import android.os.Bundle; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 21 | import android.os.Parcel; |
| 22 | import android.os.Parcelable; |
Andrew Lee | 5dc3075 | 2014-06-27 17:02:19 -0700 | [diff] [blame] | 23 | import android.os.RemoteException; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 24 | |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 25 | import java.util.ArrayList; |
Santos Cordon | 7c7bc7f | 2014-07-28 18:15:48 -0700 | [diff] [blame] | 26 | import java.util.Collections; |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 27 | import java.util.List; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 28 | |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 29 | import com.android.internal.telecom.IVideoProvider; |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 30 | |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 31 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 32 | * Information about a call that is used between InCallService and Telecom. |
Santos Cordon | 88b771d | 2014-07-19 13:10:40 -0700 | [diff] [blame] | 33 | * @hide |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 34 | */ |
Santos Cordon | 88b771d | 2014-07-19 13:10:40 -0700 | [diff] [blame] | 35 | public final class ParcelableCall implements Parcelable { |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 36 | private final String mId; |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 37 | private final int mState; |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 38 | private final DisconnectCause mDisconnectCause; |
Ihab Awad | c067754 | 2014-06-10 13:29:47 -0700 | [diff] [blame] | 39 | private final List<String> mCannedSmsResponses; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 40 | private final int mCapabilities; |
Andrew Lee | 223ad14 | 2014-08-27 16:33:08 -0700 | [diff] [blame] | 41 | private final int mProperties; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 42 | private final long mConnectTimeMillis; |
| 43 | private final Uri mHandle; |
Sailesh Nepal | 6120386 | 2014-07-11 14:50:13 -0700 | [diff] [blame] | 44 | private final int mHandlePresentation; |
| 45 | private final String mCallerDisplayName; |
| 46 | private final int mCallerDisplayNamePresentation; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 47 | private final GatewayInfo mGatewayInfo; |
Evan Charlton | 8c8a062 | 2014-07-20 12:31:00 -0700 | [diff] [blame] | 48 | private final PhoneAccountHandle mAccountHandle; |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 49 | private final IVideoProvider mVideoCallProvider; |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 50 | private InCallService.VideoCall mVideoCall; |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 51 | private final String mParentCallId; |
| 52 | private final List<String> mChildCallIds; |
Sailesh Nepal | e7ef59a | 2014-07-08 21:48:22 -0700 | [diff] [blame] | 53 | private final StatusHints mStatusHints; |
Andrew Lee | 85f5d42 | 2014-07-11 17:22:03 -0700 | [diff] [blame] | 54 | private final int mVideoState; |
Santos Cordon | 7c7bc7f | 2014-07-28 18:15:48 -0700 | [diff] [blame] | 55 | private final List<String> mConferenceableCallIds; |
Nancy Chen | 10798dc | 2014-08-08 14:00:25 -0700 | [diff] [blame] | 56 | private final Bundle mExtras; |
Rekha Kumar | 0736681 | 2015-03-24 16:42:31 -0700 | [diff] [blame] | 57 | private int mCallSubstate; |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 58 | |
Santos Cordon | 88b771d | 2014-07-19 13:10:40 -0700 | [diff] [blame] | 59 | public ParcelableCall( |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 60 | String id, |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 61 | int state, |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 62 | DisconnectCause disconnectCause, |
Ihab Awad | c067754 | 2014-06-10 13:29:47 -0700 | [diff] [blame] | 63 | List<String> cannedSmsResponses, |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 64 | int capabilities, |
Andrew Lee | 223ad14 | 2014-08-27 16:33:08 -0700 | [diff] [blame] | 65 | int properties, |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 66 | long connectTimeMillis, |
| 67 | Uri handle, |
Sailesh Nepal | 6120386 | 2014-07-11 14:50:13 -0700 | [diff] [blame] | 68 | int handlePresentation, |
| 69 | String callerDisplayName, |
| 70 | int callerDisplayNamePresentation, |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 71 | GatewayInfo gatewayInfo, |
Evan Charlton | 8c8a062 | 2014-07-20 12:31:00 -0700 | [diff] [blame] | 72 | PhoneAccountHandle accountHandle, |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 73 | IVideoProvider videoCallProvider, |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 74 | String parentCallId, |
Tyler Gunn | 8d83fa9 | 2014-07-01 11:31:21 -0700 | [diff] [blame] | 75 | List<String> childCallIds, |
Andrew Lee | 85f5d42 | 2014-07-11 17:22:03 -0700 | [diff] [blame] | 76 | StatusHints statusHints, |
Santos Cordon | 7c7bc7f | 2014-07-28 18:15:48 -0700 | [diff] [blame] | 77 | int videoState, |
Nancy Chen | 10798dc | 2014-08-08 14:00:25 -0700 | [diff] [blame] | 78 | List<String> conferenceableCallIds, |
Rekha Kumar | 0736681 | 2015-03-24 16:42:31 -0700 | [diff] [blame] | 79 | Bundle extras, |
| 80 | int callSubstate) { |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 81 | mId = id; |
| 82 | mState = state; |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 83 | mDisconnectCause = disconnectCause; |
Ihab Awad | c067754 | 2014-06-10 13:29:47 -0700 | [diff] [blame] | 84 | mCannedSmsResponses = cannedSmsResponses; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 85 | mCapabilities = capabilities; |
Andrew Lee | 223ad14 | 2014-08-27 16:33:08 -0700 | [diff] [blame] | 86 | mProperties = properties; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 87 | mConnectTimeMillis = connectTimeMillis; |
| 88 | mHandle = handle; |
Sailesh Nepal | 6120386 | 2014-07-11 14:50:13 -0700 | [diff] [blame] | 89 | mHandlePresentation = handlePresentation; |
| 90 | mCallerDisplayName = callerDisplayName; |
| 91 | mCallerDisplayNamePresentation = callerDisplayNamePresentation; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 92 | mGatewayInfo = gatewayInfo; |
Evan Charlton | 8c8a062 | 2014-07-20 12:31:00 -0700 | [diff] [blame] | 93 | mAccountHandle = accountHandle; |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 94 | mVideoCallProvider = videoCallProvider; |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 95 | mParentCallId = parentCallId; |
| 96 | mChildCallIds = childCallIds; |
Sailesh Nepal | e7ef59a | 2014-07-08 21:48:22 -0700 | [diff] [blame] | 97 | mStatusHints = statusHints; |
Andrew Lee | 85f5d42 | 2014-07-11 17:22:03 -0700 | [diff] [blame] | 98 | mVideoState = videoState; |
Santos Cordon | 7c7bc7f | 2014-07-28 18:15:48 -0700 | [diff] [blame] | 99 | mConferenceableCallIds = Collections.unmodifiableList(conferenceableCallIds); |
Nancy Chen | 10798dc | 2014-08-08 14:00:25 -0700 | [diff] [blame] | 100 | mExtras = extras; |
Rekha Kumar | 0736681 | 2015-03-24 16:42:31 -0700 | [diff] [blame] | 101 | mCallSubstate = callSubstate; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 102 | } |
| 103 | |
| 104 | /** The unique ID of the call. */ |
| 105 | public String getId() { |
| 106 | return mId; |
| 107 | } |
| 108 | |
| 109 | /** The current state of the call. */ |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 110 | public int getState() { |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 111 | return mState; |
| 112 | } |
| 113 | |
| 114 | /** |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 115 | * Reason for disconnection, as described by {@link android.telecomm.DisconnectCause}. Valid |
| 116 | * when call state is {@link CallState#DISCONNECTED}. |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 117 | */ |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 118 | public DisconnectCause getDisconnectCause() { |
| 119 | return mDisconnectCause; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 120 | } |
| 121 | |
Ihab Awad | c067754 | 2014-06-10 13:29:47 -0700 | [diff] [blame] | 122 | /** |
| 123 | * The set of possible text message responses when this call is incoming. |
| 124 | */ |
| 125 | public List<String> getCannedSmsResponses() { |
| 126 | return mCannedSmsResponses; |
| 127 | } |
| 128 | |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 129 | // Bit mask of actions a call supports, values are defined in {@link CallCapabilities}. |
| 130 | public int getCapabilities() { |
| 131 | return mCapabilities; |
| 132 | } |
| 133 | |
Andrew Lee | 223ad14 | 2014-08-27 16:33:08 -0700 | [diff] [blame] | 134 | /** Bitmask of properties of the call. */ |
| 135 | public int getProperties() { return mProperties; } |
| 136 | |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 137 | /** The time that the call switched to the active state. */ |
| 138 | public long getConnectTimeMillis() { |
| 139 | return mConnectTimeMillis; |
| 140 | } |
| 141 | |
| 142 | /** The endpoint to which the call is connected. */ |
| 143 | public Uri getHandle() { |
| 144 | return mHandle; |
| 145 | } |
| 146 | |
Nancy Chen | 9d568c0 | 2014-09-08 14:17:59 -0700 | [diff] [blame] | 147 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 148 | * The presentation requirements for the handle. See {@link TelecomManager} for valid values. |
Nancy Chen | 9d568c0 | 2014-09-08 14:17:59 -0700 | [diff] [blame] | 149 | */ |
Sailesh Nepal | 6120386 | 2014-07-11 14:50:13 -0700 | [diff] [blame] | 150 | public int getHandlePresentation() { |
| 151 | return mHandlePresentation; |
| 152 | } |
| 153 | |
| 154 | /** The endpoint to which the call is connected. */ |
| 155 | public String getCallerDisplayName() { |
| 156 | return mCallerDisplayName; |
| 157 | } |
| 158 | |
Nancy Chen | 9d568c0 | 2014-09-08 14:17:59 -0700 | [diff] [blame] | 159 | /** |
| 160 | * The presentation requirements for the caller display name. |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 161 | * See {@link TelecomManager} for valid values. |
Nancy Chen | 9d568c0 | 2014-09-08 14:17:59 -0700 | [diff] [blame] | 162 | */ |
Sailesh Nepal | 6120386 | 2014-07-11 14:50:13 -0700 | [diff] [blame] | 163 | public int getCallerDisplayNamePresentation() { |
| 164 | return mCallerDisplayNamePresentation; |
| 165 | } |
| 166 | |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 167 | /** Gateway information for the call. */ |
| 168 | public GatewayInfo getGatewayInfo() { |
| 169 | return mGatewayInfo; |
| 170 | } |
| 171 | |
Evan Charlton | 6eb262c | 2014-07-19 18:18:19 -0700 | [diff] [blame] | 172 | /** PhoneAccountHandle information for the call. */ |
Evan Charlton | 8c8a062 | 2014-07-20 12:31:00 -0700 | [diff] [blame] | 173 | public PhoneAccountHandle getAccountHandle() { |
| 174 | return mAccountHandle; |
Nancy Chen | 5ffbfcc | 2014-06-25 14:22:55 -0700 | [diff] [blame] | 175 | } |
| 176 | |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 177 | /** |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 178 | * Returns an object for remotely communicating through the video call provider's binder. |
| 179 | * @return The video call. |
Andrew Lee | 5dc3075 | 2014-06-27 17:02:19 -0700 | [diff] [blame] | 180 | */ |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 181 | public InCallService.VideoCall getVideoCall() { |
| 182 | if (mVideoCall == null && mVideoCallProvider != null) { |
Andrew Lee | 5dc3075 | 2014-06-27 17:02:19 -0700 | [diff] [blame] | 183 | try { |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 184 | mVideoCall = new VideoCallImpl(mVideoCallProvider); |
Andrew Lee | 5dc3075 | 2014-06-27 17:02:19 -0700 | [diff] [blame] | 185 | } catch (RemoteException ignored) { |
| 186 | // Ignore RemoteException. |
| 187 | } |
| 188 | } |
| 189 | |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 190 | return mVideoCall; |
Andrew Lee | 5dc3075 | 2014-06-27 17:02:19 -0700 | [diff] [blame] | 191 | } |
| 192 | |
| 193 | /** |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 194 | * The conference call to which this call is conferenced. Null if not conferenced. |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 195 | */ |
| 196 | public String getParentCallId() { |
| 197 | return mParentCallId; |
| 198 | } |
| 199 | |
| 200 | /** |
| 201 | * The child call-IDs if this call is a conference call. Returns an empty list if this is not |
| 202 | * a conference call or if the conference call contains no children. |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 203 | */ |
| 204 | public List<String> getChildCallIds() { |
| 205 | return mChildCallIds; |
| 206 | } |
| 207 | |
Santos Cordon | 7c7bc7f | 2014-07-28 18:15:48 -0700 | [diff] [blame] | 208 | public List<String> getConferenceableCallIds() { |
| 209 | return mConferenceableCallIds; |
| 210 | } |
| 211 | |
Tyler Gunn | 8d83fa9 | 2014-07-01 11:31:21 -0700 | [diff] [blame] | 212 | /** |
Sailesh Nepal | e7ef59a | 2014-07-08 21:48:22 -0700 | [diff] [blame] | 213 | * The status label and icon. |
| 214 | * |
| 215 | * @return Status hints. |
| 216 | */ |
| 217 | public StatusHints getStatusHints() { |
| 218 | return mStatusHints; |
| 219 | } |
| 220 | |
Andrew Lee | 85f5d42 | 2014-07-11 17:22:03 -0700 | [diff] [blame] | 221 | /** |
| 222 | * The video state. |
| 223 | * @return The video state of the call. |
| 224 | */ |
| 225 | public int getVideoState() { |
| 226 | return mVideoState; |
| 227 | } |
| 228 | |
Nancy Chen | 10798dc | 2014-08-08 14:00:25 -0700 | [diff] [blame] | 229 | /** |
| 230 | * Any extras to pass with the call |
| 231 | * |
| 232 | * @return a bundle of extras |
| 233 | */ |
| 234 | public Bundle getExtras() { |
| 235 | return mExtras; |
| 236 | } |
| 237 | |
Rekha Kumar | 0736681 | 2015-03-24 16:42:31 -0700 | [diff] [blame] | 238 | /** |
| 239 | * The call substate. |
| 240 | * @return The substate of the call. |
| 241 | */ |
| 242 | public int getCallSubstate() { |
| 243 | return mCallSubstate; |
| 244 | } |
| 245 | |
Santos Cordon | 88b771d | 2014-07-19 13:10:40 -0700 | [diff] [blame] | 246 | /** Responsible for creating ParcelableCall objects for deserialized Parcels. */ |
| 247 | public static final Parcelable.Creator<ParcelableCall> CREATOR = |
| 248 | new Parcelable.Creator<ParcelableCall> () { |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 249 | @Override |
Santos Cordon | 88b771d | 2014-07-19 13:10:40 -0700 | [diff] [blame] | 250 | public ParcelableCall createFromParcel(Parcel source) { |
| 251 | ClassLoader classLoader = ParcelableCall.class.getClassLoader(); |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 252 | String id = source.readString(); |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 253 | int state = source.readInt(); |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 254 | DisconnectCause disconnectCause = source.readParcelable(classLoader); |
Ihab Awad | c067754 | 2014-06-10 13:29:47 -0700 | [diff] [blame] | 255 | List<String> cannedSmsResponses = new ArrayList<>(); |
| 256 | source.readList(cannedSmsResponses, classLoader); |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 257 | int capabilities = source.readInt(); |
Andrew Lee | 223ad14 | 2014-08-27 16:33:08 -0700 | [diff] [blame] | 258 | int properties = source.readInt(); |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 259 | long connectTimeMillis = source.readLong(); |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 260 | Uri handle = source.readParcelable(classLoader); |
Sailesh Nepal | 6120386 | 2014-07-11 14:50:13 -0700 | [diff] [blame] | 261 | int handlePresentation = source.readInt(); |
| 262 | String callerDisplayName = source.readString(); |
| 263 | int callerDisplayNamePresentation = source.readInt(); |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 264 | GatewayInfo gatewayInfo = source.readParcelable(classLoader); |
Evan Charlton | 8c8a062 | 2014-07-20 12:31:00 -0700 | [diff] [blame] | 265 | PhoneAccountHandle accountHandle = source.readParcelable(classLoader); |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 266 | IVideoProvider videoCallProvider = |
| 267 | IVideoProvider.Stub.asInterface(source.readStrongBinder()); |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 268 | String parentCallId = source.readString(); |
| 269 | List<String> childCallIds = new ArrayList<>(); |
| 270 | source.readList(childCallIds, classLoader); |
Sailesh Nepal | e7ef59a | 2014-07-08 21:48:22 -0700 | [diff] [blame] | 271 | StatusHints statusHints = source.readParcelable(classLoader); |
Andrew Lee | 85f5d42 | 2014-07-11 17:22:03 -0700 | [diff] [blame] | 272 | int videoState = source.readInt(); |
Santos Cordon | 7c7bc7f | 2014-07-28 18:15:48 -0700 | [diff] [blame] | 273 | List<String> conferenceableCallIds = new ArrayList<>(); |
| 274 | source.readList(conferenceableCallIds, classLoader); |
Nancy Chen | 10798dc | 2014-08-08 14:00:25 -0700 | [diff] [blame] | 275 | Bundle extras = source.readParcelable(classLoader); |
Rekha Kumar | 0736681 | 2015-03-24 16:42:31 -0700 | [diff] [blame] | 276 | int callSubstate = source.readInt(); |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 277 | return new ParcelableCall( |
| 278 | id, |
| 279 | state, |
| 280 | disconnectCause, |
| 281 | cannedSmsResponses, |
| 282 | capabilities, |
| 283 | properties, |
| 284 | connectTimeMillis, |
| 285 | handle, |
| 286 | handlePresentation, |
| 287 | callerDisplayName, |
| 288 | callerDisplayNamePresentation, |
| 289 | gatewayInfo, |
| 290 | accountHandle, |
| 291 | videoCallProvider, |
| 292 | parentCallId, |
| 293 | childCallIds, |
| 294 | statusHints, |
| 295 | videoState, |
| 296 | conferenceableCallIds, |
Rekha Kumar | 0736681 | 2015-03-24 16:42:31 -0700 | [diff] [blame] | 297 | extras, |
| 298 | callSubstate); |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 299 | } |
| 300 | |
| 301 | @Override |
Santos Cordon | 88b771d | 2014-07-19 13:10:40 -0700 | [diff] [blame] | 302 | public ParcelableCall[] newArray(int size) { |
| 303 | return new ParcelableCall[size]; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 304 | } |
| 305 | }; |
| 306 | |
| 307 | /** {@inheritDoc} */ |
| 308 | @Override |
| 309 | public int describeContents() { |
| 310 | return 0; |
| 311 | } |
| 312 | |
Santos Cordon | 88b771d | 2014-07-19 13:10:40 -0700 | [diff] [blame] | 313 | /** Writes ParcelableCall object into a Parcel. */ |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 314 | @Override |
| 315 | public void writeToParcel(Parcel destination, int flags) { |
| 316 | destination.writeString(mId); |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 317 | destination.writeInt(mState); |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 318 | destination.writeParcelable(mDisconnectCause, 0); |
Ihab Awad | c067754 | 2014-06-10 13:29:47 -0700 | [diff] [blame] | 319 | destination.writeList(mCannedSmsResponses); |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 320 | destination.writeInt(mCapabilities); |
Andrew Lee | 223ad14 | 2014-08-27 16:33:08 -0700 | [diff] [blame] | 321 | destination.writeInt(mProperties); |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 322 | destination.writeLong(mConnectTimeMillis); |
| 323 | destination.writeParcelable(mHandle, 0); |
Sailesh Nepal | 6120386 | 2014-07-11 14:50:13 -0700 | [diff] [blame] | 324 | destination.writeInt(mHandlePresentation); |
| 325 | destination.writeString(mCallerDisplayName); |
| 326 | destination.writeInt(mCallerDisplayNamePresentation); |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 327 | destination.writeParcelable(mGatewayInfo, 0); |
Evan Charlton | 8c8a062 | 2014-07-20 12:31:00 -0700 | [diff] [blame] | 328 | destination.writeParcelable(mAccountHandle, 0); |
Tyler Gunn | 807de8a | 2014-06-30 14:22:57 -0700 | [diff] [blame] | 329 | destination.writeStrongBinder( |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 330 | mVideoCallProvider != null ? mVideoCallProvider.asBinder() : null); |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 331 | destination.writeString(mParentCallId); |
| 332 | destination.writeList(mChildCallIds); |
Sailesh Nepal | e7ef59a | 2014-07-08 21:48:22 -0700 | [diff] [blame] | 333 | destination.writeParcelable(mStatusHints, 0); |
Andrew Lee | 85f5d42 | 2014-07-11 17:22:03 -0700 | [diff] [blame] | 334 | destination.writeInt(mVideoState); |
Santos Cordon | 7c7bc7f | 2014-07-28 18:15:48 -0700 | [diff] [blame] | 335 | destination.writeList(mConferenceableCallIds); |
Nancy Chen | 10798dc | 2014-08-08 14:00:25 -0700 | [diff] [blame] | 336 | destination.writeParcelable(mExtras, 0); |
Rekha Kumar | 0736681 | 2015-03-24 16:42:31 -0700 | [diff] [blame] | 337 | destination.writeInt(mCallSubstate); |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 338 | } |
Santos Cordon | b693998 | 2014-06-04 20:20:58 -0700 | [diff] [blame] | 339 | |
| 340 | @Override |
| 341 | public String toString() { |
| 342 | return String.format("[%s, parent:%s, children:%s]", mId, mParentCallId, mChildCallIds); |
| 343 | } |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 344 | } |