blob: a234bb0af8fab750a5bb27bbb7aaed02e68d0438 [file] [log] [blame]
Sailesh Nepal60437932014-04-05 16:44:55 -07001/*
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 Gunnef9f6f92014-09-12 22:16:17 -070017package android.telecom;
Sailesh Nepal60437932014-04-05 16:44:55 -070018
Mathew Inwoode5bfa3e2018-08-01 11:26:20 +010019import android.annotation.UnsupportedAppUsage;
Sailesh Nepal60437932014-04-05 16:44:55 -070020import android.net.Uri;
Mathew Inwood8c854f82018-09-14 12:35:36 +010021import android.os.Build;
Nancy Chen10798dc2014-08-08 14:00:25 -070022import android.os.Bundle;
Tyler Gunnd1fdf3a2019-11-05 15:47:58 -080023import android.os.IBinder;
Sailesh Nepal60437932014-04-05 16:44:55 -070024import android.os.Parcel;
25import android.os.Parcelable;
Andrew Lee5dc30752014-06-27 17:02:19 -070026import android.os.RemoteException;
Tyler Gunn9e76fd19b2018-12-17 09:56:11 -080027import android.telecom.Call.Details.CallDirection;
Sailesh Nepal60437932014-04-05 16:44:55 -070028
Santos Cordon980acb92014-05-31 10:31:19 -070029import java.util.ArrayList;
Santos Cordon7c7bc7f2014-07-28 18:15:48 -070030import java.util.Collections;
Santos Cordon980acb92014-05-31 10:31:19 -070031import java.util.List;
Sailesh Nepal60437932014-04-05 16:44:55 -070032
Tyler Gunnef9f6f92014-09-12 22:16:17 -070033import com.android.internal.telecom.IVideoProvider;
Ihab Awadb19a0bc2014-08-07 19:46:01 -070034
Sailesh Nepal60437932014-04-05 16:44:55 -070035/**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070036 * Information about a call that is used between InCallService and Telecom.
Santos Cordon88b771d2014-07-19 13:10:40 -070037 * @hide
Sailesh Nepal60437932014-04-05 16:44:55 -070038 */
Santos Cordon88b771d2014-07-19 13:10:40 -070039public final class ParcelableCall implements Parcelable {
Sailesh Nepal60437932014-04-05 16:44:55 -070040 private final String mId;
Ihab Awadb19a0bc2014-08-07 19:46:01 -070041 private final int mState;
Andrew Lee7f3d41f2014-09-11 17:33:16 -070042 private final DisconnectCause mDisconnectCause;
Ihab Awadc0677542014-06-10 13:29:47 -070043 private final List<String> mCannedSmsResponses;
Sailesh Nepal60437932014-04-05 16:44:55 -070044 private final int mCapabilities;
Andrew Lee223ad142014-08-27 16:33:08 -070045 private final int mProperties;
Christine Hallstrom2830ce92016-11-30 16:06:42 -080046 private final int mSupportedAudioRoutes;
Sailesh Nepal60437932014-04-05 16:44:55 -070047 private final long mConnectTimeMillis;
48 private final Uri mHandle;
Sailesh Nepal61203862014-07-11 14:50:13 -070049 private final int mHandlePresentation;
50 private final String mCallerDisplayName;
51 private final int mCallerDisplayNamePresentation;
Sailesh Nepal60437932014-04-05 16:44:55 -070052 private final GatewayInfo mGatewayInfo;
Evan Charlton8c8a0622014-07-20 12:31:00 -070053 private final PhoneAccountHandle mAccountHandle;
Tyler Gunn75958422015-04-15 14:23:42 -070054 private final boolean mIsVideoCallProviderChanged;
Ihab Awadb19a0bc2014-08-07 19:46:01 -070055 private final IVideoProvider mVideoCallProvider;
Tyler Gunn584ba6c2015-12-08 10:53:41 -080056 private VideoCallImpl mVideoCall;
Hall Liu95d55872017-01-25 17:12:49 -080057 private final boolean mIsRttCallChanged;
58 private final ParcelableRttCall mRttCall;
Santos Cordon980acb92014-05-31 10:31:19 -070059 private final String mParentCallId;
60 private final List<String> mChildCallIds;
Sailesh Nepale7ef59a2014-07-08 21:48:22 -070061 private final StatusHints mStatusHints;
Andrew Lee85f5d422014-07-11 17:22:03 -070062 private final int mVideoState;
Santos Cordon7c7bc7f2014-07-28 18:15:48 -070063 private final List<String> mConferenceableCallIds;
Santos Cordon6b7f9552015-05-27 17:21:45 -070064 private final Bundle mIntentExtras;
Nancy Chen10798dc2014-08-08 14:00:25 -070065 private final Bundle mExtras;
Tyler Gunnc0bf6de2017-03-17 11:27:09 -070066 private final long mCreationTimeMillis;
Tyler Gunn9e76fd19b2018-12-17 09:56:11 -080067 private final int mCallDirection;
Tyler Gunnd57d76c2019-09-24 14:53:23 -070068 private final int mCallerNumberVerificationStatus;
Santos Cordon980acb92014-05-31 10:31:19 -070069
Santos Cordon88b771d2014-07-19 13:10:40 -070070 public ParcelableCall(
Sailesh Nepal60437932014-04-05 16:44:55 -070071 String id,
Ihab Awadb19a0bc2014-08-07 19:46:01 -070072 int state,
Andrew Lee7f3d41f2014-09-11 17:33:16 -070073 DisconnectCause disconnectCause,
Ihab Awadc0677542014-06-10 13:29:47 -070074 List<String> cannedSmsResponses,
Sailesh Nepal60437932014-04-05 16:44:55 -070075 int capabilities,
Andrew Lee223ad142014-08-27 16:33:08 -070076 int properties,
Christine Hallstrom2830ce92016-11-30 16:06:42 -080077 int supportedAudioRoutes,
Sailesh Nepal60437932014-04-05 16:44:55 -070078 long connectTimeMillis,
79 Uri handle,
Sailesh Nepal61203862014-07-11 14:50:13 -070080 int handlePresentation,
81 String callerDisplayName,
82 int callerDisplayNamePresentation,
Sailesh Nepal60437932014-04-05 16:44:55 -070083 GatewayInfo gatewayInfo,
Evan Charlton8c8a0622014-07-20 12:31:00 -070084 PhoneAccountHandle accountHandle,
Tyler Gunn75958422015-04-15 14:23:42 -070085 boolean isVideoCallProviderChanged,
Ihab Awadb19a0bc2014-08-07 19:46:01 -070086 IVideoProvider videoCallProvider,
Hall Liu95d55872017-01-25 17:12:49 -080087 boolean isRttCallChanged,
88 ParcelableRttCall rttCall,
Santos Cordon980acb92014-05-31 10:31:19 -070089 String parentCallId,
Tyler Gunn8d83fa92014-07-01 11:31:21 -070090 List<String> childCallIds,
Andrew Lee85f5d422014-07-11 17:22:03 -070091 StatusHints statusHints,
Santos Cordon7c7bc7f2014-07-28 18:15:48 -070092 int videoState,
Nancy Chen10798dc2014-08-08 14:00:25 -070093 List<String> conferenceableCallIds,
Santos Cordon6b7f9552015-05-27 17:21:45 -070094 Bundle intentExtras,
Tyler Gunnc0bf6de2017-03-17 11:27:09 -070095 Bundle extras,
Tyler Gunn7e45b722018-12-04 12:56:45 -080096 long creationTimeMillis,
Tyler Gunnd57d76c2019-09-24 14:53:23 -070097 int callDirection,
98 int callerNumberVerificationStatus) {
Sailesh Nepal60437932014-04-05 16:44:55 -070099 mId = id;
100 mState = state;
Andrew Lee7f3d41f2014-09-11 17:33:16 -0700101 mDisconnectCause = disconnectCause;
Ihab Awadc0677542014-06-10 13:29:47 -0700102 mCannedSmsResponses = cannedSmsResponses;
Sailesh Nepal60437932014-04-05 16:44:55 -0700103 mCapabilities = capabilities;
Andrew Lee223ad142014-08-27 16:33:08 -0700104 mProperties = properties;
Christine Hallstrom2830ce92016-11-30 16:06:42 -0800105 mSupportedAudioRoutes = supportedAudioRoutes;
Sailesh Nepal60437932014-04-05 16:44:55 -0700106 mConnectTimeMillis = connectTimeMillis;
107 mHandle = handle;
Sailesh Nepal61203862014-07-11 14:50:13 -0700108 mHandlePresentation = handlePresentation;
109 mCallerDisplayName = callerDisplayName;
110 mCallerDisplayNamePresentation = callerDisplayNamePresentation;
Sailesh Nepal60437932014-04-05 16:44:55 -0700111 mGatewayInfo = gatewayInfo;
Evan Charlton8c8a0622014-07-20 12:31:00 -0700112 mAccountHandle = accountHandle;
Tyler Gunn75958422015-04-15 14:23:42 -0700113 mIsVideoCallProviderChanged = isVideoCallProviderChanged;
Andrew Lee50aca232014-07-22 16:41:54 -0700114 mVideoCallProvider = videoCallProvider;
Hall Liu95d55872017-01-25 17:12:49 -0800115 mIsRttCallChanged = isRttCallChanged;
116 mRttCall = rttCall;
Santos Cordon980acb92014-05-31 10:31:19 -0700117 mParentCallId = parentCallId;
118 mChildCallIds = childCallIds;
Sailesh Nepale7ef59a2014-07-08 21:48:22 -0700119 mStatusHints = statusHints;
Andrew Lee85f5d422014-07-11 17:22:03 -0700120 mVideoState = videoState;
Santos Cordon7c7bc7f2014-07-28 18:15:48 -0700121 mConferenceableCallIds = Collections.unmodifiableList(conferenceableCallIds);
Santos Cordon6b7f9552015-05-27 17:21:45 -0700122 mIntentExtras = intentExtras;
Nancy Chen10798dc2014-08-08 14:00:25 -0700123 mExtras = extras;
Tyler Gunnc0bf6de2017-03-17 11:27:09 -0700124 mCreationTimeMillis = creationTimeMillis;
Tyler Gunn9e76fd19b2018-12-17 09:56:11 -0800125 mCallDirection = callDirection;
Tyler Gunnd57d76c2019-09-24 14:53:23 -0700126 mCallerNumberVerificationStatus = callerNumberVerificationStatus;
Sailesh Nepal60437932014-04-05 16:44:55 -0700127 }
128
129 /** The unique ID of the call. */
Mathew Inwood8c854f82018-09-14 12:35:36 +0100130 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
Sailesh Nepal60437932014-04-05 16:44:55 -0700131 public String getId() {
132 return mId;
133 }
134
135 /** The current state of the call. */
Ihab Awadb19a0bc2014-08-07 19:46:01 -0700136 public int getState() {
Sailesh Nepal60437932014-04-05 16:44:55 -0700137 return mState;
138 }
139
140 /**
Andrew Lee7f3d41f2014-09-11 17:33:16 -0700141 * Reason for disconnection, as described by {@link android.telecomm.DisconnectCause}. Valid
142 * when call state is {@link CallState#DISCONNECTED}.
Sailesh Nepal60437932014-04-05 16:44:55 -0700143 */
Tyler Gunn7e45b722018-12-04 12:56:45 -0800144 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
Andrew Lee7f3d41f2014-09-11 17:33:16 -0700145 public DisconnectCause getDisconnectCause() {
146 return mDisconnectCause;
Sailesh Nepal60437932014-04-05 16:44:55 -0700147 }
148
Ihab Awadc0677542014-06-10 13:29:47 -0700149 /**
150 * The set of possible text message responses when this call is incoming.
151 */
152 public List<String> getCannedSmsResponses() {
153 return mCannedSmsResponses;
154 }
155
Sailesh Nepal60437932014-04-05 16:44:55 -0700156 // Bit mask of actions a call supports, values are defined in {@link CallCapabilities}.
157 public int getCapabilities() {
158 return mCapabilities;
159 }
160
Andrew Lee223ad142014-08-27 16:33:08 -0700161 /** Bitmask of properties of the call. */
162 public int getProperties() { return mProperties; }
163
Christine Hallstrom2830ce92016-11-30 16:06:42 -0800164 /** Bitmask of supported routes of the call */
165 public int getSupportedAudioRoutes() {
166 return mSupportedAudioRoutes;
167 }
168
Sailesh Nepal60437932014-04-05 16:44:55 -0700169 /** The time that the call switched to the active state. */
Tyler Gunn7e45b722018-12-04 12:56:45 -0800170 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
Sailesh Nepal60437932014-04-05 16:44:55 -0700171 public long getConnectTimeMillis() {
172 return mConnectTimeMillis;
173 }
174
175 /** The endpoint to which the call is connected. */
Tyler Gunn7e45b722018-12-04 12:56:45 -0800176 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
Sailesh Nepal60437932014-04-05 16:44:55 -0700177 public Uri getHandle() {
178 return mHandle;
179 }
180
Nancy Chen9d568c02014-09-08 14:17:59 -0700181 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700182 * The presentation requirements for the handle. See {@link TelecomManager} for valid values.
Nancy Chen9d568c02014-09-08 14:17:59 -0700183 */
Sailesh Nepal61203862014-07-11 14:50:13 -0700184 public int getHandlePresentation() {
185 return mHandlePresentation;
186 }
187
188 /** The endpoint to which the call is connected. */
189 public String getCallerDisplayName() {
190 return mCallerDisplayName;
191 }
192
Nancy Chen9d568c02014-09-08 14:17:59 -0700193 /**
194 * The presentation requirements for the caller display name.
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700195 * See {@link TelecomManager} for valid values.
Nancy Chen9d568c02014-09-08 14:17:59 -0700196 */
Sailesh Nepal61203862014-07-11 14:50:13 -0700197 public int getCallerDisplayNamePresentation() {
198 return mCallerDisplayNamePresentation;
199 }
200
Sailesh Nepal60437932014-04-05 16:44:55 -0700201 /** Gateway information for the call. */
202 public GatewayInfo getGatewayInfo() {
203 return mGatewayInfo;
204 }
205
Evan Charlton6eb262c2014-07-19 18:18:19 -0700206 /** PhoneAccountHandle information for the call. */
Evan Charlton8c8a0622014-07-20 12:31:00 -0700207 public PhoneAccountHandle getAccountHandle() {
208 return mAccountHandle;
Nancy Chen5ffbfcc2014-06-25 14:22:55 -0700209 }
210
Sailesh Nepal60437932014-04-05 16:44:55 -0700211 /**
Andrew Lee50aca232014-07-22 16:41:54 -0700212 * Returns an object for remotely communicating through the video call provider's binder.
Tyler Gunn159f35c2017-03-02 09:28:37 -0800213 *
214 * @param callingPackageName the package name of the calling InCallService.
215 * @param targetSdkVersion the target SDK version of the calling InCallService.
Andrew Lee50aca232014-07-22 16:41:54 -0700216 * @return The video call.
Andrew Lee5dc30752014-06-27 17:02:19 -0700217 */
Tyler Gunn159f35c2017-03-02 09:28:37 -0800218 public VideoCallImpl getVideoCallImpl(String callingPackageName, int targetSdkVersion) {
Andrew Lee50aca232014-07-22 16:41:54 -0700219 if (mVideoCall == null && mVideoCallProvider != null) {
Andrew Lee5dc30752014-06-27 17:02:19 -0700220 try {
Tyler Gunn159f35c2017-03-02 09:28:37 -0800221 mVideoCall = new VideoCallImpl(mVideoCallProvider, callingPackageName,
222 targetSdkVersion);
Andrew Lee5dc30752014-06-27 17:02:19 -0700223 } catch (RemoteException ignored) {
224 // Ignore RemoteException.
225 }
226 }
227
Andrew Lee50aca232014-07-22 16:41:54 -0700228 return mVideoCall;
Andrew Lee5dc30752014-06-27 17:02:19 -0700229 }
230
Tyler Gunnd1fdf3a2019-11-05 15:47:58 -0800231 public IVideoProvider getVideoProvider() {
232 return mVideoCallProvider;
233 }
234
Hall Liu95d55872017-01-25 17:12:49 -0800235 public boolean getIsRttCallChanged() {
236 return mIsRttCallChanged;
237 }
238
239 /**
240 * RTT communication channel information
241 * @return The ParcelableRttCall
242 */
243 public ParcelableRttCall getParcelableRttCall() {
244 return mRttCall;
245 }
246
Andrew Lee5dc30752014-06-27 17:02:19 -0700247 /**
Santos Cordon980acb92014-05-31 10:31:19 -0700248 * The conference call to which this call is conferenced. Null if not conferenced.
Santos Cordon980acb92014-05-31 10:31:19 -0700249 */
250 public String getParentCallId() {
251 return mParentCallId;
252 }
253
254 /**
255 * The child call-IDs if this call is a conference call. Returns an empty list if this is not
256 * a conference call or if the conference call contains no children.
Santos Cordon980acb92014-05-31 10:31:19 -0700257 */
258 public List<String> getChildCallIds() {
259 return mChildCallIds;
260 }
261
Santos Cordon7c7bc7f2014-07-28 18:15:48 -0700262 public List<String> getConferenceableCallIds() {
263 return mConferenceableCallIds;
264 }
265
Tyler Gunn8d83fa92014-07-01 11:31:21 -0700266 /**
Sailesh Nepale7ef59a2014-07-08 21:48:22 -0700267 * The status label and icon.
268 *
269 * @return Status hints.
270 */
271 public StatusHints getStatusHints() {
272 return mStatusHints;
273 }
274
Andrew Lee85f5d422014-07-11 17:22:03 -0700275 /**
276 * The video state.
277 * @return The video state of the call.
278 */
279 public int getVideoState() {
280 return mVideoState;
281 }
282
Nancy Chen10798dc2014-08-08 14:00:25 -0700283 /**
Santos Cordon6b7f9552015-05-27 17:21:45 -0700284 * Any extras associated with this call.
Nancy Chen10798dc2014-08-08 14:00:25 -0700285 *
286 * @return a bundle of extras
287 */
288 public Bundle getExtras() {
289 return mExtras;
290 }
291
Rekha Kumar07366812015-03-24 16:42:31 -0700292 /**
Santos Cordon6b7f9552015-05-27 17:21:45 -0700293 * Extras passed in as part of the original call intent.
294 *
295 * @return The intent extras.
296 */
297 public Bundle getIntentExtras() {
298 return mIntentExtras;
299 }
300
301 /**
Tyler Gunn75958422015-04-15 14:23:42 -0700302 * Indicates to the receiver of the {@link ParcelableCall} whether a change has occurred in the
303 * {@link android.telecom.InCallService.VideoCall} associated with this call. Since
304 * {@link #getVideoCall()} creates a new {@link VideoCallImpl}, it is useful to know whether
305 * the provider has changed (which can influence whether it is accessed).
306 *
307 * @return {@code true} if the video call changed, {@code false} otherwise.
308 */
309 public boolean isVideoCallProviderChanged() {
310 return mIsVideoCallProviderChanged;
311 }
312
Tyler Gunnc0bf6de2017-03-17 11:27:09 -0700313 /**
314 * @return The time the call was created, in milliseconds since the epoch.
315 */
316 public long getCreationTimeMillis() {
317 return mCreationTimeMillis;
318 }
319
Tyler Gunn7e45b722018-12-04 12:56:45 -0800320 /**
Tyler Gunn9e76fd19b2018-12-17 09:56:11 -0800321 * Indicates whether the call is an incoming or outgoing call.
322 */
323 public @CallDirection int getCallDirection() {
324 return mCallDirection;
325 }
326
Tyler Gunnd57d76c2019-09-24 14:53:23 -0700327 /**
328 * Gets the verification status for the phone number of an incoming call as identified in
329 * ATIS-1000082.
330 * @return the verification status.
331 */
332 public @Connection.VerificationStatus int getCallerNumberVerificationStatus() {
333 return mCallerNumberVerificationStatus;
334 }
335
Santos Cordon88b771d2014-07-19 13:10:40 -0700336 /** Responsible for creating ParcelableCall objects for deserialized Parcels. */
Tyler Gunn7e45b722018-12-04 12:56:45 -0800337 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
Jeff Sharkey9e8f83d2019-02-28 12:06:45 -0700338 public static final @android.annotation.NonNull Parcelable.Creator<ParcelableCall> CREATOR =
Santos Cordon88b771d2014-07-19 13:10:40 -0700339 new Parcelable.Creator<ParcelableCall> () {
Sailesh Nepal60437932014-04-05 16:44:55 -0700340 @Override
Santos Cordon88b771d2014-07-19 13:10:40 -0700341 public ParcelableCall createFromParcel(Parcel source) {
342 ClassLoader classLoader = ParcelableCall.class.getClassLoader();
Sailesh Nepal60437932014-04-05 16:44:55 -0700343 String id = source.readString();
Ihab Awadb19a0bc2014-08-07 19:46:01 -0700344 int state = source.readInt();
Andrew Lee7f3d41f2014-09-11 17:33:16 -0700345 DisconnectCause disconnectCause = source.readParcelable(classLoader);
Ihab Awadc0677542014-06-10 13:29:47 -0700346 List<String> cannedSmsResponses = new ArrayList<>();
347 source.readList(cannedSmsResponses, classLoader);
Sailesh Nepal60437932014-04-05 16:44:55 -0700348 int capabilities = source.readInt();
Andrew Lee223ad142014-08-27 16:33:08 -0700349 int properties = source.readInt();
Sailesh Nepal60437932014-04-05 16:44:55 -0700350 long connectTimeMillis = source.readLong();
Sailesh Nepal60437932014-04-05 16:44:55 -0700351 Uri handle = source.readParcelable(classLoader);
Sailesh Nepal61203862014-07-11 14:50:13 -0700352 int handlePresentation = source.readInt();
353 String callerDisplayName = source.readString();
354 int callerDisplayNamePresentation = source.readInt();
Sailesh Nepal60437932014-04-05 16:44:55 -0700355 GatewayInfo gatewayInfo = source.readParcelable(classLoader);
Evan Charlton8c8a0622014-07-20 12:31:00 -0700356 PhoneAccountHandle accountHandle = source.readParcelable(classLoader);
Tyler Gunn75958422015-04-15 14:23:42 -0700357 boolean isVideoCallProviderChanged = source.readByte() == 1;
Ihab Awadb19a0bc2014-08-07 19:46:01 -0700358 IVideoProvider videoCallProvider =
359 IVideoProvider.Stub.asInterface(source.readStrongBinder());
Santos Cordon980acb92014-05-31 10:31:19 -0700360 String parentCallId = source.readString();
361 List<String> childCallIds = new ArrayList<>();
362 source.readList(childCallIds, classLoader);
Sailesh Nepale7ef59a2014-07-08 21:48:22 -0700363 StatusHints statusHints = source.readParcelable(classLoader);
Andrew Lee85f5d422014-07-11 17:22:03 -0700364 int videoState = source.readInt();
Santos Cordon7c7bc7f2014-07-28 18:15:48 -0700365 List<String> conferenceableCallIds = new ArrayList<>();
366 source.readList(conferenceableCallIds, classLoader);
Santos Cordon6b7f9552015-05-27 17:21:45 -0700367 Bundle intentExtras = source.readBundle(classLoader);
368 Bundle extras = source.readBundle(classLoader);
Christine Hallstrom2830ce92016-11-30 16:06:42 -0800369 int supportedAudioRoutes = source.readInt();
Hall Liu95d55872017-01-25 17:12:49 -0800370 boolean isRttCallChanged = source.readByte() == 1;
371 ParcelableRttCall rttCall = source.readParcelable(classLoader);
Tyler Gunnc0bf6de2017-03-17 11:27:09 -0700372 long creationTimeMillis = source.readLong();
Tyler Gunn9e76fd19b2018-12-17 09:56:11 -0800373 int callDirection = source.readInt();
Tyler Gunnd57d76c2019-09-24 14:53:23 -0700374 int callerNumberVerificationStatus = source.readInt();
Andrew Lee7f3d41f2014-09-11 17:33:16 -0700375 return new ParcelableCall(
376 id,
377 state,
378 disconnectCause,
379 cannedSmsResponses,
380 capabilities,
381 properties,
Christine Hallstrom2830ce92016-11-30 16:06:42 -0800382 supportedAudioRoutes,
Andrew Lee7f3d41f2014-09-11 17:33:16 -0700383 connectTimeMillis,
384 handle,
385 handlePresentation,
386 callerDisplayName,
387 callerDisplayNamePresentation,
388 gatewayInfo,
389 accountHandle,
Tyler Gunn75958422015-04-15 14:23:42 -0700390 isVideoCallProviderChanged,
Andrew Lee7f3d41f2014-09-11 17:33:16 -0700391 videoCallProvider,
Hall Liu95d55872017-01-25 17:12:49 -0800392 isRttCallChanged,
393 rttCall,
Andrew Lee7f3d41f2014-09-11 17:33:16 -0700394 parentCallId,
395 childCallIds,
396 statusHints,
397 videoState,
398 conferenceableCallIds,
Santos Cordon6b7f9552015-05-27 17:21:45 -0700399 intentExtras,
Tyler Gunnc0bf6de2017-03-17 11:27:09 -0700400 extras,
Tyler Gunn7e45b722018-12-04 12:56:45 -0800401 creationTimeMillis,
Tyler Gunnd57d76c2019-09-24 14:53:23 -0700402 callDirection,
403 callerNumberVerificationStatus);
Sailesh Nepal60437932014-04-05 16:44:55 -0700404 }
405
406 @Override
Santos Cordon88b771d2014-07-19 13:10:40 -0700407 public ParcelableCall[] newArray(int size) {
408 return new ParcelableCall[size];
Sailesh Nepal60437932014-04-05 16:44:55 -0700409 }
410 };
411
412 /** {@inheritDoc} */
413 @Override
414 public int describeContents() {
415 return 0;
416 }
417
Santos Cordon88b771d2014-07-19 13:10:40 -0700418 /** Writes ParcelableCall object into a Parcel. */
Sailesh Nepal60437932014-04-05 16:44:55 -0700419 @Override
420 public void writeToParcel(Parcel destination, int flags) {
421 destination.writeString(mId);
Ihab Awadb19a0bc2014-08-07 19:46:01 -0700422 destination.writeInt(mState);
Andrew Lee7f3d41f2014-09-11 17:33:16 -0700423 destination.writeParcelable(mDisconnectCause, 0);
Ihab Awadc0677542014-06-10 13:29:47 -0700424 destination.writeList(mCannedSmsResponses);
Sailesh Nepal60437932014-04-05 16:44:55 -0700425 destination.writeInt(mCapabilities);
Andrew Lee223ad142014-08-27 16:33:08 -0700426 destination.writeInt(mProperties);
Sailesh Nepal60437932014-04-05 16:44:55 -0700427 destination.writeLong(mConnectTimeMillis);
428 destination.writeParcelable(mHandle, 0);
Sailesh Nepal61203862014-07-11 14:50:13 -0700429 destination.writeInt(mHandlePresentation);
430 destination.writeString(mCallerDisplayName);
431 destination.writeInt(mCallerDisplayNamePresentation);
Sailesh Nepal60437932014-04-05 16:44:55 -0700432 destination.writeParcelable(mGatewayInfo, 0);
Evan Charlton8c8a0622014-07-20 12:31:00 -0700433 destination.writeParcelable(mAccountHandle, 0);
Tyler Gunn75958422015-04-15 14:23:42 -0700434 destination.writeByte((byte) (mIsVideoCallProviderChanged ? 1 : 0));
Tyler Gunn807de8a2014-06-30 14:22:57 -0700435 destination.writeStrongBinder(
Andrew Lee50aca232014-07-22 16:41:54 -0700436 mVideoCallProvider != null ? mVideoCallProvider.asBinder() : null);
Santos Cordon980acb92014-05-31 10:31:19 -0700437 destination.writeString(mParentCallId);
438 destination.writeList(mChildCallIds);
Sailesh Nepale7ef59a2014-07-08 21:48:22 -0700439 destination.writeParcelable(mStatusHints, 0);
Andrew Lee85f5d422014-07-11 17:22:03 -0700440 destination.writeInt(mVideoState);
Santos Cordon7c7bc7f2014-07-28 18:15:48 -0700441 destination.writeList(mConferenceableCallIds);
Santos Cordon6b7f9552015-05-27 17:21:45 -0700442 destination.writeBundle(mIntentExtras);
443 destination.writeBundle(mExtras);
Christine Hallstrom2830ce92016-11-30 16:06:42 -0800444 destination.writeInt(mSupportedAudioRoutes);
Hall Liu95d55872017-01-25 17:12:49 -0800445 destination.writeByte((byte) (mIsRttCallChanged ? 1 : 0));
446 destination.writeParcelable(mRttCall, 0);
Tyler Gunnc0bf6de2017-03-17 11:27:09 -0700447 destination.writeLong(mCreationTimeMillis);
Tyler Gunn9e76fd19b2018-12-17 09:56:11 -0800448 destination.writeInt(mCallDirection);
Tyler Gunnd57d76c2019-09-24 14:53:23 -0700449 destination.writeInt(mCallerNumberVerificationStatus);
Sailesh Nepal60437932014-04-05 16:44:55 -0700450 }
Santos Cordonb6939982014-06-04 20:20:58 -0700451
452 @Override
453 public String toString() {
454 return String.format("[%s, parent:%s, children:%s]", mId, mParentCallId, mChildCallIds);
455 }
Sailesh Nepal60437932014-04-05 16:44:55 -0700456}