blob: 1172e1392ef82e9df1e5641f2137934fc4c6b50b [file] [log] [blame]
Ihab Awad542e0ea2014-05-16 10:22:16 -07001/*
2 * Copyright (C) 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;
Ihab Awad542e0ea2014-05-16 10:22:16 -070018
Hall Liub2306242019-11-15 17:13:05 -080019import android.annotation.NonNull;
20import android.annotation.Nullable;
Adrian Roos6a6aa5e2021-01-29 12:15:00 +010021import android.annotation.SuppressLint;
Hall Liub2306242019-11-15 17:13:05 -080022import android.annotation.SystemApi;
23import android.annotation.TestApi;
Ihab Awad542e0ea2014-05-16 10:22:16 -070024import android.net.Uri;
Sailesh Nepal61203862014-07-11 14:50:13 -070025import android.os.Bundle;
Ihab Awadfbb092f2014-06-03 18:40:45 -070026import android.os.Parcel;
Hall Liu95d55872017-01-25 17:12:49 -080027import android.os.ParcelFileDescriptor;
Ihab Awadfbb092f2014-06-03 18:40:45 -070028import android.os.Parcelable;
Ihab Awad542e0ea2014-05-16 10:22:16 -070029
Ravi Paluri80aa2142019-12-02 11:57:37 +053030import java.util.ArrayList;
31import java.util.List;
32
Ihab Awad542e0ea2014-05-16 10:22:16 -070033/**
34 * Simple data container encapsulating a request to some entity to
35 * create a new {@link Connection}.
36 */
Ihab Awadfbb092f2014-06-03 18:40:45 -070037public final class ConnectionRequest implements Parcelable {
Ihab Awad542e0ea2014-05-16 10:22:16 -070038
Hall Liu95d55872017-01-25 17:12:49 -080039 /**
40 * Builder class for {@link ConnectionRequest}
41 * @hide
42 */
Hall Liub2306242019-11-15 17:13:05 -080043 @TestApi // For convenience in CTS tests
Hall Liu95d55872017-01-25 17:12:49 -080044 public static final class Builder {
45 private PhoneAccountHandle mAccountHandle;
46 private Uri mAddress;
47 private Bundle mExtras;
48 private int mVideoState = VideoProfile.STATE_AUDIO_ONLY;
49 private String mTelecomCallId;
50 private boolean mShouldShowIncomingCallUi = false;
51 private ParcelFileDescriptor mRttPipeToInCall;
52 private ParcelFileDescriptor mRttPipeFromInCall;
Ravi Paluri80aa2142019-12-02 11:57:37 +053053 private List<Uri> mParticipants;
54 private boolean mIsAdhocConference = false;
Hall Liu95d55872017-01-25 17:12:49 -080055
56 public Builder() { }
57
58 /**
59 * Sets the phone account handle for the resulting {@link ConnectionRequest}
60 * @param accountHandle The accountHandle which should be used to place the call.
61 */
Hall Liub2306242019-11-15 17:13:05 -080062 public @NonNull Builder setAccountHandle(@NonNull PhoneAccountHandle accountHandle) {
Hall Liu95d55872017-01-25 17:12:49 -080063 this.mAccountHandle = accountHandle;
64 return this;
65 }
66
67 /**
Ravi Paluri80aa2142019-12-02 11:57:37 +053068 * Sets the participants for the resulting {@link ConnectionRequest}
69 * @param participants The participants to which the {@link Connection} is to connect.
70 */
Adrian Roos6a6aa5e2021-01-29 12:15:00 +010071 public @NonNull Builder setParticipants(
72 @SuppressLint("NullableCollection") @Nullable List<Uri> participants) {
Ravi Paluri80aa2142019-12-02 11:57:37 +053073 this.mParticipants = participants;
74 return this;
75 }
76
77 /**
Hall Liu95d55872017-01-25 17:12:49 -080078 * Sets the address for the resulting {@link ConnectionRequest}
79 * @param address The address(e.g., phone number) to which the {@link Connection} is to
80 * connect.
81 */
Hall Liub2306242019-11-15 17:13:05 -080082 public @NonNull Builder setAddress(@NonNull Uri address) {
Hall Liu95d55872017-01-25 17:12:49 -080083 this.mAddress = address;
84 return this;
85 }
86
87 /**
88 * Sets the extras bundle for the resulting {@link ConnectionRequest}
89 * @param extras Application-specific extra data.
90 */
Hall Liub2306242019-11-15 17:13:05 -080091 public @NonNull Builder setExtras(@NonNull Bundle extras) {
Hall Liu95d55872017-01-25 17:12:49 -080092 this.mExtras = extras;
93 return this;
94 }
95
96 /**
97 * Sets the video state for the resulting {@link ConnectionRequest}
98 * @param videoState Determines the video state for the connection.
99 */
Hall Liub2306242019-11-15 17:13:05 -0800100 public @NonNull Builder setVideoState(int videoState) {
Hall Liu95d55872017-01-25 17:12:49 -0800101 this.mVideoState = videoState;
102 return this;
103 }
104
105 /**
106 * Sets the Telecom call ID for the resulting {@link ConnectionRequest}
107 * @param telecomCallId The telecom call ID.
108 */
Hall Liub2306242019-11-15 17:13:05 -0800109 public @NonNull Builder setTelecomCallId(@NonNull String telecomCallId) {
Hall Liu95d55872017-01-25 17:12:49 -0800110 this.mTelecomCallId = telecomCallId;
111 return this;
112 }
113
114 /**
115 * Sets shouldShowIncomingUi for the resulting {@link ConnectionRequest}
116 * @param shouldShowIncomingCallUi For a self-managed {@link ConnectionService}, will be
117 * {@code true} if the {@link ConnectionService} should show
118 * its own incoming call UI for an incoming call. When
119 * {@code false}, Telecom shows the incoming call UI.
120 */
Hall Liub2306242019-11-15 17:13:05 -0800121 public @NonNull Builder setShouldShowIncomingCallUi(boolean shouldShowIncomingCallUi) {
Hall Liu95d55872017-01-25 17:12:49 -0800122 this.mShouldShowIncomingCallUi = shouldShowIncomingCallUi;
123 return this;
124 }
125
126 /**
Ravi Paluri80aa2142019-12-02 11:57:37 +0530127 * Sets isAdhocConference for the resulting {@link ConnectionRequest}
128 * @param isAdhocConference {@code true} if it is a adhoc conference call
129 * {@code false}, if not a adhoc conference call
130 */
131 public @NonNull Builder setIsAdhocConferenceCall(boolean isAdhocConference) {
132 this.mIsAdhocConference = isAdhocConference;
133 return this;
134 }
135
136 /**
Hall Liu95d55872017-01-25 17:12:49 -0800137 * Sets the RTT pipe for transferring text into the {@link ConnectionService} for the
138 * resulting {@link ConnectionRequest}
139 * @param rttPipeFromInCall The data pipe to read from.
140 */
Hall Liub2306242019-11-15 17:13:05 -0800141 public @NonNull Builder setRttPipeFromInCall(
142 @NonNull ParcelFileDescriptor rttPipeFromInCall) {
Hall Liu95d55872017-01-25 17:12:49 -0800143 this.mRttPipeFromInCall = rttPipeFromInCall;
144 return this;
145 }
146
147 /**
148 * Sets the RTT pipe for transferring text out of {@link ConnectionService} for the
149 * resulting {@link ConnectionRequest}
150 * @param rttPipeToInCall The data pipe to write to.
151 */
Hall Liub2306242019-11-15 17:13:05 -0800152 public @NonNull Builder setRttPipeToInCall(@NonNull ParcelFileDescriptor rttPipeToInCall) {
Hall Liu95d55872017-01-25 17:12:49 -0800153 this.mRttPipeToInCall = rttPipeToInCall;
154 return this;
155 }
156
Hall Liub2306242019-11-15 17:13:05 -0800157 /**
158 * Build the {@link ConnectionRequest}
159 * @return Result of the builder
160 */
161 public @NonNull ConnectionRequest build() {
Hall Liu95d55872017-01-25 17:12:49 -0800162 return new ConnectionRequest(
163 mAccountHandle,
164 mAddress,
165 mExtras,
166 mVideoState,
167 mTelecomCallId,
168 mShouldShowIncomingCallUi,
169 mRttPipeFromInCall,
Ravi Paluri80aa2142019-12-02 11:57:37 +0530170 mRttPipeToInCall,
171 mParticipants,
172 mIsAdhocConference);
Hall Liu95d55872017-01-25 17:12:49 -0800173 }
174 }
175
Evan Charlton8c8a0622014-07-20 12:31:00 -0700176 private final PhoneAccountHandle mAccountHandle;
Nancy Chenea38cca2014-09-05 16:38:49 -0700177 private final Uri mAddress;
Ihab Awad542e0ea2014-05-16 10:22:16 -0700178 private final Bundle mExtras;
Tyler Gunn12013ad2014-07-08 14:04:58 -0700179 private final int mVideoState;
Tyler Gunnf0500bd2015-09-01 10:59:48 -0700180 private final String mTelecomCallId;
Tyler Gunnf5035432017-01-09 09:43:12 -0800181 private final boolean mShouldShowIncomingCallUi;
Hall Liu95d55872017-01-25 17:12:49 -0800182 private final ParcelFileDescriptor mRttPipeToInCall;
183 private final ParcelFileDescriptor mRttPipeFromInCall;
Hall Liue9041242018-02-09 16:40:03 -0800184 // Cached return value of getRttTextStream -- we don't want to wrap it more than once.
185 private Connection.RttTextStream mRttTextStream;
Ravi Paluri80aa2142019-12-02 11:57:37 +0530186 private List<Uri> mParticipants;
187 private final boolean mIsAdhocConference;
Ihab Awad542e0ea2014-05-16 10:22:16 -0700188
Sailesh Nepal61203862014-07-11 14:50:13 -0700189 /**
Evan Charlton8c8a0622014-07-20 12:31:00 -0700190 * @param accountHandle The accountHandle which should be used to place the call.
Sailesh Nepal61203862014-07-11 14:50:13 -0700191 * @param handle The handle (e.g., phone number) to which the {@link Connection} is to connect.
Sailesh Nepal61203862014-07-11 14:50:13 -0700192 * @param extras Application-specific extra data.
Tyler Gunnbe74de02014-08-29 14:51:48 -0700193 */
194 public ConnectionRequest(
195 PhoneAccountHandle accountHandle,
196 Uri handle,
Tyler Gunnbe74de02014-08-29 14:51:48 -0700197 Bundle extras) {
Hall Liu95d55872017-01-25 17:12:49 -0800198 this(accountHandle, handle, extras, VideoProfile.STATE_AUDIO_ONLY, null, false, null, null);
Tyler Gunnbe74de02014-08-29 14:51:48 -0700199 }
200
201 /**
202 * @param accountHandle The accountHandle which should be used to place the call.
203 * @param handle The handle (e.g., phone number) to which the {@link Connection} is to connect.
Tyler Gunnbe74de02014-08-29 14:51:48 -0700204 * @param extras Application-specific extra data.
Sailesh Nepal61203862014-07-11 14:50:13 -0700205 * @param videoState Determines the video state for the connection.
206 */
207 public ConnectionRequest(
Evan Charlton8c8a0622014-07-20 12:31:00 -0700208 PhoneAccountHandle accountHandle,
Sailesh Nepal61203862014-07-11 14:50:13 -0700209 Uri handle,
Sailesh Nepal61203862014-07-11 14:50:13 -0700210 Bundle extras,
Tyler Gunn12013ad2014-07-08 14:04:58 -0700211 int videoState) {
Hall Liu95d55872017-01-25 17:12:49 -0800212 this(accountHandle, handle, extras, videoState, null, false, null, null);
Tyler Gunnf0500bd2015-09-01 10:59:48 -0700213 }
214
215 /**
216 * @param accountHandle The accountHandle which should be used to place the call.
217 * @param handle The handle (e.g., phone number) to which the {@link Connection} is to connect.
218 * @param extras Application-specific extra data.
219 * @param videoState Determines the video state for the connection.
220 * @param telecomCallId The telecom call ID.
Tyler Gunnf5035432017-01-09 09:43:12 -0800221 * @param shouldShowIncomingCallUi For a self-managed {@link ConnectionService}, will be
222 * {@code true} if the {@link ConnectionService} should show its
223 * own incoming call UI for an incoming call. When
224 * {@code false}, Telecom shows the incoming call UI.
Tyler Gunnf0500bd2015-09-01 10:59:48 -0700225 * @hide
226 */
227 public ConnectionRequest(
228 PhoneAccountHandle accountHandle,
229 Uri handle,
230 Bundle extras,
231 int videoState,
Tyler Gunnf5035432017-01-09 09:43:12 -0800232 String telecomCallId,
233 boolean shouldShowIncomingCallUi) {
Hall Liu95d55872017-01-25 17:12:49 -0800234 this(accountHandle, handle, extras, videoState, telecomCallId,
235 shouldShowIncomingCallUi, null, null);
236 }
237
238 private ConnectionRequest(
239 PhoneAccountHandle accountHandle,
240 Uri handle,
241 Bundle extras,
242 int videoState,
243 String telecomCallId,
244 boolean shouldShowIncomingCallUi,
245 ParcelFileDescriptor rttPipeFromInCall,
246 ParcelFileDescriptor rttPipeToInCall) {
Ravi Paluri80aa2142019-12-02 11:57:37 +0530247 this(accountHandle, handle, extras, videoState, telecomCallId,
248 shouldShowIncomingCallUi, rttPipeFromInCall, rttPipeToInCall, null, false);
249 }
250
251 private ConnectionRequest(
252 PhoneAccountHandle accountHandle,
253 Uri handle,
254 Bundle extras,
255 int videoState,
256 String telecomCallId,
257 boolean shouldShowIncomingCallUi,
258 ParcelFileDescriptor rttPipeFromInCall,
259 ParcelFileDescriptor rttPipeToInCall,
260 List<Uri> participants,
261 boolean isAdhocConference) {
Evan Charlton8c8a0622014-07-20 12:31:00 -0700262 mAccountHandle = accountHandle;
Nancy Chenea38cca2014-09-05 16:38:49 -0700263 mAddress = handle;
Ihab Awadfbb092f2014-06-03 18:40:45 -0700264 mExtras = extras;
Tyler Gunn12013ad2014-07-08 14:04:58 -0700265 mVideoState = videoState;
Tyler Gunnf0500bd2015-09-01 10:59:48 -0700266 mTelecomCallId = telecomCallId;
Tyler Gunnf5035432017-01-09 09:43:12 -0800267 mShouldShowIncomingCallUi = shouldShowIncomingCallUi;
Hall Liu95d55872017-01-25 17:12:49 -0800268 mRttPipeFromInCall = rttPipeFromInCall;
269 mRttPipeToInCall = rttPipeToInCall;
Ravi Paluri80aa2142019-12-02 11:57:37 +0530270 mParticipants = participants;
271 mIsAdhocConference = isAdhocConference;
Ihab Awadfbb092f2014-06-03 18:40:45 -0700272 }
273
Sailesh Nepalc5b01572014-07-14 16:29:44 -0700274 private ConnectionRequest(Parcel in) {
Bernardo Rufino1a5cb382022-01-14 17:35:36 +0000275 mAccountHandle = in.readParcelable(getClass().getClassLoader(), android.telecom.PhoneAccountHandle.class);
276 mAddress = in.readParcelable(getClass().getClassLoader(), android.net.Uri.class);
277 mExtras = in.readParcelable(getClass().getClassLoader(), android.os.Bundle.class);
Sailesh Nepalc5b01572014-07-14 16:29:44 -0700278 mVideoState = in.readInt();
Tyler Gunnf0500bd2015-09-01 10:59:48 -0700279 mTelecomCallId = in.readString();
Tyler Gunnf5035432017-01-09 09:43:12 -0800280 mShouldShowIncomingCallUi = in.readInt() == 1;
Bernardo Rufino1a5cb382022-01-14 17:35:36 +0000281 mRttPipeFromInCall = in.readParcelable(getClass().getClassLoader(), android.os.ParcelFileDescriptor.class);
282 mRttPipeToInCall = in.readParcelable(getClass().getClassLoader(), android.os.ParcelFileDescriptor.class);
Ravi Paluri80aa2142019-12-02 11:57:37 +0530283
284 mParticipants = new ArrayList<Uri>();
Bernardo Rufino1a5cb382022-01-14 17:35:36 +0000285 in.readList(mParticipants, getClass().getClassLoader(), android.net.Uri.class);
Ravi Paluri80aa2142019-12-02 11:57:37 +0530286
287 mIsAdhocConference = in.readInt() == 1;
Sailesh Nepalc5b01572014-07-14 16:29:44 -0700288 }
289
Ihab Awadfbb092f2014-06-03 18:40:45 -0700290 /**
Ihab Awad9c3f1882014-06-30 21:17:13 -0700291 * The account which should be used to place the call.
Santos Cordon52d8a152014-06-17 19:08:45 -0700292 */
Evan Charlton8c8a0622014-07-20 12:31:00 -0700293 public PhoneAccountHandle getAccountHandle() { return mAccountHandle; }
Santos Cordon52d8a152014-06-17 19:08:45 -0700294
295 /**
Ihab Awad542e0ea2014-05-16 10:22:16 -0700296 * The handle (e.g., phone number) to which the {@link Connection} is to connect.
297 */
Nancy Chenea38cca2014-09-05 16:38:49 -0700298 public Uri getAddress() { return mAddress; }
Sailesh Nepal61203862014-07-11 14:50:13 -0700299
300 /**
Ravi Paluri80aa2142019-12-02 11:57:37 +0530301 * The participants to which the {@link Connection} is to connect.
302 */
303 public @Nullable List<Uri> getParticipants() { return mParticipants; }
304
305 /**
Ihab Awad542e0ea2014-05-16 10:22:16 -0700306 * Application-specific extra data. Used for passing back information from an incoming
307 * call {@code Intent}, and for any proprietary extensions arranged between a client
308 * and servant {@code ConnectionService} which agree on a vocabulary for such data.
309 */
310 public Bundle getExtras() { return mExtras; }
311
Tyler Gunn12013ad2014-07-08 14:04:58 -0700312 /**
Ihab Awadb19a0bc2014-08-07 19:46:01 -0700313 * Describes the video states supported by the client requesting the connection.
Yorke Lee32f24732015-05-12 16:18:03 -0700314 * Valid values: {@link VideoProfile#STATE_AUDIO_ONLY},
315 * {@link VideoProfile#STATE_BIDIRECTIONAL},
316 * {@link VideoProfile#STATE_TX_ENABLED},
317 * {@link VideoProfile#STATE_RX_ENABLED}.
Tyler Gunn12013ad2014-07-08 14:04:58 -0700318 *
319 * @return The video state for the connection.
320 */
321 public int getVideoState() {
322 return mVideoState;
323 }
324
Tyler Gunnf0500bd2015-09-01 10:59:48 -0700325 /**
326 * Returns the internal Telecom ID associated with the connection request.
327 *
328 * @return The Telecom ID.
329 * @hide
330 */
Hall Liub2306242019-11-15 17:13:05 -0800331 @SystemApi
Hall Liub2306242019-11-15 17:13:05 -0800332 public @Nullable String getTelecomCallId() {
Tyler Gunnf0500bd2015-09-01 10:59:48 -0700333 return mTelecomCallId;
334 }
335
Tyler Gunnf5035432017-01-09 09:43:12 -0800336 /**
337 * For a self-managed {@link ConnectionService}, indicates for an incoming call whether the
338 * {@link ConnectionService} should show its own incoming call UI for an incoming call.
339 *
340 * @return {@code true} if the {@link ConnectionService} should show its own incoming call UI.
341 * When {@code false}, Telecom shows the incoming call UI for the call.
342 * @hide
343 */
344 public boolean shouldShowIncomingCallUi() {
345 return mShouldShowIncomingCallUi;
346 }
347
Hall Liu95d55872017-01-25 17:12:49 -0800348 /**
Ravi Paluri80aa2142019-12-02 11:57:37 +0530349 * @return {@code true} if the call is a adhoc conference call else @return {@code false}
350 */
351 public boolean isAdhocConferenceCall() {
352 return mIsAdhocConference;
353 }
354
355 /**
Hall Liu95d55872017-01-25 17:12:49 -0800356 * Gets the {@link ParcelFileDescriptor} that is used to send RTT text from the connection
357 * service to the in-call UI. In order to obtain an
358 * {@link java.io.InputStream} from this {@link ParcelFileDescriptor}, use
359 * {@link android.os.ParcelFileDescriptor.AutoCloseInputStream}.
360 * Only text data encoded using UTF-8 should be written into this {@link ParcelFileDescriptor}.
361 * @return The {@link ParcelFileDescriptor} that should be used for communication.
362 * Do not un-hide -- only for use by Telephony
363 * @hide
364 */
365 public ParcelFileDescriptor getRttPipeToInCall() {
366 return mRttPipeToInCall;
367 }
368
369 /**
370 * Gets the {@link ParcelFileDescriptor} that is used to send RTT text from the in-call UI to
371 * the connection service. In order to obtain an
372 * {@link java.io.OutputStream} from this {@link ParcelFileDescriptor}, use
373 * {@link android.os.ParcelFileDescriptor.AutoCloseOutputStream}.
374 * The contents of this {@link ParcelFileDescriptor} will consist solely of text encoded in
375 * UTF-8.
376 * @return The {@link ParcelFileDescriptor} that should be used for communication
377 * Do not un-hide -- only for use by Telephony
378 * @hide
379 */
380 public ParcelFileDescriptor getRttPipeFromInCall() {
381 return mRttPipeFromInCall;
382 }
383
384 /**
385 * Gets the {@link android.telecom.Connection.RttTextStream} object that should be used to
386 * send and receive RTT text to/from the in-call app.
387 * @return An instance of {@link android.telecom.Connection.RttTextStream}, or {@code null}
388 * if this connection request is not requesting an RTT session upon connection establishment.
Hall Liu95d55872017-01-25 17:12:49 -0800389 */
390 public Connection.RttTextStream getRttTextStream() {
391 if (isRequestingRtt()) {
Hall Liue9041242018-02-09 16:40:03 -0800392 if (mRttTextStream == null) {
393 mRttTextStream = new Connection.RttTextStream(mRttPipeToInCall, mRttPipeFromInCall);
394 }
395 return mRttTextStream;
Hall Liu95d55872017-01-25 17:12:49 -0800396 } else {
397 return null;
398 }
399 }
400
401 /**
402 * Convenience method for determining whether the ConnectionRequest is requesting an RTT session
403 * @return {@code true} if RTT is requested, {@code false} otherwise.
Hall Liu95d55872017-01-25 17:12:49 -0800404 */
405 public boolean isRequestingRtt() {
406 return mRttPipeFromInCall != null && mRttPipeToInCall != null;
407 }
408
Evan Charltonbf11f982014-07-20 22:06:28 -0700409 @Override
Ihab Awad542e0ea2014-05-16 10:22:16 -0700410 public String toString() {
Ravi Paluri80aa2142019-12-02 11:57:37 +0530411 return String.format("ConnectionRequest %s %s isAdhocConf: %s",
Nancy Chenea38cca2014-09-05 16:38:49 -0700412 mAddress == null
Ihab Awad542e0ea2014-05-16 10:22:16 -0700413 ? Uri.EMPTY
Nancy Chenea38cca2014-09-05 16:38:49 -0700414 : Connection.toLogSafePhoneNumber(mAddress.toString()),
Ravi Paluri80aa2142019-12-02 11:57:37 +0530415 bundleToString(mExtras),
416 isAdhocConferenceCall() ? "Y" : "N");
Shi Yuanjieafea7de2018-07-19 20:30:10 +0900417 }
418
419 private static String bundleToString(Bundle extras){
420 if (extras == null) {
421 return "";
422 }
423 StringBuilder sb = new StringBuilder();
424 sb.append("Bundle[");
425 for (String key : extras.keySet()) {
426 sb.append(key);
427 sb.append("=");
428 switch (key) {
429 case TelecomManager.EXTRA_INCOMING_CALL_ADDRESS:
430 case TelecomManager.EXTRA_UNKNOWN_CALL_HANDLE:
431 sb.append(Log.pii(extras.get(key)));
432 break;
433 default:
434 sb.append(extras.get(key));
435 break;
436 }
437 sb.append(", ");
438 }
439 sb.append("]");
440 return sb.toString();
Ihab Awad542e0ea2014-05-16 10:22:16 -0700441 }
Ihab Awadfbb092f2014-06-03 18:40:45 -0700442
Jeff Sharkey9e8f83d2019-02-28 12:06:45 -0700443 public static final @android.annotation.NonNull Creator<ConnectionRequest> CREATOR = new Creator<ConnectionRequest> () {
Sailesh Nepalc5b01572014-07-14 16:29:44 -0700444 @Override
445 public ConnectionRequest createFromParcel(Parcel source) {
446 return new ConnectionRequest(source);
447 }
Ihab Awadfbb092f2014-06-03 18:40:45 -0700448
Sailesh Nepalc5b01572014-07-14 16:29:44 -0700449 @Override
450 public ConnectionRequest[] newArray(int size) {
451 return new ConnectionRequest[size];
452 }
453 };
Ihab Awadfbb092f2014-06-03 18:40:45 -0700454
455 /**
456 * {@inheritDoc}
457 */
458 @Override
459 public int describeContents() {
460 return 0;
461 }
462
Ihab Awadfbb092f2014-06-03 18:40:45 -0700463 @Override
464 public void writeToParcel(Parcel destination, int flags) {
Evan Charlton8c8a0622014-07-20 12:31:00 -0700465 destination.writeParcelable(mAccountHandle, 0);
Nancy Chenea38cca2014-09-05 16:38:49 -0700466 destination.writeParcelable(mAddress, 0);
Ihab Awadfbb092f2014-06-03 18:40:45 -0700467 destination.writeParcelable(mExtras, 0);
Tyler Gunn12013ad2014-07-08 14:04:58 -0700468 destination.writeInt(mVideoState);
Tyler Gunnf0500bd2015-09-01 10:59:48 -0700469 destination.writeString(mTelecomCallId);
Tyler Gunnf5035432017-01-09 09:43:12 -0800470 destination.writeInt(mShouldShowIncomingCallUi ? 1 : 0);
Hall Liu95d55872017-01-25 17:12:49 -0800471 destination.writeParcelable(mRttPipeFromInCall, 0);
472 destination.writeParcelable(mRttPipeToInCall, 0);
Ravi Paluri80aa2142019-12-02 11:57:37 +0530473 destination.writeList(mParticipants);
474 destination.writeInt(mIsAdhocConference ? 1 : 0);
Tyler Gunn12013ad2014-07-08 14:04:58 -0700475 }
476}