blob: aa50991b118cf6a92cf4606e1cf7871007810630 [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 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;
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 Gunn9e76fd19b2018-12-17 09:56:11 -080096 int callDirection) {
Sailesh Nepal60437932014-04-05 16:44:55 -070097 mId = id;
98 mState = state;
Andrew Lee7f3d41f2014-09-11 17:33:16 -070099 mDisconnectCause = disconnectCause;
Ihab Awadc0677542014-06-10 13:29:47 -0700100 mCannedSmsResponses = cannedSmsResponses;
Sailesh Nepal60437932014-04-05 16:44:55 -0700101 mCapabilities = capabilities;
Andrew Lee223ad142014-08-27 16:33:08 -0700102 mProperties = properties;
Christine Hallstrom2830ce92016-11-30 16:06:42 -0800103 mSupportedAudioRoutes = supportedAudioRoutes;
Sailesh Nepal60437932014-04-05 16:44:55 -0700104 mConnectTimeMillis = connectTimeMillis;
105 mHandle = handle;
Sailesh Nepal61203862014-07-11 14:50:13 -0700106 mHandlePresentation = handlePresentation;
107 mCallerDisplayName = callerDisplayName;
108 mCallerDisplayNamePresentation = callerDisplayNamePresentation;
Sailesh Nepal60437932014-04-05 16:44:55 -0700109 mGatewayInfo = gatewayInfo;
Evan Charlton8c8a0622014-07-20 12:31:00 -0700110 mAccountHandle = accountHandle;
Tyler Gunn75958422015-04-15 14:23:42 -0700111 mIsVideoCallProviderChanged = isVideoCallProviderChanged;
Andrew Lee50aca232014-07-22 16:41:54 -0700112 mVideoCallProvider = videoCallProvider;
Hall Liu95d55872017-01-25 17:12:49 -0800113 mIsRttCallChanged = isRttCallChanged;
114 mRttCall = rttCall;
Santos Cordon980acb92014-05-31 10:31:19 -0700115 mParentCallId = parentCallId;
116 mChildCallIds = childCallIds;
Sailesh Nepale7ef59a2014-07-08 21:48:22 -0700117 mStatusHints = statusHints;
Andrew Lee85f5d422014-07-11 17:22:03 -0700118 mVideoState = videoState;
Santos Cordon7c7bc7f2014-07-28 18:15:48 -0700119 mConferenceableCallIds = Collections.unmodifiableList(conferenceableCallIds);
Santos Cordon6b7f9552015-05-27 17:21:45 -0700120 mIntentExtras = intentExtras;
Nancy Chen10798dc2014-08-08 14:00:25 -0700121 mExtras = extras;
Tyler Gunnc0bf6de2017-03-17 11:27:09 -0700122 mCreationTimeMillis = creationTimeMillis;
Tyler Gunn9e76fd19b2018-12-17 09:56:11 -0800123 mCallDirection = callDirection;
Sailesh Nepal60437932014-04-05 16:44:55 -0700124 }
125
126 /** The unique ID of the call. */
Mathew Inwood8c854f82018-09-14 12:35:36 +0100127 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
Sailesh Nepal60437932014-04-05 16:44:55 -0700128 public String getId() {
129 return mId;
130 }
131
132 /** The current state of the call. */
Ihab Awadb19a0bc2014-08-07 19:46:01 -0700133 public int getState() {
Sailesh Nepal60437932014-04-05 16:44:55 -0700134 return mState;
135 }
136
137 /**
Andrew Lee7f3d41f2014-09-11 17:33:16 -0700138 * Reason for disconnection, as described by {@link android.telecomm.DisconnectCause}. Valid
139 * when call state is {@link CallState#DISCONNECTED}.
Sailesh Nepal60437932014-04-05 16:44:55 -0700140 */
Tyler Gunn7e45b722018-12-04 12:56:45 -0800141 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
Andrew Lee7f3d41f2014-09-11 17:33:16 -0700142 public DisconnectCause getDisconnectCause() {
143 return mDisconnectCause;
Sailesh Nepal60437932014-04-05 16:44:55 -0700144 }
145
Ihab Awadc0677542014-06-10 13:29:47 -0700146 /**
147 * The set of possible text message responses when this call is incoming.
148 */
149 public List<String> getCannedSmsResponses() {
150 return mCannedSmsResponses;
151 }
152
Sailesh Nepal60437932014-04-05 16:44:55 -0700153 // Bit mask of actions a call supports, values are defined in {@link CallCapabilities}.
154 public int getCapabilities() {
155 return mCapabilities;
156 }
157
Andrew Lee223ad142014-08-27 16:33:08 -0700158 /** Bitmask of properties of the call. */
159 public int getProperties() { return mProperties; }
160
Christine Hallstrom2830ce92016-11-30 16:06:42 -0800161 /** Bitmask of supported routes of the call */
162 public int getSupportedAudioRoutes() {
163 return mSupportedAudioRoutes;
164 }
165
Sailesh Nepal60437932014-04-05 16:44:55 -0700166 /** The time that the call switched to the active state. */
Tyler Gunn7e45b722018-12-04 12:56:45 -0800167 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
Sailesh Nepal60437932014-04-05 16:44:55 -0700168 public long getConnectTimeMillis() {
169 return mConnectTimeMillis;
170 }
171
172 /** The endpoint to which the call is connected. */
Tyler Gunn7e45b722018-12-04 12:56:45 -0800173 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
Sailesh Nepal60437932014-04-05 16:44:55 -0700174 public Uri getHandle() {
175 return mHandle;
176 }
177
Nancy Chen9d568c02014-09-08 14:17:59 -0700178 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700179 * The presentation requirements for the handle. See {@link TelecomManager} for valid values.
Nancy Chen9d568c02014-09-08 14:17:59 -0700180 */
Sailesh Nepal61203862014-07-11 14:50:13 -0700181 public int getHandlePresentation() {
182 return mHandlePresentation;
183 }
184
185 /** The endpoint to which the call is connected. */
186 public String getCallerDisplayName() {
187 return mCallerDisplayName;
188 }
189
Nancy Chen9d568c02014-09-08 14:17:59 -0700190 /**
191 * The presentation requirements for the caller display name.
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700192 * See {@link TelecomManager} for valid values.
Nancy Chen9d568c02014-09-08 14:17:59 -0700193 */
Sailesh Nepal61203862014-07-11 14:50:13 -0700194 public int getCallerDisplayNamePresentation() {
195 return mCallerDisplayNamePresentation;
196 }
197
Sailesh Nepal60437932014-04-05 16:44:55 -0700198 /** Gateway information for the call. */
199 public GatewayInfo getGatewayInfo() {
200 return mGatewayInfo;
201 }
202
Evan Charlton6eb262c2014-07-19 18:18:19 -0700203 /** PhoneAccountHandle information for the call. */
Evan Charlton8c8a0622014-07-20 12:31:00 -0700204 public PhoneAccountHandle getAccountHandle() {
205 return mAccountHandle;
Nancy Chen5ffbfcc2014-06-25 14:22:55 -0700206 }
207
Sailesh Nepal60437932014-04-05 16:44:55 -0700208 /**
Andrew Lee50aca232014-07-22 16:41:54 -0700209 * Returns an object for remotely communicating through the video call provider's binder.
Tyler Gunn159f35c2017-03-02 09:28:37 -0800210 *
211 * @param callingPackageName the package name of the calling InCallService.
212 * @param targetSdkVersion the target SDK version of the calling InCallService.
Andrew Lee50aca232014-07-22 16:41:54 -0700213 * @return The video call.
Andrew Lee5dc30752014-06-27 17:02:19 -0700214 */
Tyler Gunn159f35c2017-03-02 09:28:37 -0800215 public VideoCallImpl getVideoCallImpl(String callingPackageName, int targetSdkVersion) {
Andrew Lee50aca232014-07-22 16:41:54 -0700216 if (mVideoCall == null && mVideoCallProvider != null) {
Andrew Lee5dc30752014-06-27 17:02:19 -0700217 try {
Tyler Gunn159f35c2017-03-02 09:28:37 -0800218 mVideoCall = new VideoCallImpl(mVideoCallProvider, callingPackageName,
219 targetSdkVersion);
Andrew Lee5dc30752014-06-27 17:02:19 -0700220 } catch (RemoteException ignored) {
221 // Ignore RemoteException.
222 }
223 }
224
Andrew Lee50aca232014-07-22 16:41:54 -0700225 return mVideoCall;
Andrew Lee5dc30752014-06-27 17:02:19 -0700226 }
227
Hall Liu95d55872017-01-25 17:12:49 -0800228 public boolean getIsRttCallChanged() {
229 return mIsRttCallChanged;
230 }
231
232 /**
233 * RTT communication channel information
234 * @return The ParcelableRttCall
235 */
236 public ParcelableRttCall getParcelableRttCall() {
237 return mRttCall;
238 }
239
Andrew Lee5dc30752014-06-27 17:02:19 -0700240 /**
Santos Cordon980acb92014-05-31 10:31:19 -0700241 * The conference call to which this call is conferenced. Null if not conferenced.
Santos Cordon980acb92014-05-31 10:31:19 -0700242 */
243 public String getParentCallId() {
244 return mParentCallId;
245 }
246
247 /**
248 * The child call-IDs if this call is a conference call. Returns an empty list if this is not
249 * a conference call or if the conference call contains no children.
Santos Cordon980acb92014-05-31 10:31:19 -0700250 */
251 public List<String> getChildCallIds() {
252 return mChildCallIds;
253 }
254
Santos Cordon7c7bc7f2014-07-28 18:15:48 -0700255 public List<String> getConferenceableCallIds() {
256 return mConferenceableCallIds;
257 }
258
Tyler Gunn8d83fa92014-07-01 11:31:21 -0700259 /**
Sailesh Nepale7ef59a2014-07-08 21:48:22 -0700260 * The status label and icon.
261 *
262 * @return Status hints.
263 */
264 public StatusHints getStatusHints() {
265 return mStatusHints;
266 }
267
Andrew Lee85f5d422014-07-11 17:22:03 -0700268 /**
269 * The video state.
270 * @return The video state of the call.
271 */
272 public int getVideoState() {
273 return mVideoState;
274 }
275
Nancy Chen10798dc2014-08-08 14:00:25 -0700276 /**
Santos Cordon6b7f9552015-05-27 17:21:45 -0700277 * Any extras associated with this call.
Nancy Chen10798dc2014-08-08 14:00:25 -0700278 *
279 * @return a bundle of extras
280 */
281 public Bundle getExtras() {
282 return mExtras;
283 }
284
Rekha Kumar07366812015-03-24 16:42:31 -0700285 /**
Santos Cordon6b7f9552015-05-27 17:21:45 -0700286 * Extras passed in as part of the original call intent.
287 *
288 * @return The intent extras.
289 */
290 public Bundle getIntentExtras() {
291 return mIntentExtras;
292 }
293
294 /**
Tyler Gunn75958422015-04-15 14:23:42 -0700295 * Indicates to the receiver of the {@link ParcelableCall} whether a change has occurred in the
296 * {@link android.telecom.InCallService.VideoCall} associated with this call. Since
297 * {@link #getVideoCall()} creates a new {@link VideoCallImpl}, it is useful to know whether
298 * the provider has changed (which can influence whether it is accessed).
299 *
300 * @return {@code true} if the video call changed, {@code false} otherwise.
301 */
302 public boolean isVideoCallProviderChanged() {
303 return mIsVideoCallProviderChanged;
304 }
305
Tyler Gunnc0bf6de2017-03-17 11:27:09 -0700306 /**
307 * @return The time the call was created, in milliseconds since the epoch.
308 */
309 public long getCreationTimeMillis() {
310 return mCreationTimeMillis;
311 }
312
Tyler Gunn7e45b722018-12-04 12:56:45 -0800313 /**
Tyler Gunn9e76fd19b2018-12-17 09:56:11 -0800314 * Indicates whether the call is an incoming or outgoing call.
315 */
316 public @CallDirection int getCallDirection() {
317 return mCallDirection;
318 }
319
Santos Cordon88b771d2014-07-19 13:10:40 -0700320 /** Responsible for creating ParcelableCall objects for deserialized Parcels. */
Tyler Gunn7e45b722018-12-04 12:56:45 -0800321 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
Jeff Sharkey9e8f83d2019-02-28 12:06:45 -0700322 public static final @android.annotation.NonNull Parcelable.Creator<ParcelableCall> CREATOR =
Santos Cordon88b771d2014-07-19 13:10:40 -0700323 new Parcelable.Creator<ParcelableCall> () {
Sailesh Nepal60437932014-04-05 16:44:55 -0700324 @Override
Santos Cordon88b771d2014-07-19 13:10:40 -0700325 public ParcelableCall createFromParcel(Parcel source) {
326 ClassLoader classLoader = ParcelableCall.class.getClassLoader();
Sailesh Nepal60437932014-04-05 16:44:55 -0700327 String id = source.readString();
Ihab Awadb19a0bc2014-08-07 19:46:01 -0700328 int state = source.readInt();
Andrew Lee7f3d41f2014-09-11 17:33:16 -0700329 DisconnectCause disconnectCause = source.readParcelable(classLoader);
Ihab Awadc0677542014-06-10 13:29:47 -0700330 List<String> cannedSmsResponses = new ArrayList<>();
331 source.readList(cannedSmsResponses, classLoader);
Sailesh Nepal60437932014-04-05 16:44:55 -0700332 int capabilities = source.readInt();
Andrew Lee223ad142014-08-27 16:33:08 -0700333 int properties = source.readInt();
Sailesh Nepal60437932014-04-05 16:44:55 -0700334 long connectTimeMillis = source.readLong();
Sailesh Nepal60437932014-04-05 16:44:55 -0700335 Uri handle = source.readParcelable(classLoader);
Sailesh Nepal61203862014-07-11 14:50:13 -0700336 int handlePresentation = source.readInt();
337 String callerDisplayName = source.readString();
338 int callerDisplayNamePresentation = source.readInt();
Sailesh Nepal60437932014-04-05 16:44:55 -0700339 GatewayInfo gatewayInfo = source.readParcelable(classLoader);
Evan Charlton8c8a0622014-07-20 12:31:00 -0700340 PhoneAccountHandle accountHandle = source.readParcelable(classLoader);
Tyler Gunn75958422015-04-15 14:23:42 -0700341 boolean isVideoCallProviderChanged = source.readByte() == 1;
Ihab Awadb19a0bc2014-08-07 19:46:01 -0700342 IVideoProvider videoCallProvider =
343 IVideoProvider.Stub.asInterface(source.readStrongBinder());
Santos Cordon980acb92014-05-31 10:31:19 -0700344 String parentCallId = source.readString();
345 List<String> childCallIds = new ArrayList<>();
346 source.readList(childCallIds, classLoader);
Sailesh Nepale7ef59a2014-07-08 21:48:22 -0700347 StatusHints statusHints = source.readParcelable(classLoader);
Andrew Lee85f5d422014-07-11 17:22:03 -0700348 int videoState = source.readInt();
Santos Cordon7c7bc7f2014-07-28 18:15:48 -0700349 List<String> conferenceableCallIds = new ArrayList<>();
350 source.readList(conferenceableCallIds, classLoader);
Santos Cordon6b7f9552015-05-27 17:21:45 -0700351 Bundle intentExtras = source.readBundle(classLoader);
352 Bundle extras = source.readBundle(classLoader);
Christine Hallstrom2830ce92016-11-30 16:06:42 -0800353 int supportedAudioRoutes = source.readInt();
Hall Liu95d55872017-01-25 17:12:49 -0800354 boolean isRttCallChanged = source.readByte() == 1;
355 ParcelableRttCall rttCall = source.readParcelable(classLoader);
Tyler Gunnc0bf6de2017-03-17 11:27:09 -0700356 long creationTimeMillis = source.readLong();
Tyler Gunn9e76fd19b2018-12-17 09:56:11 -0800357 int callDirection = source.readInt();
Andrew Lee7f3d41f2014-09-11 17:33:16 -0700358 return new ParcelableCall(
359 id,
360 state,
361 disconnectCause,
362 cannedSmsResponses,
363 capabilities,
364 properties,
Christine Hallstrom2830ce92016-11-30 16:06:42 -0800365 supportedAudioRoutes,
Andrew Lee7f3d41f2014-09-11 17:33:16 -0700366 connectTimeMillis,
367 handle,
368 handlePresentation,
369 callerDisplayName,
370 callerDisplayNamePresentation,
371 gatewayInfo,
372 accountHandle,
Tyler Gunn75958422015-04-15 14:23:42 -0700373 isVideoCallProviderChanged,
Andrew Lee7f3d41f2014-09-11 17:33:16 -0700374 videoCallProvider,
Hall Liu95d55872017-01-25 17:12:49 -0800375 isRttCallChanged,
376 rttCall,
Andrew Lee7f3d41f2014-09-11 17:33:16 -0700377 parentCallId,
378 childCallIds,
379 statusHints,
380 videoState,
381 conferenceableCallIds,
Santos Cordon6b7f9552015-05-27 17:21:45 -0700382 intentExtras,
Tyler Gunnc0bf6de2017-03-17 11:27:09 -0700383 extras,
Tyler Gunn7e45b722018-12-04 12:56:45 -0800384 creationTimeMillis,
Tyler Gunn9e76fd19b2018-12-17 09:56:11 -0800385 callDirection);
Sailesh Nepal60437932014-04-05 16:44:55 -0700386 }
387
388 @Override
Santos Cordon88b771d2014-07-19 13:10:40 -0700389 public ParcelableCall[] newArray(int size) {
390 return new ParcelableCall[size];
Sailesh Nepal60437932014-04-05 16:44:55 -0700391 }
392 };
393
394 /** {@inheritDoc} */
395 @Override
396 public int describeContents() {
397 return 0;
398 }
399
Santos Cordon88b771d2014-07-19 13:10:40 -0700400 /** Writes ParcelableCall object into a Parcel. */
Sailesh Nepal60437932014-04-05 16:44:55 -0700401 @Override
402 public void writeToParcel(Parcel destination, int flags) {
403 destination.writeString(mId);
Ihab Awadb19a0bc2014-08-07 19:46:01 -0700404 destination.writeInt(mState);
Andrew Lee7f3d41f2014-09-11 17:33:16 -0700405 destination.writeParcelable(mDisconnectCause, 0);
Ihab Awadc0677542014-06-10 13:29:47 -0700406 destination.writeList(mCannedSmsResponses);
Sailesh Nepal60437932014-04-05 16:44:55 -0700407 destination.writeInt(mCapabilities);
Andrew Lee223ad142014-08-27 16:33:08 -0700408 destination.writeInt(mProperties);
Sailesh Nepal60437932014-04-05 16:44:55 -0700409 destination.writeLong(mConnectTimeMillis);
410 destination.writeParcelable(mHandle, 0);
Sailesh Nepal61203862014-07-11 14:50:13 -0700411 destination.writeInt(mHandlePresentation);
412 destination.writeString(mCallerDisplayName);
413 destination.writeInt(mCallerDisplayNamePresentation);
Sailesh Nepal60437932014-04-05 16:44:55 -0700414 destination.writeParcelable(mGatewayInfo, 0);
Evan Charlton8c8a0622014-07-20 12:31:00 -0700415 destination.writeParcelable(mAccountHandle, 0);
Tyler Gunn75958422015-04-15 14:23:42 -0700416 destination.writeByte((byte) (mIsVideoCallProviderChanged ? 1 : 0));
Tyler Gunn807de8a2014-06-30 14:22:57 -0700417 destination.writeStrongBinder(
Andrew Lee50aca232014-07-22 16:41:54 -0700418 mVideoCallProvider != null ? mVideoCallProvider.asBinder() : null);
Santos Cordon980acb92014-05-31 10:31:19 -0700419 destination.writeString(mParentCallId);
420 destination.writeList(mChildCallIds);
Sailesh Nepale7ef59a2014-07-08 21:48:22 -0700421 destination.writeParcelable(mStatusHints, 0);
Andrew Lee85f5d422014-07-11 17:22:03 -0700422 destination.writeInt(mVideoState);
Santos Cordon7c7bc7f2014-07-28 18:15:48 -0700423 destination.writeList(mConferenceableCallIds);
Santos Cordon6b7f9552015-05-27 17:21:45 -0700424 destination.writeBundle(mIntentExtras);
425 destination.writeBundle(mExtras);
Christine Hallstrom2830ce92016-11-30 16:06:42 -0800426 destination.writeInt(mSupportedAudioRoutes);
Hall Liu95d55872017-01-25 17:12:49 -0800427 destination.writeByte((byte) (mIsRttCallChanged ? 1 : 0));
428 destination.writeParcelable(mRttCall, 0);
Tyler Gunnc0bf6de2017-03-17 11:27:09 -0700429 destination.writeLong(mCreationTimeMillis);
Tyler Gunn9e76fd19b2018-12-17 09:56:11 -0800430 destination.writeInt(mCallDirection);
Sailesh Nepal60437932014-04-05 16:44:55 -0700431 }
Santos Cordonb6939982014-06-04 20:20:58 -0700432
433 @Override
434 public String toString() {
435 return String.format("[%s, parent:%s, children:%s]", mId, mParentCallId, mChildCallIds);
436 }
Sailesh Nepal60437932014-04-05 16:44:55 -0700437}