blob: be4e2f4c65e17e5dbc7366531267bf4bf3215585 [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
Artur Satayeva5264902019-12-10 17:47:56 +000019import android.compat.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;
Sailesh Nepal60437932014-04-05 16:44:55 -070023import android.os.Parcel;
24import android.os.Parcelable;
Andrew Lee5dc30752014-06-27 17:02:19 -070025import android.os.RemoteException;
Tyler Gunn9e76fd19b2018-12-17 09:56:11 -080026import android.telecom.Call.Details.CallDirection;
Sailesh Nepal60437932014-04-05 16:44:55 -070027
Artur Satayeva5264902019-12-10 17:47:56 +000028import com.android.internal.telecom.IVideoProvider;
29
Santos Cordon980acb92014-05-31 10:31:19 -070030import java.util.ArrayList;
Santos Cordon7c7bc7f2014-07-28 18:15:48 -070031import java.util.Collections;
Santos Cordon980acb92014-05-31 10:31:19 -070032import java.util.List;
Sailesh Nepal60437932014-04-05 16:44:55 -070033
34/**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070035 * Information about a call that is used between InCallService and Telecom.
Santos Cordon88b771d2014-07-19 13:10:40 -070036 * @hide
Sailesh Nepal60437932014-04-05 16:44:55 -070037 */
Santos Cordon88b771d2014-07-19 13:10:40 -070038public final class ParcelableCall implements Parcelable {
Sailesh Nepal60437932014-04-05 16:44:55 -070039 private final String mId;
Ihab Awadb19a0bc2014-08-07 19:46:01 -070040 private final int mState;
Andrew Lee7f3d41f2014-09-11 17:33:16 -070041 private final DisconnectCause mDisconnectCause;
Ihab Awadc0677542014-06-10 13:29:47 -070042 private final List<String> mCannedSmsResponses;
Sailesh Nepal60437932014-04-05 16:44:55 -070043 private final int mCapabilities;
Andrew Lee223ad142014-08-27 16:33:08 -070044 private final int mProperties;
Christine Hallstrom2830ce92016-11-30 16:06:42 -080045 private final int mSupportedAudioRoutes;
Sailesh Nepal60437932014-04-05 16:44:55 -070046 private final long mConnectTimeMillis;
47 private final Uri mHandle;
Sailesh Nepal61203862014-07-11 14:50:13 -070048 private final int mHandlePresentation;
49 private final String mCallerDisplayName;
50 private final int mCallerDisplayNamePresentation;
Sailesh Nepal60437932014-04-05 16:44:55 -070051 private final GatewayInfo mGatewayInfo;
Evan Charlton8c8a0622014-07-20 12:31:00 -070052 private final PhoneAccountHandle mAccountHandle;
Tyler Gunn75958422015-04-15 14:23:42 -070053 private final boolean mIsVideoCallProviderChanged;
Ihab Awadb19a0bc2014-08-07 19:46:01 -070054 private final IVideoProvider mVideoCallProvider;
Tyler Gunn584ba6c2015-12-08 10:53:41 -080055 private VideoCallImpl mVideoCall;
Hall Liu95d55872017-01-25 17:12:49 -080056 private final boolean mIsRttCallChanged;
57 private final ParcelableRttCall mRttCall;
Santos Cordon980acb92014-05-31 10:31:19 -070058 private final String mParentCallId;
59 private final List<String> mChildCallIds;
Sailesh Nepale7ef59a2014-07-08 21:48:22 -070060 private final StatusHints mStatusHints;
Andrew Lee85f5d422014-07-11 17:22:03 -070061 private final int mVideoState;
Santos Cordon7c7bc7f2014-07-28 18:15:48 -070062 private final List<String> mConferenceableCallIds;
Santos Cordon6b7f9552015-05-27 17:21:45 -070063 private final Bundle mIntentExtras;
Nancy Chen10798dc2014-08-08 14:00:25 -070064 private final Bundle mExtras;
Tyler Gunnc0bf6de2017-03-17 11:27:09 -070065 private final long mCreationTimeMillis;
Tyler Gunn9e76fd19b2018-12-17 09:56:11 -080066 private final int mCallDirection;
Tyler Gunnd57d76c2019-09-24 14:53:23 -070067 private final int mCallerNumberVerificationStatus;
Santos Cordon980acb92014-05-31 10:31:19 -070068
Santos Cordon88b771d2014-07-19 13:10:40 -070069 public ParcelableCall(
Sailesh Nepal60437932014-04-05 16:44:55 -070070 String id,
Ihab Awadb19a0bc2014-08-07 19:46:01 -070071 int state,
Andrew Lee7f3d41f2014-09-11 17:33:16 -070072 DisconnectCause disconnectCause,
Ihab Awadc0677542014-06-10 13:29:47 -070073 List<String> cannedSmsResponses,
Sailesh Nepal60437932014-04-05 16:44:55 -070074 int capabilities,
Andrew Lee223ad142014-08-27 16:33:08 -070075 int properties,
Christine Hallstrom2830ce92016-11-30 16:06:42 -080076 int supportedAudioRoutes,
Sailesh Nepal60437932014-04-05 16:44:55 -070077 long connectTimeMillis,
78 Uri handle,
Sailesh Nepal61203862014-07-11 14:50:13 -070079 int handlePresentation,
80 String callerDisplayName,
81 int callerDisplayNamePresentation,
Sailesh Nepal60437932014-04-05 16:44:55 -070082 GatewayInfo gatewayInfo,
Evan Charlton8c8a0622014-07-20 12:31:00 -070083 PhoneAccountHandle accountHandle,
Tyler Gunn75958422015-04-15 14:23:42 -070084 boolean isVideoCallProviderChanged,
Ihab Awadb19a0bc2014-08-07 19:46:01 -070085 IVideoProvider videoCallProvider,
Hall Liu95d55872017-01-25 17:12:49 -080086 boolean isRttCallChanged,
87 ParcelableRttCall rttCall,
Santos Cordon980acb92014-05-31 10:31:19 -070088 String parentCallId,
Tyler Gunn8d83fa92014-07-01 11:31:21 -070089 List<String> childCallIds,
Andrew Lee85f5d422014-07-11 17:22:03 -070090 StatusHints statusHints,
Santos Cordon7c7bc7f2014-07-28 18:15:48 -070091 int videoState,
Nancy Chen10798dc2014-08-08 14:00:25 -070092 List<String> conferenceableCallIds,
Santos Cordon6b7f9552015-05-27 17:21:45 -070093 Bundle intentExtras,
Tyler Gunnc0bf6de2017-03-17 11:27:09 -070094 Bundle extras,
Tyler Gunn7e45b722018-12-04 12:56:45 -080095 long creationTimeMillis,
Tyler Gunnd57d76c2019-09-24 14:53:23 -070096 int callDirection,
97 int callerNumberVerificationStatus) {
Sailesh Nepal60437932014-04-05 16:44:55 -070098 mId = id;
99 mState = state;
Andrew Lee7f3d41f2014-09-11 17:33:16 -0700100 mDisconnectCause = disconnectCause;
Ihab Awadc0677542014-06-10 13:29:47 -0700101 mCannedSmsResponses = cannedSmsResponses;
Sailesh Nepal60437932014-04-05 16:44:55 -0700102 mCapabilities = capabilities;
Andrew Lee223ad142014-08-27 16:33:08 -0700103 mProperties = properties;
Christine Hallstrom2830ce92016-11-30 16:06:42 -0800104 mSupportedAudioRoutes = supportedAudioRoutes;
Sailesh Nepal60437932014-04-05 16:44:55 -0700105 mConnectTimeMillis = connectTimeMillis;
106 mHandle = handle;
Sailesh Nepal61203862014-07-11 14:50:13 -0700107 mHandlePresentation = handlePresentation;
108 mCallerDisplayName = callerDisplayName;
109 mCallerDisplayNamePresentation = callerDisplayNamePresentation;
Sailesh Nepal60437932014-04-05 16:44:55 -0700110 mGatewayInfo = gatewayInfo;
Evan Charlton8c8a0622014-07-20 12:31:00 -0700111 mAccountHandle = accountHandle;
Tyler Gunn75958422015-04-15 14:23:42 -0700112 mIsVideoCallProviderChanged = isVideoCallProviderChanged;
Andrew Lee50aca232014-07-22 16:41:54 -0700113 mVideoCallProvider = videoCallProvider;
Hall Liu95d55872017-01-25 17:12:49 -0800114 mIsRttCallChanged = isRttCallChanged;
115 mRttCall = rttCall;
Santos Cordon980acb92014-05-31 10:31:19 -0700116 mParentCallId = parentCallId;
117 mChildCallIds = childCallIds;
Sailesh Nepale7ef59a2014-07-08 21:48:22 -0700118 mStatusHints = statusHints;
Andrew Lee85f5d422014-07-11 17:22:03 -0700119 mVideoState = videoState;
Santos Cordon7c7bc7f2014-07-28 18:15:48 -0700120 mConferenceableCallIds = Collections.unmodifiableList(conferenceableCallIds);
Santos Cordon6b7f9552015-05-27 17:21:45 -0700121 mIntentExtras = intentExtras;
Nancy Chen10798dc2014-08-08 14:00:25 -0700122 mExtras = extras;
Tyler Gunnc0bf6de2017-03-17 11:27:09 -0700123 mCreationTimeMillis = creationTimeMillis;
Tyler Gunn9e76fd19b2018-12-17 09:56:11 -0800124 mCallDirection = callDirection;
Tyler Gunnd57d76c2019-09-24 14:53:23 -0700125 mCallerNumberVerificationStatus = callerNumberVerificationStatus;
Sailesh Nepal60437932014-04-05 16:44:55 -0700126 }
127
128 /** The unique ID of the call. */
Mathew Inwood8c854f82018-09-14 12:35:36 +0100129 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
Sailesh Nepal60437932014-04-05 16:44:55 -0700130 public String getId() {
131 return mId;
132 }
133
134 /** The current state of the call. */
Ihab Awadb19a0bc2014-08-07 19:46:01 -0700135 public int getState() {
Sailesh Nepal60437932014-04-05 16:44:55 -0700136 return mState;
137 }
138
139 /**
Andrew Lee7f3d41f2014-09-11 17:33:16 -0700140 * Reason for disconnection, as described by {@link android.telecomm.DisconnectCause}. Valid
141 * when call state is {@link CallState#DISCONNECTED}.
Sailesh Nepal60437932014-04-05 16:44:55 -0700142 */
Tyler Gunn7e45b722018-12-04 12:56:45 -0800143 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
Andrew Lee7f3d41f2014-09-11 17:33:16 -0700144 public DisconnectCause getDisconnectCause() {
145 return mDisconnectCause;
Sailesh Nepal60437932014-04-05 16:44:55 -0700146 }
147
Ihab Awadc0677542014-06-10 13:29:47 -0700148 /**
149 * The set of possible text message responses when this call is incoming.
150 */
151 public List<String> getCannedSmsResponses() {
152 return mCannedSmsResponses;
153 }
154
Sailesh Nepal60437932014-04-05 16:44:55 -0700155 // Bit mask of actions a call supports, values are defined in {@link CallCapabilities}.
156 public int getCapabilities() {
157 return mCapabilities;
158 }
159
Andrew Lee223ad142014-08-27 16:33:08 -0700160 /** Bitmask of properties of the call. */
161 public int getProperties() { return mProperties; }
162
Christine Hallstrom2830ce92016-11-30 16:06:42 -0800163 /** Bitmask of supported routes of the call */
164 public int getSupportedAudioRoutes() {
165 return mSupportedAudioRoutes;
166 }
167
Sailesh Nepal60437932014-04-05 16:44:55 -0700168 /** The time that the call switched to the active state. */
Tyler Gunn7e45b722018-12-04 12:56:45 -0800169 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
Sailesh Nepal60437932014-04-05 16:44:55 -0700170 public long getConnectTimeMillis() {
171 return mConnectTimeMillis;
172 }
173
174 /** The endpoint to which the call is connected. */
Tyler Gunn7e45b722018-12-04 12:56:45 -0800175 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
Sailesh Nepal60437932014-04-05 16:44:55 -0700176 public Uri getHandle() {
177 return mHandle;
178 }
179
Nancy Chen9d568c02014-09-08 14:17:59 -0700180 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700181 * The presentation requirements for the handle. See {@link TelecomManager} for valid values.
Nancy Chen9d568c02014-09-08 14:17:59 -0700182 */
Sailesh Nepal61203862014-07-11 14:50:13 -0700183 public int getHandlePresentation() {
184 return mHandlePresentation;
185 }
186
187 /** The endpoint to which the call is connected. */
188 public String getCallerDisplayName() {
189 return mCallerDisplayName;
190 }
191
Nancy Chen9d568c02014-09-08 14:17:59 -0700192 /**
193 * The presentation requirements for the caller display name.
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700194 * See {@link TelecomManager} for valid values.
Nancy Chen9d568c02014-09-08 14:17:59 -0700195 */
Sailesh Nepal61203862014-07-11 14:50:13 -0700196 public int getCallerDisplayNamePresentation() {
197 return mCallerDisplayNamePresentation;
198 }
199
Sailesh Nepal60437932014-04-05 16:44:55 -0700200 /** Gateway information for the call. */
201 public GatewayInfo getGatewayInfo() {
202 return mGatewayInfo;
203 }
204
Evan Charlton6eb262c2014-07-19 18:18:19 -0700205 /** PhoneAccountHandle information for the call. */
Evan Charlton8c8a0622014-07-20 12:31:00 -0700206 public PhoneAccountHandle getAccountHandle() {
207 return mAccountHandle;
Nancy Chen5ffbfcc2014-06-25 14:22:55 -0700208 }
209
Sailesh Nepal60437932014-04-05 16:44:55 -0700210 /**
Andrew Lee50aca232014-07-22 16:41:54 -0700211 * Returns an object for remotely communicating through the video call provider's binder.
Tyler Gunn159f35c2017-03-02 09:28:37 -0800212 *
213 * @param callingPackageName the package name of the calling InCallService.
214 * @param targetSdkVersion the target SDK version of the calling InCallService.
Andrew Lee50aca232014-07-22 16:41:54 -0700215 * @return The video call.
Andrew Lee5dc30752014-06-27 17:02:19 -0700216 */
Tyler Gunn159f35c2017-03-02 09:28:37 -0800217 public VideoCallImpl getVideoCallImpl(String callingPackageName, int targetSdkVersion) {
Andrew Lee50aca232014-07-22 16:41:54 -0700218 if (mVideoCall == null && mVideoCallProvider != null) {
Andrew Lee5dc30752014-06-27 17:02:19 -0700219 try {
Tyler Gunn159f35c2017-03-02 09:28:37 -0800220 mVideoCall = new VideoCallImpl(mVideoCallProvider, callingPackageName,
221 targetSdkVersion);
Andrew Lee5dc30752014-06-27 17:02:19 -0700222 } catch (RemoteException ignored) {
223 // Ignore RemoteException.
224 }
225 }
226
Andrew Lee50aca232014-07-22 16:41:54 -0700227 return mVideoCall;
Andrew Lee5dc30752014-06-27 17:02:19 -0700228 }
229
Tyler Gunnd1fdf3a2019-11-05 15:47:58 -0800230 public IVideoProvider getVideoProvider() {
231 return mVideoCallProvider;
232 }
233
Hall Liu95d55872017-01-25 17:12:49 -0800234 public boolean getIsRttCallChanged() {
235 return mIsRttCallChanged;
236 }
237
238 /**
239 * RTT communication channel information
240 * @return The ParcelableRttCall
241 */
242 public ParcelableRttCall getParcelableRttCall() {
243 return mRttCall;
244 }
245
Andrew Lee5dc30752014-06-27 17:02:19 -0700246 /**
Santos Cordon980acb92014-05-31 10:31:19 -0700247 * The conference call to which this call is conferenced. Null if not conferenced.
Santos Cordon980acb92014-05-31 10:31:19 -0700248 */
249 public String getParentCallId() {
250 return mParentCallId;
251 }
252
253 /**
254 * The child call-IDs if this call is a conference call. Returns an empty list if this is not
255 * a conference call or if the conference call contains no children.
Santos Cordon980acb92014-05-31 10:31:19 -0700256 */
257 public List<String> getChildCallIds() {
258 return mChildCallIds;
259 }
260
Santos Cordon7c7bc7f2014-07-28 18:15:48 -0700261 public List<String> getConferenceableCallIds() {
262 return mConferenceableCallIds;
263 }
264
Tyler Gunn8d83fa92014-07-01 11:31:21 -0700265 /**
Sailesh Nepale7ef59a2014-07-08 21:48:22 -0700266 * The status label and icon.
267 *
268 * @return Status hints.
269 */
270 public StatusHints getStatusHints() {
271 return mStatusHints;
272 }
273
Andrew Lee85f5d422014-07-11 17:22:03 -0700274 /**
275 * The video state.
276 * @return The video state of the call.
277 */
278 public int getVideoState() {
279 return mVideoState;
280 }
281
Nancy Chen10798dc2014-08-08 14:00:25 -0700282 /**
Santos Cordon6b7f9552015-05-27 17:21:45 -0700283 * Any extras associated with this call.
Nancy Chen10798dc2014-08-08 14:00:25 -0700284 *
285 * @return a bundle of extras
286 */
287 public Bundle getExtras() {
288 return mExtras;
289 }
290
Rekha Kumar07366812015-03-24 16:42:31 -0700291 /**
Santos Cordon6b7f9552015-05-27 17:21:45 -0700292 * Extras passed in as part of the original call intent.
293 *
294 * @return The intent extras.
295 */
296 public Bundle getIntentExtras() {
297 return mIntentExtras;
298 }
299
300 /**
Tyler Gunn75958422015-04-15 14:23:42 -0700301 * Indicates to the receiver of the {@link ParcelableCall} whether a change has occurred in the
302 * {@link android.telecom.InCallService.VideoCall} associated with this call. Since
303 * {@link #getVideoCall()} creates a new {@link VideoCallImpl}, it is useful to know whether
304 * the provider has changed (which can influence whether it is accessed).
305 *
306 * @return {@code true} if the video call changed, {@code false} otherwise.
307 */
308 public boolean isVideoCallProviderChanged() {
309 return mIsVideoCallProviderChanged;
310 }
311
Tyler Gunnc0bf6de2017-03-17 11:27:09 -0700312 /**
313 * @return The time the call was created, in milliseconds since the epoch.
314 */
315 public long getCreationTimeMillis() {
316 return mCreationTimeMillis;
317 }
318
Tyler Gunn7e45b722018-12-04 12:56:45 -0800319 /**
Tyler Gunn9e76fd19b2018-12-17 09:56:11 -0800320 * Indicates whether the call is an incoming or outgoing call.
321 */
322 public @CallDirection int getCallDirection() {
323 return mCallDirection;
324 }
325
Tyler Gunnd57d76c2019-09-24 14:53:23 -0700326 /**
327 * Gets the verification status for the phone number of an incoming call as identified in
328 * ATIS-1000082.
329 * @return the verification status.
330 */
331 public @Connection.VerificationStatus int getCallerNumberVerificationStatus() {
332 return mCallerNumberVerificationStatus;
333 }
334
Santos Cordon88b771d2014-07-19 13:10:40 -0700335 /** Responsible for creating ParcelableCall objects for deserialized Parcels. */
Tyler Gunn7e45b722018-12-04 12:56:45 -0800336 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
Jeff Sharkey9e8f83d2019-02-28 12:06:45 -0700337 public static final @android.annotation.NonNull Parcelable.Creator<ParcelableCall> CREATOR =
Santos Cordon88b771d2014-07-19 13:10:40 -0700338 new Parcelable.Creator<ParcelableCall> () {
Sailesh Nepal60437932014-04-05 16:44:55 -0700339 @Override
Santos Cordon88b771d2014-07-19 13:10:40 -0700340 public ParcelableCall createFromParcel(Parcel source) {
341 ClassLoader classLoader = ParcelableCall.class.getClassLoader();
Sailesh Nepal60437932014-04-05 16:44:55 -0700342 String id = source.readString();
Ihab Awadb19a0bc2014-08-07 19:46:01 -0700343 int state = source.readInt();
Andrew Lee7f3d41f2014-09-11 17:33:16 -0700344 DisconnectCause disconnectCause = source.readParcelable(classLoader);
Ihab Awadc0677542014-06-10 13:29:47 -0700345 List<String> cannedSmsResponses = new ArrayList<>();
346 source.readList(cannedSmsResponses, classLoader);
Sailesh Nepal60437932014-04-05 16:44:55 -0700347 int capabilities = source.readInt();
Andrew Lee223ad142014-08-27 16:33:08 -0700348 int properties = source.readInt();
Sailesh Nepal60437932014-04-05 16:44:55 -0700349 long connectTimeMillis = source.readLong();
Sailesh Nepal60437932014-04-05 16:44:55 -0700350 Uri handle = source.readParcelable(classLoader);
Sailesh Nepal61203862014-07-11 14:50:13 -0700351 int handlePresentation = source.readInt();
352 String callerDisplayName = source.readString();
353 int callerDisplayNamePresentation = source.readInt();
Sailesh Nepal60437932014-04-05 16:44:55 -0700354 GatewayInfo gatewayInfo = source.readParcelable(classLoader);
Evan Charlton8c8a0622014-07-20 12:31:00 -0700355 PhoneAccountHandle accountHandle = source.readParcelable(classLoader);
Tyler Gunn75958422015-04-15 14:23:42 -0700356 boolean isVideoCallProviderChanged = source.readByte() == 1;
Ihab Awadb19a0bc2014-08-07 19:46:01 -0700357 IVideoProvider videoCallProvider =
358 IVideoProvider.Stub.asInterface(source.readStrongBinder());
Santos Cordon980acb92014-05-31 10:31:19 -0700359 String parentCallId = source.readString();
360 List<String> childCallIds = new ArrayList<>();
361 source.readList(childCallIds, classLoader);
Sailesh Nepale7ef59a2014-07-08 21:48:22 -0700362 StatusHints statusHints = source.readParcelable(classLoader);
Andrew Lee85f5d422014-07-11 17:22:03 -0700363 int videoState = source.readInt();
Santos Cordon7c7bc7f2014-07-28 18:15:48 -0700364 List<String> conferenceableCallIds = new ArrayList<>();
365 source.readList(conferenceableCallIds, classLoader);
Santos Cordon6b7f9552015-05-27 17:21:45 -0700366 Bundle intentExtras = source.readBundle(classLoader);
367 Bundle extras = source.readBundle(classLoader);
Christine Hallstrom2830ce92016-11-30 16:06:42 -0800368 int supportedAudioRoutes = source.readInt();
Hall Liu95d55872017-01-25 17:12:49 -0800369 boolean isRttCallChanged = source.readByte() == 1;
370 ParcelableRttCall rttCall = source.readParcelable(classLoader);
Tyler Gunnc0bf6de2017-03-17 11:27:09 -0700371 long creationTimeMillis = source.readLong();
Tyler Gunn9e76fd19b2018-12-17 09:56:11 -0800372 int callDirection = source.readInt();
Tyler Gunnd57d76c2019-09-24 14:53:23 -0700373 int callerNumberVerificationStatus = source.readInt();
Andrew Lee7f3d41f2014-09-11 17:33:16 -0700374 return new ParcelableCall(
375 id,
376 state,
377 disconnectCause,
378 cannedSmsResponses,
379 capabilities,
380 properties,
Christine Hallstrom2830ce92016-11-30 16:06:42 -0800381 supportedAudioRoutes,
Andrew Lee7f3d41f2014-09-11 17:33:16 -0700382 connectTimeMillis,
383 handle,
384 handlePresentation,
385 callerDisplayName,
386 callerDisplayNamePresentation,
387 gatewayInfo,
388 accountHandle,
Tyler Gunn75958422015-04-15 14:23:42 -0700389 isVideoCallProviderChanged,
Andrew Lee7f3d41f2014-09-11 17:33:16 -0700390 videoCallProvider,
Hall Liu95d55872017-01-25 17:12:49 -0800391 isRttCallChanged,
392 rttCall,
Andrew Lee7f3d41f2014-09-11 17:33:16 -0700393 parentCallId,
394 childCallIds,
395 statusHints,
396 videoState,
397 conferenceableCallIds,
Santos Cordon6b7f9552015-05-27 17:21:45 -0700398 intentExtras,
Tyler Gunnc0bf6de2017-03-17 11:27:09 -0700399 extras,
Tyler Gunn7e45b722018-12-04 12:56:45 -0800400 creationTimeMillis,
Tyler Gunnd57d76c2019-09-24 14:53:23 -0700401 callDirection,
402 callerNumberVerificationStatus);
Sailesh Nepal60437932014-04-05 16:44:55 -0700403 }
404
405 @Override
Santos Cordon88b771d2014-07-19 13:10:40 -0700406 public ParcelableCall[] newArray(int size) {
407 return new ParcelableCall[size];
Sailesh Nepal60437932014-04-05 16:44:55 -0700408 }
409 };
410
411 /** {@inheritDoc} */
412 @Override
413 public int describeContents() {
414 return 0;
415 }
416
Santos Cordon88b771d2014-07-19 13:10:40 -0700417 /** Writes ParcelableCall object into a Parcel. */
Sailesh Nepal60437932014-04-05 16:44:55 -0700418 @Override
419 public void writeToParcel(Parcel destination, int flags) {
420 destination.writeString(mId);
Ihab Awadb19a0bc2014-08-07 19:46:01 -0700421 destination.writeInt(mState);
Andrew Lee7f3d41f2014-09-11 17:33:16 -0700422 destination.writeParcelable(mDisconnectCause, 0);
Ihab Awadc0677542014-06-10 13:29:47 -0700423 destination.writeList(mCannedSmsResponses);
Sailesh Nepal60437932014-04-05 16:44:55 -0700424 destination.writeInt(mCapabilities);
Andrew Lee223ad142014-08-27 16:33:08 -0700425 destination.writeInt(mProperties);
Sailesh Nepal60437932014-04-05 16:44:55 -0700426 destination.writeLong(mConnectTimeMillis);
427 destination.writeParcelable(mHandle, 0);
Sailesh Nepal61203862014-07-11 14:50:13 -0700428 destination.writeInt(mHandlePresentation);
429 destination.writeString(mCallerDisplayName);
430 destination.writeInt(mCallerDisplayNamePresentation);
Sailesh Nepal60437932014-04-05 16:44:55 -0700431 destination.writeParcelable(mGatewayInfo, 0);
Evan Charlton8c8a0622014-07-20 12:31:00 -0700432 destination.writeParcelable(mAccountHandle, 0);
Tyler Gunn75958422015-04-15 14:23:42 -0700433 destination.writeByte((byte) (mIsVideoCallProviderChanged ? 1 : 0));
Tyler Gunn807de8a2014-06-30 14:22:57 -0700434 destination.writeStrongBinder(
Andrew Lee50aca232014-07-22 16:41:54 -0700435 mVideoCallProvider != null ? mVideoCallProvider.asBinder() : null);
Santos Cordon980acb92014-05-31 10:31:19 -0700436 destination.writeString(mParentCallId);
437 destination.writeList(mChildCallIds);
Sailesh Nepale7ef59a2014-07-08 21:48:22 -0700438 destination.writeParcelable(mStatusHints, 0);
Andrew Lee85f5d422014-07-11 17:22:03 -0700439 destination.writeInt(mVideoState);
Santos Cordon7c7bc7f2014-07-28 18:15:48 -0700440 destination.writeList(mConferenceableCallIds);
Santos Cordon6b7f9552015-05-27 17:21:45 -0700441 destination.writeBundle(mIntentExtras);
442 destination.writeBundle(mExtras);
Christine Hallstrom2830ce92016-11-30 16:06:42 -0800443 destination.writeInt(mSupportedAudioRoutes);
Hall Liu95d55872017-01-25 17:12:49 -0800444 destination.writeByte((byte) (mIsRttCallChanged ? 1 : 0));
445 destination.writeParcelable(mRttCall, 0);
Tyler Gunnc0bf6de2017-03-17 11:27:09 -0700446 destination.writeLong(mCreationTimeMillis);
Tyler Gunn9e76fd19b2018-12-17 09:56:11 -0800447 destination.writeInt(mCallDirection);
Tyler Gunnd57d76c2019-09-24 14:53:23 -0700448 destination.writeInt(mCallerNumberVerificationStatus);
Sailesh Nepal60437932014-04-05 16:44:55 -0700449 }
Santos Cordonb6939982014-06-04 20:20:58 -0700450
451 @Override
452 public String toString() {
453 return String.format("[%s, parent:%s, children:%s]", mId, mParentCallId, mChildCallIds);
454 }
Sailesh Nepal60437932014-04-05 16:44:55 -0700455}