blob: f7dec83c3acedf381ae16285e4b2ae298d5b1b2b [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
Tyler Gunn7e45b722018-12-04 12:56:45 -080019import android.annotation.Nullable;
Mathew Inwoode5bfa3e2018-08-01 11:26:20 +010020import android.annotation.UnsupportedAppUsage;
Sailesh Nepal60437932014-04-05 16:44:55 -070021import android.net.Uri;
Mathew Inwood8c854f82018-09-14 12:35:36 +010022import android.os.Build;
Nancy Chen10798dc2014-08-08 14:00:25 -070023import android.os.Bundle;
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 Gunn9e76fd12018-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 Gunn7e45b722018-12-04 12:56:45 -080067 private final CallIdentification mCallIdentification;
Tyler Gunn9e76fd12018-12-17 09:56:11 -080068 private final int mCallDirection;
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 Gunn9e76fd12018-12-17 09:56:11 -080097 CallIdentification callIdentification,
98 int callDirection) {
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 Gunn7e45b722018-12-04 12:56:45 -0800125 mCallIdentification = callIdentification;
Tyler Gunn9e76fd12018-12-17 09:56:11 -0800126 mCallDirection = callDirection;
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
Hall Liu95d55872017-01-25 17:12:49 -0800231 public boolean getIsRttCallChanged() {
232 return mIsRttCallChanged;
233 }
234
235 /**
236 * RTT communication channel information
237 * @return The ParcelableRttCall
238 */
239 public ParcelableRttCall getParcelableRttCall() {
240 return mRttCall;
241 }
242
Andrew Lee5dc30752014-06-27 17:02:19 -0700243 /**
Santos Cordon980acb92014-05-31 10:31:19 -0700244 * The conference call to which this call is conferenced. Null if not conferenced.
Santos Cordon980acb92014-05-31 10:31:19 -0700245 */
246 public String getParentCallId() {
247 return mParentCallId;
248 }
249
250 /**
251 * The child call-IDs if this call is a conference call. Returns an empty list if this is not
252 * a conference call or if the conference call contains no children.
Santos Cordon980acb92014-05-31 10:31:19 -0700253 */
254 public List<String> getChildCallIds() {
255 return mChildCallIds;
256 }
257
Santos Cordon7c7bc7f2014-07-28 18:15:48 -0700258 public List<String> getConferenceableCallIds() {
259 return mConferenceableCallIds;
260 }
261
Tyler Gunn8d83fa92014-07-01 11:31:21 -0700262 /**
Sailesh Nepale7ef59a2014-07-08 21:48:22 -0700263 * The status label and icon.
264 *
265 * @return Status hints.
266 */
267 public StatusHints getStatusHints() {
268 return mStatusHints;
269 }
270
Andrew Lee85f5d422014-07-11 17:22:03 -0700271 /**
272 * The video state.
273 * @return The video state of the call.
274 */
275 public int getVideoState() {
276 return mVideoState;
277 }
278
Nancy Chen10798dc2014-08-08 14:00:25 -0700279 /**
Santos Cordon6b7f9552015-05-27 17:21:45 -0700280 * Any extras associated with this call.
Nancy Chen10798dc2014-08-08 14:00:25 -0700281 *
282 * @return a bundle of extras
283 */
284 public Bundle getExtras() {
285 return mExtras;
286 }
287
Rekha Kumar07366812015-03-24 16:42:31 -0700288 /**
Santos Cordon6b7f9552015-05-27 17:21:45 -0700289 * Extras passed in as part of the original call intent.
290 *
291 * @return The intent extras.
292 */
293 public Bundle getIntentExtras() {
294 return mIntentExtras;
295 }
296
297 /**
Tyler Gunn75958422015-04-15 14:23:42 -0700298 * Indicates to the receiver of the {@link ParcelableCall} whether a change has occurred in the
299 * {@link android.telecom.InCallService.VideoCall} associated with this call. Since
300 * {@link #getVideoCall()} creates a new {@link VideoCallImpl}, it is useful to know whether
301 * the provider has changed (which can influence whether it is accessed).
302 *
303 * @return {@code true} if the video call changed, {@code false} otherwise.
304 */
305 public boolean isVideoCallProviderChanged() {
306 return mIsVideoCallProviderChanged;
307 }
308
Tyler Gunnc0bf6de2017-03-17 11:27:09 -0700309 /**
310 * @return The time the call was created, in milliseconds since the epoch.
311 */
312 public long getCreationTimeMillis() {
313 return mCreationTimeMillis;
314 }
315
Tyler Gunn7e45b722018-12-04 12:56:45 -0800316 /**
317 * Contains call identification information returned by a {@link CallScreeningService}.
318 * @return The {@link CallIdentification} for this call, or {@code null} if a
319 * {@link CallScreeningService} did not provide information.
320 */
321 public @Nullable CallIdentification getCallIdentification() {
322 return mCallIdentification;
323 }
324
Tyler Gunn9e76fd12018-12-17 09:56:11 -0800325 /**
326 * Indicates whether the call is an incoming or outgoing call.
327 */
328 public @CallDirection int getCallDirection() {
329 return mCallDirection;
330 }
331
Santos Cordon88b771d2014-07-19 13:10:40 -0700332 /** Responsible for creating ParcelableCall objects for deserialized Parcels. */
Tyler Gunn7e45b722018-12-04 12:56:45 -0800333 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
Santos Cordon88b771d2014-07-19 13:10:40 -0700334 public static final Parcelable.Creator<ParcelableCall> CREATOR =
335 new Parcelable.Creator<ParcelableCall> () {
Sailesh Nepal60437932014-04-05 16:44:55 -0700336 @Override
Santos Cordon88b771d2014-07-19 13:10:40 -0700337 public ParcelableCall createFromParcel(Parcel source) {
338 ClassLoader classLoader = ParcelableCall.class.getClassLoader();
Sailesh Nepal60437932014-04-05 16:44:55 -0700339 String id = source.readString();
Ihab Awadb19a0bc2014-08-07 19:46:01 -0700340 int state = source.readInt();
Andrew Lee7f3d41f2014-09-11 17:33:16 -0700341 DisconnectCause disconnectCause = source.readParcelable(classLoader);
Ihab Awadc0677542014-06-10 13:29:47 -0700342 List<String> cannedSmsResponses = new ArrayList<>();
343 source.readList(cannedSmsResponses, classLoader);
Sailesh Nepal60437932014-04-05 16:44:55 -0700344 int capabilities = source.readInt();
Andrew Lee223ad142014-08-27 16:33:08 -0700345 int properties = source.readInt();
Sailesh Nepal60437932014-04-05 16:44:55 -0700346 long connectTimeMillis = source.readLong();
Sailesh Nepal60437932014-04-05 16:44:55 -0700347 Uri handle = source.readParcelable(classLoader);
Sailesh Nepal61203862014-07-11 14:50:13 -0700348 int handlePresentation = source.readInt();
349 String callerDisplayName = source.readString();
350 int callerDisplayNamePresentation = source.readInt();
Sailesh Nepal60437932014-04-05 16:44:55 -0700351 GatewayInfo gatewayInfo = source.readParcelable(classLoader);
Evan Charlton8c8a0622014-07-20 12:31:00 -0700352 PhoneAccountHandle accountHandle = source.readParcelable(classLoader);
Tyler Gunn75958422015-04-15 14:23:42 -0700353 boolean isVideoCallProviderChanged = source.readByte() == 1;
Ihab Awadb19a0bc2014-08-07 19:46:01 -0700354 IVideoProvider videoCallProvider =
355 IVideoProvider.Stub.asInterface(source.readStrongBinder());
Santos Cordon980acb92014-05-31 10:31:19 -0700356 String parentCallId = source.readString();
357 List<String> childCallIds = new ArrayList<>();
358 source.readList(childCallIds, classLoader);
Sailesh Nepale7ef59a2014-07-08 21:48:22 -0700359 StatusHints statusHints = source.readParcelable(classLoader);
Andrew Lee85f5d422014-07-11 17:22:03 -0700360 int videoState = source.readInt();
Santos Cordon7c7bc7f2014-07-28 18:15:48 -0700361 List<String> conferenceableCallIds = new ArrayList<>();
362 source.readList(conferenceableCallIds, classLoader);
Santos Cordon6b7f9552015-05-27 17:21:45 -0700363 Bundle intentExtras = source.readBundle(classLoader);
364 Bundle extras = source.readBundle(classLoader);
Christine Hallstrom2830ce92016-11-30 16:06:42 -0800365 int supportedAudioRoutes = source.readInt();
Hall Liu95d55872017-01-25 17:12:49 -0800366 boolean isRttCallChanged = source.readByte() == 1;
367 ParcelableRttCall rttCall = source.readParcelable(classLoader);
Tyler Gunnc0bf6de2017-03-17 11:27:09 -0700368 long creationTimeMillis = source.readLong();
Tyler Gunn7e45b722018-12-04 12:56:45 -0800369 CallIdentification callIdentification = source.readParcelable(classLoader);
Tyler Gunn9e76fd12018-12-17 09:56:11 -0800370 int callDirection = source.readInt();
Andrew Lee7f3d41f2014-09-11 17:33:16 -0700371 return new ParcelableCall(
372 id,
373 state,
374 disconnectCause,
375 cannedSmsResponses,
376 capabilities,
377 properties,
Christine Hallstrom2830ce92016-11-30 16:06:42 -0800378 supportedAudioRoutes,
Andrew Lee7f3d41f2014-09-11 17:33:16 -0700379 connectTimeMillis,
380 handle,
381 handlePresentation,
382 callerDisplayName,
383 callerDisplayNamePresentation,
384 gatewayInfo,
385 accountHandle,
Tyler Gunn75958422015-04-15 14:23:42 -0700386 isVideoCallProviderChanged,
Andrew Lee7f3d41f2014-09-11 17:33:16 -0700387 videoCallProvider,
Hall Liu95d55872017-01-25 17:12:49 -0800388 isRttCallChanged,
389 rttCall,
Andrew Lee7f3d41f2014-09-11 17:33:16 -0700390 parentCallId,
391 childCallIds,
392 statusHints,
393 videoState,
394 conferenceableCallIds,
Santos Cordon6b7f9552015-05-27 17:21:45 -0700395 intentExtras,
Tyler Gunnc0bf6de2017-03-17 11:27:09 -0700396 extras,
Tyler Gunn7e45b722018-12-04 12:56:45 -0800397 creationTimeMillis,
Tyler Gunn9e76fd12018-12-17 09:56:11 -0800398 callIdentification,
399 callDirection);
Sailesh Nepal60437932014-04-05 16:44:55 -0700400 }
401
402 @Override
Santos Cordon88b771d2014-07-19 13:10:40 -0700403 public ParcelableCall[] newArray(int size) {
404 return new ParcelableCall[size];
Sailesh Nepal60437932014-04-05 16:44:55 -0700405 }
406 };
407
408 /** {@inheritDoc} */
409 @Override
410 public int describeContents() {
411 return 0;
412 }
413
Santos Cordon88b771d2014-07-19 13:10:40 -0700414 /** Writes ParcelableCall object into a Parcel. */
Sailesh Nepal60437932014-04-05 16:44:55 -0700415 @Override
416 public void writeToParcel(Parcel destination, int flags) {
417 destination.writeString(mId);
Ihab Awadb19a0bc2014-08-07 19:46:01 -0700418 destination.writeInt(mState);
Andrew Lee7f3d41f2014-09-11 17:33:16 -0700419 destination.writeParcelable(mDisconnectCause, 0);
Ihab Awadc0677542014-06-10 13:29:47 -0700420 destination.writeList(mCannedSmsResponses);
Sailesh Nepal60437932014-04-05 16:44:55 -0700421 destination.writeInt(mCapabilities);
Andrew Lee223ad142014-08-27 16:33:08 -0700422 destination.writeInt(mProperties);
Sailesh Nepal60437932014-04-05 16:44:55 -0700423 destination.writeLong(mConnectTimeMillis);
424 destination.writeParcelable(mHandle, 0);
Sailesh Nepal61203862014-07-11 14:50:13 -0700425 destination.writeInt(mHandlePresentation);
426 destination.writeString(mCallerDisplayName);
427 destination.writeInt(mCallerDisplayNamePresentation);
Sailesh Nepal60437932014-04-05 16:44:55 -0700428 destination.writeParcelable(mGatewayInfo, 0);
Evan Charlton8c8a0622014-07-20 12:31:00 -0700429 destination.writeParcelable(mAccountHandle, 0);
Tyler Gunn75958422015-04-15 14:23:42 -0700430 destination.writeByte((byte) (mIsVideoCallProviderChanged ? 1 : 0));
Tyler Gunn807de8a2014-06-30 14:22:57 -0700431 destination.writeStrongBinder(
Andrew Lee50aca232014-07-22 16:41:54 -0700432 mVideoCallProvider != null ? mVideoCallProvider.asBinder() : null);
Santos Cordon980acb92014-05-31 10:31:19 -0700433 destination.writeString(mParentCallId);
434 destination.writeList(mChildCallIds);
Sailesh Nepale7ef59a2014-07-08 21:48:22 -0700435 destination.writeParcelable(mStatusHints, 0);
Andrew Lee85f5d422014-07-11 17:22:03 -0700436 destination.writeInt(mVideoState);
Santos Cordon7c7bc7f2014-07-28 18:15:48 -0700437 destination.writeList(mConferenceableCallIds);
Santos Cordon6b7f9552015-05-27 17:21:45 -0700438 destination.writeBundle(mIntentExtras);
439 destination.writeBundle(mExtras);
Christine Hallstrom2830ce92016-11-30 16:06:42 -0800440 destination.writeInt(mSupportedAudioRoutes);
Hall Liu95d55872017-01-25 17:12:49 -0800441 destination.writeByte((byte) (mIsRttCallChanged ? 1 : 0));
442 destination.writeParcelable(mRttCall, 0);
Tyler Gunnc0bf6de2017-03-17 11:27:09 -0700443 destination.writeLong(mCreationTimeMillis);
Tyler Gunn7e45b722018-12-04 12:56:45 -0800444 destination.writeParcelable(mCallIdentification, 0);
Tyler Gunn9e76fd12018-12-17 09:56:11 -0800445 destination.writeInt(mCallDirection);
Sailesh Nepal60437932014-04-05 16:44:55 -0700446 }
Santos Cordonb6939982014-06-04 20:20:58 -0700447
448 @Override
449 public String toString() {
450 return String.format("[%s, parent:%s, children:%s]", mId, mParentCallId, mChildCallIds);
451 }
Sailesh Nepal60437932014-04-05 16:44:55 -0700452}