Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 1 | /* |
| 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 Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 17 | package android.telecom; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 18 | |
Hall Liu | ef98bf8 | 2020-01-09 15:22:44 -0800 | [diff] [blame] | 19 | import android.annotation.Nullable; |
Artur Satayev | 53ada2a | 2019-12-10 17:47:56 +0000 | [diff] [blame] | 20 | import android.compat.annotation.UnsupportedAppUsage; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 21 | import android.net.Uri; |
Mathew Inwood | 8c854f8 | 2018-09-14 12:35:36 +0100 | [diff] [blame] | 22 | import android.os.Build; |
Nancy Chen | 10798dc | 2014-08-08 14:00:25 -0700 | [diff] [blame] | 23 | import android.os.Bundle; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 24 | import android.os.Parcel; |
| 25 | import android.os.Parcelable; |
Andrew Lee | 5dc3075 | 2014-06-27 17:02:19 -0700 | [diff] [blame] | 26 | import android.os.RemoteException; |
Tyler Gunn | 9e76fd19b | 2018-12-17 09:56:11 -0800 | [diff] [blame] | 27 | import android.telecom.Call.Details.CallDirection; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 28 | |
Artur Satayev | 53ada2a | 2019-12-10 17:47:56 +0000 | [diff] [blame] | 29 | import com.android.internal.telecom.IVideoProvider; |
| 30 | |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 31 | import java.util.ArrayList; |
Santos Cordon | 7c7bc7f | 2014-07-28 18:15:48 -0700 | [diff] [blame] | 32 | import java.util.Collections; |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 33 | import java.util.List; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 34 | |
| 35 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 36 | * Information about a call that is used between InCallService and Telecom. |
Santos Cordon | 88b771d | 2014-07-19 13:10:40 -0700 | [diff] [blame] | 37 | * @hide |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 38 | */ |
Santos Cordon | 88b771d | 2014-07-19 13:10:40 -0700 | [diff] [blame] | 39 | public final class ParcelableCall implements Parcelable { |
Hall Liu | ef98bf8 | 2020-01-09 15:22:44 -0800 | [diff] [blame] | 40 | |
| 41 | public static class ParcelableCallBuilder { |
| 42 | private String mId; |
| 43 | private int mState; |
| 44 | private DisconnectCause mDisconnectCause; |
| 45 | private List<String> mCannedSmsResponses; |
| 46 | private int mCapabilities; |
| 47 | private int mProperties; |
| 48 | private int mSupportedAudioRoutes; |
| 49 | private long mConnectTimeMillis; |
| 50 | private Uri mHandle; |
| 51 | private int mHandlePresentation; |
| 52 | private String mCallerDisplayName; |
| 53 | private int mCallerDisplayNamePresentation; |
| 54 | private GatewayInfo mGatewayInfo; |
| 55 | private PhoneAccountHandle mAccountHandle; |
| 56 | private boolean mIsVideoCallProviderChanged; |
| 57 | private IVideoProvider mVideoCallProvider; |
| 58 | private boolean mIsRttCallChanged; |
| 59 | private ParcelableRttCall mRttCall; |
| 60 | private String mParentCallId; |
| 61 | private List<String> mChildCallIds; |
| 62 | private StatusHints mStatusHints; |
| 63 | private int mVideoState; |
| 64 | private List<String> mConferenceableCallIds; |
| 65 | private Bundle mIntentExtras; |
| 66 | private Bundle mExtras; |
| 67 | private long mCreationTimeMillis; |
| 68 | private int mCallDirection; |
| 69 | private int mCallerNumberVerificationStatus; |
| 70 | private String mContactDisplayName; |
| 71 | private String mActiveChildCallId; |
Edgar Arriaga | e5bec82 | 2022-10-14 14:25:43 -0700 | [diff] [blame] | 72 | private Uri mContactPhotoUri; |
Hall Liu | ef98bf8 | 2020-01-09 15:22:44 -0800 | [diff] [blame] | 73 | |
| 74 | public ParcelableCallBuilder setId(String id) { |
| 75 | mId = id; |
| 76 | return this; |
| 77 | } |
| 78 | |
| 79 | public ParcelableCallBuilder setState(int state) { |
| 80 | mState = state; |
| 81 | return this; |
| 82 | } |
| 83 | |
| 84 | public ParcelableCallBuilder setDisconnectCause(DisconnectCause disconnectCause) { |
| 85 | mDisconnectCause = disconnectCause; |
| 86 | return this; |
| 87 | } |
| 88 | |
| 89 | public ParcelableCallBuilder setCannedSmsResponses(List<String> cannedSmsResponses) { |
| 90 | mCannedSmsResponses = cannedSmsResponses; |
| 91 | return this; |
| 92 | } |
| 93 | |
| 94 | public ParcelableCallBuilder setCapabilities(int capabilities) { |
| 95 | mCapabilities = capabilities; |
| 96 | return this; |
| 97 | } |
| 98 | |
| 99 | public ParcelableCallBuilder setProperties(int properties) { |
| 100 | mProperties = properties; |
| 101 | return this; |
| 102 | } |
| 103 | |
| 104 | public ParcelableCallBuilder setSupportedAudioRoutes(int supportedAudioRoutes) { |
| 105 | mSupportedAudioRoutes = supportedAudioRoutes; |
| 106 | return this; |
| 107 | } |
| 108 | |
| 109 | public ParcelableCallBuilder setConnectTimeMillis(long connectTimeMillis) { |
| 110 | mConnectTimeMillis = connectTimeMillis; |
| 111 | return this; |
| 112 | } |
| 113 | |
| 114 | public ParcelableCallBuilder setHandle(Uri handle) { |
| 115 | mHandle = handle; |
| 116 | return this; |
| 117 | } |
| 118 | |
| 119 | public ParcelableCallBuilder setHandlePresentation(int handlePresentation) { |
| 120 | mHandlePresentation = handlePresentation; |
| 121 | return this; |
| 122 | } |
| 123 | |
| 124 | public ParcelableCallBuilder setCallerDisplayName(String callerDisplayName) { |
| 125 | mCallerDisplayName = callerDisplayName; |
| 126 | return this; |
| 127 | } |
| 128 | |
| 129 | public ParcelableCallBuilder setCallerDisplayNamePresentation( |
| 130 | int callerDisplayNamePresentation) { |
| 131 | mCallerDisplayNamePresentation = callerDisplayNamePresentation; |
| 132 | return this; |
| 133 | } |
| 134 | |
| 135 | public ParcelableCallBuilder setGatewayInfo(GatewayInfo gatewayInfo) { |
| 136 | mGatewayInfo = gatewayInfo; |
| 137 | return this; |
| 138 | } |
| 139 | |
| 140 | public ParcelableCallBuilder setAccountHandle(PhoneAccountHandle accountHandle) { |
| 141 | mAccountHandle = accountHandle; |
| 142 | return this; |
| 143 | } |
| 144 | |
| 145 | public ParcelableCallBuilder setIsVideoCallProviderChanged( |
| 146 | boolean isVideoCallProviderChanged) { |
| 147 | mIsVideoCallProviderChanged = isVideoCallProviderChanged; |
| 148 | return this; |
| 149 | } |
| 150 | |
| 151 | public ParcelableCallBuilder setVideoCallProvider(IVideoProvider videoCallProvider) { |
| 152 | mVideoCallProvider = videoCallProvider; |
| 153 | return this; |
| 154 | } |
| 155 | |
| 156 | public ParcelableCallBuilder setIsRttCallChanged(boolean isRttCallChanged) { |
| 157 | mIsRttCallChanged = isRttCallChanged; |
| 158 | return this; |
| 159 | } |
| 160 | |
| 161 | public ParcelableCallBuilder setRttCall(ParcelableRttCall rttCall) { |
| 162 | mRttCall = rttCall; |
| 163 | return this; |
| 164 | } |
| 165 | |
| 166 | public ParcelableCallBuilder setParentCallId(String parentCallId) { |
| 167 | mParentCallId = parentCallId; |
| 168 | return this; |
| 169 | } |
| 170 | |
| 171 | public ParcelableCallBuilder setChildCallIds(List<String> childCallIds) { |
| 172 | mChildCallIds = childCallIds; |
| 173 | return this; |
| 174 | } |
| 175 | |
| 176 | public ParcelableCallBuilder setStatusHints(StatusHints statusHints) { |
| 177 | mStatusHints = statusHints; |
| 178 | return this; |
| 179 | } |
| 180 | |
| 181 | public ParcelableCallBuilder setVideoState(int videoState) { |
| 182 | mVideoState = videoState; |
| 183 | return this; |
| 184 | } |
| 185 | |
| 186 | public ParcelableCallBuilder setConferenceableCallIds( |
| 187 | List<String> conferenceableCallIds) { |
| 188 | mConferenceableCallIds = conferenceableCallIds; |
| 189 | return this; |
| 190 | } |
| 191 | |
| 192 | public ParcelableCallBuilder setIntentExtras(Bundle intentExtras) { |
| 193 | mIntentExtras = intentExtras; |
| 194 | return this; |
| 195 | } |
| 196 | |
| 197 | public ParcelableCallBuilder setExtras(Bundle extras) { |
| 198 | mExtras = extras; |
| 199 | return this; |
| 200 | } |
| 201 | |
| 202 | public ParcelableCallBuilder setCreationTimeMillis(long creationTimeMillis) { |
| 203 | mCreationTimeMillis = creationTimeMillis; |
| 204 | return this; |
| 205 | } |
| 206 | |
| 207 | public ParcelableCallBuilder setCallDirection(int callDirection) { |
| 208 | mCallDirection = callDirection; |
| 209 | return this; |
| 210 | } |
| 211 | |
| 212 | public ParcelableCallBuilder setCallerNumberVerificationStatus( |
| 213 | int callerNumberVerificationStatus) { |
| 214 | mCallerNumberVerificationStatus = callerNumberVerificationStatus; |
| 215 | return this; |
| 216 | } |
| 217 | |
| 218 | public ParcelableCallBuilder setContactDisplayName(String contactDisplayName) { |
| 219 | mContactDisplayName = contactDisplayName; |
| 220 | return this; |
| 221 | } |
| 222 | |
| 223 | public ParcelableCallBuilder setActiveChildCallId(String activeChildCallId) { |
| 224 | mActiveChildCallId = activeChildCallId; |
| 225 | return this; |
| 226 | } |
| 227 | |
Edgar Arriaga | e5bec82 | 2022-10-14 14:25:43 -0700 | [diff] [blame] | 228 | public ParcelableCallBuilder setContactPhotoUri(Uri contactPhotoUri) { |
| 229 | mContactPhotoUri = contactPhotoUri; |
| 230 | return this; |
| 231 | } |
| 232 | |
Hall Liu | ef98bf8 | 2020-01-09 15:22:44 -0800 | [diff] [blame] | 233 | public ParcelableCall createParcelableCall() { |
| 234 | return new ParcelableCall( |
| 235 | mId, |
| 236 | mState, |
| 237 | mDisconnectCause, |
| 238 | mCannedSmsResponses, |
| 239 | mCapabilities, |
| 240 | mProperties, |
| 241 | mSupportedAudioRoutes, |
| 242 | mConnectTimeMillis, |
| 243 | mHandle, |
| 244 | mHandlePresentation, |
| 245 | mCallerDisplayName, |
| 246 | mCallerDisplayNamePresentation, |
| 247 | mGatewayInfo, |
| 248 | mAccountHandle, |
| 249 | mIsVideoCallProviderChanged, |
| 250 | mVideoCallProvider, |
| 251 | mIsRttCallChanged, |
| 252 | mRttCall, |
| 253 | mParentCallId, |
| 254 | mChildCallIds, |
| 255 | mStatusHints, |
| 256 | mVideoState, |
| 257 | mConferenceableCallIds, |
| 258 | mIntentExtras, |
| 259 | mExtras, |
| 260 | mCreationTimeMillis, |
| 261 | mCallDirection, |
| 262 | mCallerNumberVerificationStatus, |
| 263 | mContactDisplayName, |
Edgar Arriaga | e5bec82 | 2022-10-14 14:25:43 -0700 | [diff] [blame] | 264 | mActiveChildCallId, |
| 265 | mContactPhotoUri); |
Hall Liu | ef98bf8 | 2020-01-09 15:22:44 -0800 | [diff] [blame] | 266 | } |
| 267 | |
| 268 | public static ParcelableCallBuilder fromParcelableCall(ParcelableCall parcelableCall) { |
| 269 | ParcelableCallBuilder newBuilder = new ParcelableCallBuilder(); |
| 270 | newBuilder.mId = parcelableCall.mId; |
| 271 | newBuilder.mState = parcelableCall.mState; |
| 272 | newBuilder.mDisconnectCause = parcelableCall.mDisconnectCause; |
| 273 | newBuilder.mCannedSmsResponses = parcelableCall.mCannedSmsResponses; |
| 274 | newBuilder.mCapabilities = parcelableCall.mCapabilities; |
| 275 | newBuilder.mProperties = parcelableCall.mProperties; |
| 276 | newBuilder.mSupportedAudioRoutes = parcelableCall.mSupportedAudioRoutes; |
| 277 | newBuilder.mConnectTimeMillis = parcelableCall.mConnectTimeMillis; |
| 278 | newBuilder.mHandle = parcelableCall.mHandle; |
| 279 | newBuilder.mHandlePresentation = parcelableCall.mHandlePresentation; |
| 280 | newBuilder.mCallerDisplayName = parcelableCall.mCallerDisplayName; |
| 281 | newBuilder.mCallerDisplayNamePresentation = |
| 282 | parcelableCall.mCallerDisplayNamePresentation; |
| 283 | newBuilder.mGatewayInfo = parcelableCall.mGatewayInfo; |
| 284 | newBuilder.mAccountHandle = parcelableCall.mAccountHandle; |
| 285 | newBuilder.mIsVideoCallProviderChanged = parcelableCall.mIsVideoCallProviderChanged; |
| 286 | newBuilder.mVideoCallProvider = parcelableCall.mVideoCallProvider; |
| 287 | newBuilder.mIsRttCallChanged = parcelableCall.mIsRttCallChanged; |
| 288 | newBuilder.mRttCall = parcelableCall.mRttCall; |
| 289 | newBuilder.mParentCallId = parcelableCall.mParentCallId; |
| 290 | newBuilder.mChildCallIds = parcelableCall.mChildCallIds; |
| 291 | newBuilder.mStatusHints = parcelableCall.mStatusHints; |
| 292 | newBuilder.mVideoState = parcelableCall.mVideoState; |
| 293 | newBuilder.mConferenceableCallIds = parcelableCall.mConferenceableCallIds; |
| 294 | newBuilder.mIntentExtras = parcelableCall.mIntentExtras; |
| 295 | newBuilder.mExtras = parcelableCall.mExtras; |
| 296 | newBuilder.mCreationTimeMillis = parcelableCall.mCreationTimeMillis; |
| 297 | newBuilder.mCallDirection = parcelableCall.mCallDirection; |
| 298 | newBuilder.mCallerNumberVerificationStatus = |
| 299 | parcelableCall.mCallerNumberVerificationStatus; |
| 300 | newBuilder.mContactDisplayName = parcelableCall.mContactDisplayName; |
| 301 | newBuilder.mActiveChildCallId = parcelableCall.mActiveChildCallId; |
Edgar Arriaga | e5bec82 | 2022-10-14 14:25:43 -0700 | [diff] [blame] | 302 | newBuilder.mContactPhotoUri = parcelableCall.mContactPhotoUri; |
Hall Liu | ef98bf8 | 2020-01-09 15:22:44 -0800 | [diff] [blame] | 303 | return newBuilder; |
| 304 | } |
| 305 | } |
| 306 | |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 307 | private final String mId; |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 308 | private final int mState; |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 309 | private final DisconnectCause mDisconnectCause; |
Ihab Awad | c067754 | 2014-06-10 13:29:47 -0700 | [diff] [blame] | 310 | private final List<String> mCannedSmsResponses; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 311 | private final int mCapabilities; |
Andrew Lee | 223ad14 | 2014-08-27 16:33:08 -0700 | [diff] [blame] | 312 | private final int mProperties; |
Christine Hallstrom | 2830ce9 | 2016-11-30 16:06:42 -0800 | [diff] [blame] | 313 | private final int mSupportedAudioRoutes; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 314 | private final long mConnectTimeMillis; |
| 315 | private final Uri mHandle; |
Sailesh Nepal | 6120386 | 2014-07-11 14:50:13 -0700 | [diff] [blame] | 316 | private final int mHandlePresentation; |
| 317 | private final String mCallerDisplayName; |
| 318 | private final int mCallerDisplayNamePresentation; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 319 | private final GatewayInfo mGatewayInfo; |
Evan Charlton | 8c8a062 | 2014-07-20 12:31:00 -0700 | [diff] [blame] | 320 | private final PhoneAccountHandle mAccountHandle; |
Tyler Gunn | 7595842 | 2015-04-15 14:23:42 -0700 | [diff] [blame] | 321 | private final boolean mIsVideoCallProviderChanged; |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 322 | private final IVideoProvider mVideoCallProvider; |
Tyler Gunn | 584ba6c | 2015-12-08 10:53:41 -0800 | [diff] [blame] | 323 | private VideoCallImpl mVideoCall; |
Hall Liu | 95d5587 | 2017-01-25 17:12:49 -0800 | [diff] [blame] | 324 | private final boolean mIsRttCallChanged; |
| 325 | private final ParcelableRttCall mRttCall; |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 326 | private final String mParentCallId; |
| 327 | private final List<String> mChildCallIds; |
Sailesh Nepal | e7ef59a | 2014-07-08 21:48:22 -0700 | [diff] [blame] | 328 | private final StatusHints mStatusHints; |
Andrew Lee | 85f5d42 | 2014-07-11 17:22:03 -0700 | [diff] [blame] | 329 | private final int mVideoState; |
Santos Cordon | 7c7bc7f | 2014-07-28 18:15:48 -0700 | [diff] [blame] | 330 | private final List<String> mConferenceableCallIds; |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 331 | private final Bundle mIntentExtras; |
Nancy Chen | 10798dc | 2014-08-08 14:00:25 -0700 | [diff] [blame] | 332 | private final Bundle mExtras; |
Tyler Gunn | c0bf6de | 2017-03-17 11:27:09 -0700 | [diff] [blame] | 333 | private final long mCreationTimeMillis; |
Tyler Gunn | 9e76fd19b | 2018-12-17 09:56:11 -0800 | [diff] [blame] | 334 | private final int mCallDirection; |
Tyler Gunn | d57d76c | 2019-09-24 14:53:23 -0700 | [diff] [blame] | 335 | private final int mCallerNumberVerificationStatus; |
Hall Liu | ef98bf8 | 2020-01-09 15:22:44 -0800 | [diff] [blame] | 336 | private final String mContactDisplayName; |
| 337 | private final String mActiveChildCallId; // Only valid for CDMA conferences |
Edgar Arriaga | e5bec82 | 2022-10-14 14:25:43 -0700 | [diff] [blame] | 338 | private final Uri mContactPhotoUri; |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 339 | |
Santos Cordon | 88b771d | 2014-07-19 13:10:40 -0700 | [diff] [blame] | 340 | public ParcelableCall( |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 341 | String id, |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 342 | int state, |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 343 | DisconnectCause disconnectCause, |
Ihab Awad | c067754 | 2014-06-10 13:29:47 -0700 | [diff] [blame] | 344 | List<String> cannedSmsResponses, |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 345 | int capabilities, |
Andrew Lee | 223ad14 | 2014-08-27 16:33:08 -0700 | [diff] [blame] | 346 | int properties, |
Christine Hallstrom | 2830ce9 | 2016-11-30 16:06:42 -0800 | [diff] [blame] | 347 | int supportedAudioRoutes, |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 348 | long connectTimeMillis, |
| 349 | Uri handle, |
Sailesh Nepal | 6120386 | 2014-07-11 14:50:13 -0700 | [diff] [blame] | 350 | int handlePresentation, |
| 351 | String callerDisplayName, |
| 352 | int callerDisplayNamePresentation, |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 353 | GatewayInfo gatewayInfo, |
Evan Charlton | 8c8a062 | 2014-07-20 12:31:00 -0700 | [diff] [blame] | 354 | PhoneAccountHandle accountHandle, |
Tyler Gunn | 7595842 | 2015-04-15 14:23:42 -0700 | [diff] [blame] | 355 | boolean isVideoCallProviderChanged, |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 356 | IVideoProvider videoCallProvider, |
Hall Liu | 95d5587 | 2017-01-25 17:12:49 -0800 | [diff] [blame] | 357 | boolean isRttCallChanged, |
| 358 | ParcelableRttCall rttCall, |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 359 | String parentCallId, |
Tyler Gunn | 8d83fa9 | 2014-07-01 11:31:21 -0700 | [diff] [blame] | 360 | List<String> childCallIds, |
Andrew Lee | 85f5d42 | 2014-07-11 17:22:03 -0700 | [diff] [blame] | 361 | StatusHints statusHints, |
Santos Cordon | 7c7bc7f | 2014-07-28 18:15:48 -0700 | [diff] [blame] | 362 | int videoState, |
Nancy Chen | 10798dc | 2014-08-08 14:00:25 -0700 | [diff] [blame] | 363 | List<String> conferenceableCallIds, |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 364 | Bundle intentExtras, |
Tyler Gunn | c0bf6de | 2017-03-17 11:27:09 -0700 | [diff] [blame] | 365 | Bundle extras, |
Tyler Gunn | 7e45b72 | 2018-12-04 12:56:45 -0800 | [diff] [blame] | 366 | long creationTimeMillis, |
Tyler Gunn | d57d76c | 2019-09-24 14:53:23 -0700 | [diff] [blame] | 367 | int callDirection, |
Hall Liu | ef98bf8 | 2020-01-09 15:22:44 -0800 | [diff] [blame] | 368 | int callerNumberVerificationStatus, |
| 369 | String contactDisplayName, |
Edgar Arriaga | e5bec82 | 2022-10-14 14:25:43 -0700 | [diff] [blame] | 370 | String activeChildCallId, |
| 371 | Uri contactPhotoUri |
Hall Liu | ef98bf8 | 2020-01-09 15:22:44 -0800 | [diff] [blame] | 372 | ) { |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 373 | mId = id; |
| 374 | mState = state; |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 375 | mDisconnectCause = disconnectCause; |
Ihab Awad | c067754 | 2014-06-10 13:29:47 -0700 | [diff] [blame] | 376 | mCannedSmsResponses = cannedSmsResponses; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 377 | mCapabilities = capabilities; |
Andrew Lee | 223ad14 | 2014-08-27 16:33:08 -0700 | [diff] [blame] | 378 | mProperties = properties; |
Christine Hallstrom | 2830ce9 | 2016-11-30 16:06:42 -0800 | [diff] [blame] | 379 | mSupportedAudioRoutes = supportedAudioRoutes; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 380 | mConnectTimeMillis = connectTimeMillis; |
| 381 | mHandle = handle; |
Sailesh Nepal | 6120386 | 2014-07-11 14:50:13 -0700 | [diff] [blame] | 382 | mHandlePresentation = handlePresentation; |
| 383 | mCallerDisplayName = callerDisplayName; |
| 384 | mCallerDisplayNamePresentation = callerDisplayNamePresentation; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 385 | mGatewayInfo = gatewayInfo; |
Evan Charlton | 8c8a062 | 2014-07-20 12:31:00 -0700 | [diff] [blame] | 386 | mAccountHandle = accountHandle; |
Tyler Gunn | 7595842 | 2015-04-15 14:23:42 -0700 | [diff] [blame] | 387 | mIsVideoCallProviderChanged = isVideoCallProviderChanged; |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 388 | mVideoCallProvider = videoCallProvider; |
Hall Liu | 95d5587 | 2017-01-25 17:12:49 -0800 | [diff] [blame] | 389 | mIsRttCallChanged = isRttCallChanged; |
| 390 | mRttCall = rttCall; |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 391 | mParentCallId = parentCallId; |
| 392 | mChildCallIds = childCallIds; |
Sailesh Nepal | e7ef59a | 2014-07-08 21:48:22 -0700 | [diff] [blame] | 393 | mStatusHints = statusHints; |
Andrew Lee | 85f5d42 | 2014-07-11 17:22:03 -0700 | [diff] [blame] | 394 | mVideoState = videoState; |
Santos Cordon | 7c7bc7f | 2014-07-28 18:15:48 -0700 | [diff] [blame] | 395 | mConferenceableCallIds = Collections.unmodifiableList(conferenceableCallIds); |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 396 | mIntentExtras = intentExtras; |
Nancy Chen | 10798dc | 2014-08-08 14:00:25 -0700 | [diff] [blame] | 397 | mExtras = extras; |
Tyler Gunn | c0bf6de | 2017-03-17 11:27:09 -0700 | [diff] [blame] | 398 | mCreationTimeMillis = creationTimeMillis; |
Tyler Gunn | 9e76fd19b | 2018-12-17 09:56:11 -0800 | [diff] [blame] | 399 | mCallDirection = callDirection; |
Tyler Gunn | d57d76c | 2019-09-24 14:53:23 -0700 | [diff] [blame] | 400 | mCallerNumberVerificationStatus = callerNumberVerificationStatus; |
Hall Liu | ef98bf8 | 2020-01-09 15:22:44 -0800 | [diff] [blame] | 401 | mContactDisplayName = contactDisplayName; |
| 402 | mActiveChildCallId = activeChildCallId; |
Edgar Arriaga | e5bec82 | 2022-10-14 14:25:43 -0700 | [diff] [blame] | 403 | mContactPhotoUri = contactPhotoUri; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 404 | } |
| 405 | |
| 406 | /** The unique ID of the call. */ |
Mathew Inwood | 8c854f8 | 2018-09-14 12:35:36 +0100 | [diff] [blame] | 407 | @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 408 | public String getId() { |
| 409 | return mId; |
| 410 | } |
| 411 | |
| 412 | /** The current state of the call. */ |
Tyler Gunn | 1e406ca | 2021-03-18 16:47:14 -0700 | [diff] [blame] | 413 | public @Call.CallState int getState() { |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 414 | return mState; |
| 415 | } |
| 416 | |
| 417 | /** |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 418 | * Reason for disconnection, as described by {@link android.telecomm.DisconnectCause}. Valid |
| 419 | * when call state is {@link CallState#DISCONNECTED}. |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 420 | */ |
Tyler Gunn | 7e45b72 | 2018-12-04 12:56:45 -0800 | [diff] [blame] | 421 | @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 422 | public DisconnectCause getDisconnectCause() { |
| 423 | return mDisconnectCause; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 424 | } |
| 425 | |
Ihab Awad | c067754 | 2014-06-10 13:29:47 -0700 | [diff] [blame] | 426 | /** |
| 427 | * The set of possible text message responses when this call is incoming. |
| 428 | */ |
| 429 | public List<String> getCannedSmsResponses() { |
| 430 | return mCannedSmsResponses; |
| 431 | } |
| 432 | |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 433 | // Bit mask of actions a call supports, values are defined in {@link CallCapabilities}. |
| 434 | public int getCapabilities() { |
| 435 | return mCapabilities; |
| 436 | } |
| 437 | |
Andrew Lee | 223ad14 | 2014-08-27 16:33:08 -0700 | [diff] [blame] | 438 | /** Bitmask of properties of the call. */ |
| 439 | public int getProperties() { return mProperties; } |
| 440 | |
Christine Hallstrom | 2830ce9 | 2016-11-30 16:06:42 -0800 | [diff] [blame] | 441 | /** Bitmask of supported routes of the call */ |
| 442 | public int getSupportedAudioRoutes() { |
| 443 | return mSupportedAudioRoutes; |
| 444 | } |
| 445 | |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 446 | /** The time that the call switched to the active state. */ |
Tyler Gunn | 7e45b72 | 2018-12-04 12:56:45 -0800 | [diff] [blame] | 447 | @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 448 | public long getConnectTimeMillis() { |
| 449 | return mConnectTimeMillis; |
| 450 | } |
| 451 | |
| 452 | /** The endpoint to which the call is connected. */ |
Tyler Gunn | 7e45b72 | 2018-12-04 12:56:45 -0800 | [diff] [blame] | 453 | @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 454 | public Uri getHandle() { |
| 455 | return mHandle; |
| 456 | } |
| 457 | |
Nancy Chen | 9d568c0 | 2014-09-08 14:17:59 -0700 | [diff] [blame] | 458 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 459 | * The presentation requirements for the handle. See {@link TelecomManager} for valid values. |
Nancy Chen | 9d568c0 | 2014-09-08 14:17:59 -0700 | [diff] [blame] | 460 | */ |
Sailesh Nepal | 6120386 | 2014-07-11 14:50:13 -0700 | [diff] [blame] | 461 | public int getHandlePresentation() { |
| 462 | return mHandlePresentation; |
| 463 | } |
| 464 | |
| 465 | /** The endpoint to which the call is connected. */ |
| 466 | public String getCallerDisplayName() { |
| 467 | return mCallerDisplayName; |
| 468 | } |
| 469 | |
Nancy Chen | 9d568c0 | 2014-09-08 14:17:59 -0700 | [diff] [blame] | 470 | /** |
| 471 | * The presentation requirements for the caller display name. |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 472 | * See {@link TelecomManager} for valid values. |
Nancy Chen | 9d568c0 | 2014-09-08 14:17:59 -0700 | [diff] [blame] | 473 | */ |
Sailesh Nepal | 6120386 | 2014-07-11 14:50:13 -0700 | [diff] [blame] | 474 | public int getCallerDisplayNamePresentation() { |
| 475 | return mCallerDisplayNamePresentation; |
| 476 | } |
| 477 | |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 478 | /** Gateway information for the call. */ |
| 479 | public GatewayInfo getGatewayInfo() { |
| 480 | return mGatewayInfo; |
| 481 | } |
| 482 | |
Evan Charlton | 6eb262c | 2014-07-19 18:18:19 -0700 | [diff] [blame] | 483 | /** PhoneAccountHandle information for the call. */ |
Evan Charlton | 8c8a062 | 2014-07-20 12:31:00 -0700 | [diff] [blame] | 484 | public PhoneAccountHandle getAccountHandle() { |
| 485 | return mAccountHandle; |
Nancy Chen | 5ffbfcc | 2014-06-25 14:22:55 -0700 | [diff] [blame] | 486 | } |
| 487 | |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 488 | /** |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 489 | * Returns an object for remotely communicating through the video call provider's binder. |
Tyler Gunn | 159f35c | 2017-03-02 09:28:37 -0800 | [diff] [blame] | 490 | * |
| 491 | * @param callingPackageName the package name of the calling InCallService. |
| 492 | * @param targetSdkVersion the target SDK version of the calling InCallService. |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 493 | * @return The video call. |
Andrew Lee | 5dc3075 | 2014-06-27 17:02:19 -0700 | [diff] [blame] | 494 | */ |
Tyler Gunn | 159f35c | 2017-03-02 09:28:37 -0800 | [diff] [blame] | 495 | public VideoCallImpl getVideoCallImpl(String callingPackageName, int targetSdkVersion) { |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 496 | if (mVideoCall == null && mVideoCallProvider != null) { |
Andrew Lee | 5dc3075 | 2014-06-27 17:02:19 -0700 | [diff] [blame] | 497 | try { |
Tyler Gunn | 159f35c | 2017-03-02 09:28:37 -0800 | [diff] [blame] | 498 | mVideoCall = new VideoCallImpl(mVideoCallProvider, callingPackageName, |
| 499 | targetSdkVersion); |
Andrew Lee | 5dc3075 | 2014-06-27 17:02:19 -0700 | [diff] [blame] | 500 | } catch (RemoteException ignored) { |
| 501 | // Ignore RemoteException. |
| 502 | } |
| 503 | } |
| 504 | |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 505 | return mVideoCall; |
Andrew Lee | 5dc3075 | 2014-06-27 17:02:19 -0700 | [diff] [blame] | 506 | } |
| 507 | |
Tyler Gunn | d1fdf3a | 2019-11-05 15:47:58 -0800 | [diff] [blame] | 508 | public IVideoProvider getVideoProvider() { |
| 509 | return mVideoCallProvider; |
| 510 | } |
| 511 | |
Hall Liu | 95d5587 | 2017-01-25 17:12:49 -0800 | [diff] [blame] | 512 | public boolean getIsRttCallChanged() { |
| 513 | return mIsRttCallChanged; |
| 514 | } |
| 515 | |
| 516 | /** |
| 517 | * RTT communication channel information |
| 518 | * @return The ParcelableRttCall |
| 519 | */ |
| 520 | public ParcelableRttCall getParcelableRttCall() { |
| 521 | return mRttCall; |
| 522 | } |
| 523 | |
Andrew Lee | 5dc3075 | 2014-06-27 17:02:19 -0700 | [diff] [blame] | 524 | /** |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 525 | * The conference call to which this call is conferenced. Null if not conferenced. |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 526 | */ |
| 527 | public String getParentCallId() { |
| 528 | return mParentCallId; |
| 529 | } |
| 530 | |
| 531 | /** |
| 532 | * The child call-IDs if this call is a conference call. Returns an empty list if this is not |
| 533 | * a conference call or if the conference call contains no children. |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 534 | */ |
| 535 | public List<String> getChildCallIds() { |
| 536 | return mChildCallIds; |
| 537 | } |
| 538 | |
Santos Cordon | 7c7bc7f | 2014-07-28 18:15:48 -0700 | [diff] [blame] | 539 | public List<String> getConferenceableCallIds() { |
| 540 | return mConferenceableCallIds; |
| 541 | } |
| 542 | |
Tyler Gunn | 8d83fa9 | 2014-07-01 11:31:21 -0700 | [diff] [blame] | 543 | /** |
Sailesh Nepal | e7ef59a | 2014-07-08 21:48:22 -0700 | [diff] [blame] | 544 | * The status label and icon. |
| 545 | * |
| 546 | * @return Status hints. |
| 547 | */ |
| 548 | public StatusHints getStatusHints() { |
| 549 | return mStatusHints; |
| 550 | } |
| 551 | |
Andrew Lee | 85f5d42 | 2014-07-11 17:22:03 -0700 | [diff] [blame] | 552 | /** |
| 553 | * The video state. |
| 554 | * @return The video state of the call. |
| 555 | */ |
| 556 | public int getVideoState() { |
| 557 | return mVideoState; |
| 558 | } |
| 559 | |
Nancy Chen | 10798dc | 2014-08-08 14:00:25 -0700 | [diff] [blame] | 560 | /** |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 561 | * Any extras associated with this call. |
Nancy Chen | 10798dc | 2014-08-08 14:00:25 -0700 | [diff] [blame] | 562 | * |
| 563 | * @return a bundle of extras |
| 564 | */ |
| 565 | public Bundle getExtras() { |
| 566 | return mExtras; |
| 567 | } |
| 568 | |
Rekha Kumar | 0736681 | 2015-03-24 16:42:31 -0700 | [diff] [blame] | 569 | /** |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 570 | * Extras passed in as part of the original call intent. |
| 571 | * |
| 572 | * @return The intent extras. |
| 573 | */ |
| 574 | public Bundle getIntentExtras() { |
| 575 | return mIntentExtras; |
| 576 | } |
| 577 | |
| 578 | /** |
Tyler Gunn | 7595842 | 2015-04-15 14:23:42 -0700 | [diff] [blame] | 579 | * Indicates to the receiver of the {@link ParcelableCall} whether a change has occurred in the |
| 580 | * {@link android.telecom.InCallService.VideoCall} associated with this call. Since |
| 581 | * {@link #getVideoCall()} creates a new {@link VideoCallImpl}, it is useful to know whether |
| 582 | * the provider has changed (which can influence whether it is accessed). |
| 583 | * |
| 584 | * @return {@code true} if the video call changed, {@code false} otherwise. |
| 585 | */ |
| 586 | public boolean isVideoCallProviderChanged() { |
| 587 | return mIsVideoCallProviderChanged; |
| 588 | } |
| 589 | |
Tyler Gunn | c0bf6de | 2017-03-17 11:27:09 -0700 | [diff] [blame] | 590 | /** |
| 591 | * @return The time the call was created, in milliseconds since the epoch. |
| 592 | */ |
| 593 | public long getCreationTimeMillis() { |
| 594 | return mCreationTimeMillis; |
| 595 | } |
| 596 | |
Tyler Gunn | 7e45b72 | 2018-12-04 12:56:45 -0800 | [diff] [blame] | 597 | /** |
Tyler Gunn | 9e76fd19b | 2018-12-17 09:56:11 -0800 | [diff] [blame] | 598 | * Indicates whether the call is an incoming or outgoing call. |
| 599 | */ |
| 600 | public @CallDirection int getCallDirection() { |
| 601 | return mCallDirection; |
| 602 | } |
| 603 | |
Tyler Gunn | d57d76c | 2019-09-24 14:53:23 -0700 | [diff] [blame] | 604 | /** |
| 605 | * Gets the verification status for the phone number of an incoming call as identified in |
| 606 | * ATIS-1000082. |
| 607 | * @return the verification status. |
| 608 | */ |
| 609 | public @Connection.VerificationStatus int getCallerNumberVerificationStatus() { |
| 610 | return mCallerNumberVerificationStatus; |
| 611 | } |
| 612 | |
Hall Liu | ef98bf8 | 2020-01-09 15:22:44 -0800 | [diff] [blame] | 613 | /** |
| 614 | * @return the name of the remote party as derived from a contacts DB lookup. |
| 615 | */ |
| 616 | public @Nullable String getContactDisplayName() { |
| 617 | return mContactDisplayName; |
| 618 | } |
| 619 | |
| 620 | /** |
Edgar Arriaga | e5bec82 | 2022-10-14 14:25:43 -0700 | [diff] [blame] | 621 | * @return the caller photo URI. |
| 622 | */ |
| 623 | public @Nullable Uri getContactPhotoUri() { |
| 624 | return mContactPhotoUri; |
| 625 | } |
| 626 | |
| 627 | |
| 628 | /** |
Hall Liu | ef98bf8 | 2020-01-09 15:22:44 -0800 | [diff] [blame] | 629 | * @return On a CDMA conference with two participants, returns the ID of the child call that's |
| 630 | * currently active. |
| 631 | */ |
| 632 | public @Nullable String getActiveChildCallId() { |
| 633 | return mActiveChildCallId; |
| 634 | } |
| 635 | |
Santos Cordon | 88b771d | 2014-07-19 13:10:40 -0700 | [diff] [blame] | 636 | /** Responsible for creating ParcelableCall objects for deserialized Parcels. */ |
Tyler Gunn | 7e45b72 | 2018-12-04 12:56:45 -0800 | [diff] [blame] | 637 | @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) |
Jeff Sharkey | 9e8f83d | 2019-02-28 12:06:45 -0700 | [diff] [blame] | 638 | public static final @android.annotation.NonNull Parcelable.Creator<ParcelableCall> CREATOR = |
Santos Cordon | 88b771d | 2014-07-19 13:10:40 -0700 | [diff] [blame] | 639 | new Parcelable.Creator<ParcelableCall> () { |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 640 | @Override |
Santos Cordon | 88b771d | 2014-07-19 13:10:40 -0700 | [diff] [blame] | 641 | public ParcelableCall createFromParcel(Parcel source) { |
| 642 | ClassLoader classLoader = ParcelableCall.class.getClassLoader(); |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 643 | String id = source.readString(); |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 644 | int state = source.readInt(); |
Bernardo Rufino | 90bb370 | 2021-12-07 20:01:45 +0000 | [diff] [blame] | 645 | DisconnectCause disconnectCause = source.readParcelable(classLoader, android.telecom.DisconnectCause.class); |
Ihab Awad | c067754 | 2014-06-10 13:29:47 -0700 | [diff] [blame] | 646 | List<String> cannedSmsResponses = new ArrayList<>(); |
Bernardo Rufino | 90bb370 | 2021-12-07 20:01:45 +0000 | [diff] [blame] | 647 | source.readList(cannedSmsResponses, classLoader, java.lang.String.class); |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 648 | int capabilities = source.readInt(); |
Andrew Lee | 223ad14 | 2014-08-27 16:33:08 -0700 | [diff] [blame] | 649 | int properties = source.readInt(); |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 650 | long connectTimeMillis = source.readLong(); |
Tyler Gunn | 7c61306 | 2020-04-13 17:19:24 -0700 | [diff] [blame] | 651 | Uri handle = Uri.CREATOR.createFromParcel(source); |
Sailesh Nepal | 6120386 | 2014-07-11 14:50:13 -0700 | [diff] [blame] | 652 | int handlePresentation = source.readInt(); |
| 653 | String callerDisplayName = source.readString(); |
| 654 | int callerDisplayNamePresentation = source.readInt(); |
Bernardo Rufino | 90bb370 | 2021-12-07 20:01:45 +0000 | [diff] [blame] | 655 | GatewayInfo gatewayInfo = source.readParcelable(classLoader, android.telecom.GatewayInfo.class); |
| 656 | PhoneAccountHandle accountHandle = source.readParcelable(classLoader, android.telecom.PhoneAccountHandle.class); |
Tyler Gunn | 7595842 | 2015-04-15 14:23:42 -0700 | [diff] [blame] | 657 | boolean isVideoCallProviderChanged = source.readByte() == 1; |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 658 | IVideoProvider videoCallProvider = |
| 659 | IVideoProvider.Stub.asInterface(source.readStrongBinder()); |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 660 | String parentCallId = source.readString(); |
| 661 | List<String> childCallIds = new ArrayList<>(); |
Bernardo Rufino | 90bb370 | 2021-12-07 20:01:45 +0000 | [diff] [blame] | 662 | source.readList(childCallIds, classLoader, java.lang.String.class); |
| 663 | StatusHints statusHints = source.readParcelable(classLoader, android.telecom.StatusHints.class); |
Andrew Lee | 85f5d42 | 2014-07-11 17:22:03 -0700 | [diff] [blame] | 664 | int videoState = source.readInt(); |
Santos Cordon | 7c7bc7f | 2014-07-28 18:15:48 -0700 | [diff] [blame] | 665 | List<String> conferenceableCallIds = new ArrayList<>(); |
Bernardo Rufino | 90bb370 | 2021-12-07 20:01:45 +0000 | [diff] [blame] | 666 | source.readList(conferenceableCallIds, classLoader, java.lang.String.class); |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 667 | Bundle intentExtras = source.readBundle(classLoader); |
| 668 | Bundle extras = source.readBundle(classLoader); |
Christine Hallstrom | 2830ce9 | 2016-11-30 16:06:42 -0800 | [diff] [blame] | 669 | int supportedAudioRoutes = source.readInt(); |
Hall Liu | 95d5587 | 2017-01-25 17:12:49 -0800 | [diff] [blame] | 670 | boolean isRttCallChanged = source.readByte() == 1; |
Bernardo Rufino | 90bb370 | 2021-12-07 20:01:45 +0000 | [diff] [blame] | 671 | ParcelableRttCall rttCall = source.readParcelable(classLoader, android.telecom.ParcelableRttCall.class); |
Tyler Gunn | c0bf6de | 2017-03-17 11:27:09 -0700 | [diff] [blame] | 672 | long creationTimeMillis = source.readLong(); |
Tyler Gunn | 9e76fd19b | 2018-12-17 09:56:11 -0800 | [diff] [blame] | 673 | int callDirection = source.readInt(); |
Tyler Gunn | d57d76c | 2019-09-24 14:53:23 -0700 | [diff] [blame] | 674 | int callerNumberVerificationStatus = source.readInt(); |
Hall Liu | ef98bf8 | 2020-01-09 15:22:44 -0800 | [diff] [blame] | 675 | String contactDisplayName = source.readString(); |
| 676 | String activeChildCallId = source.readString(); |
Edgar Arriaga | e5bec82 | 2022-10-14 14:25:43 -0700 | [diff] [blame] | 677 | Uri contactPhotoUri = source.readParcelable(classLoader, Uri.class); |
Hall Liu | ef98bf8 | 2020-01-09 15:22:44 -0800 | [diff] [blame] | 678 | return new ParcelableCallBuilder() |
| 679 | .setId(id) |
| 680 | .setState(state) |
| 681 | .setDisconnectCause(disconnectCause) |
| 682 | .setCannedSmsResponses(cannedSmsResponses) |
| 683 | .setCapabilities(capabilities) |
| 684 | .setProperties(properties) |
| 685 | .setSupportedAudioRoutes(supportedAudioRoutes) |
| 686 | .setConnectTimeMillis(connectTimeMillis) |
| 687 | .setHandle(handle) |
| 688 | .setHandlePresentation(handlePresentation) |
| 689 | .setCallerDisplayName(callerDisplayName) |
| 690 | .setCallerDisplayNamePresentation(callerDisplayNamePresentation) |
| 691 | .setGatewayInfo(gatewayInfo) |
| 692 | .setAccountHandle(accountHandle) |
| 693 | .setIsVideoCallProviderChanged(isVideoCallProviderChanged) |
| 694 | .setVideoCallProvider(videoCallProvider) |
| 695 | .setIsRttCallChanged(isRttCallChanged) |
| 696 | .setRttCall(rttCall) |
| 697 | .setParentCallId(parentCallId) |
| 698 | .setChildCallIds(childCallIds) |
| 699 | .setStatusHints(statusHints) |
| 700 | .setVideoState(videoState) |
| 701 | .setConferenceableCallIds(conferenceableCallIds) |
| 702 | .setIntentExtras(intentExtras) |
| 703 | .setExtras(extras) |
| 704 | .setCreationTimeMillis(creationTimeMillis) |
| 705 | .setCallDirection(callDirection) |
| 706 | .setCallerNumberVerificationStatus(callerNumberVerificationStatus) |
| 707 | .setContactDisplayName(contactDisplayName) |
| 708 | .setActiveChildCallId(activeChildCallId) |
Edgar Arriaga | e5bec82 | 2022-10-14 14:25:43 -0700 | [diff] [blame] | 709 | .setContactPhotoUri(contactPhotoUri) |
Hall Liu | ef98bf8 | 2020-01-09 15:22:44 -0800 | [diff] [blame] | 710 | .createParcelableCall(); |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 711 | } |
| 712 | |
| 713 | @Override |
Santos Cordon | 88b771d | 2014-07-19 13:10:40 -0700 | [diff] [blame] | 714 | public ParcelableCall[] newArray(int size) { |
| 715 | return new ParcelableCall[size]; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 716 | } |
| 717 | }; |
| 718 | |
| 719 | /** {@inheritDoc} */ |
| 720 | @Override |
| 721 | public int describeContents() { |
| 722 | return 0; |
| 723 | } |
| 724 | |
Santos Cordon | 88b771d | 2014-07-19 13:10:40 -0700 | [diff] [blame] | 725 | /** Writes ParcelableCall object into a Parcel. */ |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 726 | @Override |
| 727 | public void writeToParcel(Parcel destination, int flags) { |
| 728 | destination.writeString(mId); |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 729 | destination.writeInt(mState); |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 730 | destination.writeParcelable(mDisconnectCause, 0); |
Ihab Awad | c067754 | 2014-06-10 13:29:47 -0700 | [diff] [blame] | 731 | destination.writeList(mCannedSmsResponses); |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 732 | destination.writeInt(mCapabilities); |
Andrew Lee | 223ad14 | 2014-08-27 16:33:08 -0700 | [diff] [blame] | 733 | destination.writeInt(mProperties); |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 734 | destination.writeLong(mConnectTimeMillis); |
Tyler Gunn | 7c61306 | 2020-04-13 17:19:24 -0700 | [diff] [blame] | 735 | Uri.writeToParcel(destination, mHandle); |
Sailesh Nepal | 6120386 | 2014-07-11 14:50:13 -0700 | [diff] [blame] | 736 | destination.writeInt(mHandlePresentation); |
| 737 | destination.writeString(mCallerDisplayName); |
| 738 | destination.writeInt(mCallerDisplayNamePresentation); |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 739 | destination.writeParcelable(mGatewayInfo, 0); |
Evan Charlton | 8c8a062 | 2014-07-20 12:31:00 -0700 | [diff] [blame] | 740 | destination.writeParcelable(mAccountHandle, 0); |
Tyler Gunn | 7595842 | 2015-04-15 14:23:42 -0700 | [diff] [blame] | 741 | destination.writeByte((byte) (mIsVideoCallProviderChanged ? 1 : 0)); |
Tyler Gunn | 807de8a | 2014-06-30 14:22:57 -0700 | [diff] [blame] | 742 | destination.writeStrongBinder( |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 743 | mVideoCallProvider != null ? mVideoCallProvider.asBinder() : null); |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 744 | destination.writeString(mParentCallId); |
| 745 | destination.writeList(mChildCallIds); |
Sailesh Nepal | e7ef59a | 2014-07-08 21:48:22 -0700 | [diff] [blame] | 746 | destination.writeParcelable(mStatusHints, 0); |
Andrew Lee | 85f5d42 | 2014-07-11 17:22:03 -0700 | [diff] [blame] | 747 | destination.writeInt(mVideoState); |
Santos Cordon | 7c7bc7f | 2014-07-28 18:15:48 -0700 | [diff] [blame] | 748 | destination.writeList(mConferenceableCallIds); |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 749 | destination.writeBundle(mIntentExtras); |
| 750 | destination.writeBundle(mExtras); |
Christine Hallstrom | 2830ce9 | 2016-11-30 16:06:42 -0800 | [diff] [blame] | 751 | destination.writeInt(mSupportedAudioRoutes); |
Hall Liu | 95d5587 | 2017-01-25 17:12:49 -0800 | [diff] [blame] | 752 | destination.writeByte((byte) (mIsRttCallChanged ? 1 : 0)); |
| 753 | destination.writeParcelable(mRttCall, 0); |
Tyler Gunn | c0bf6de | 2017-03-17 11:27:09 -0700 | [diff] [blame] | 754 | destination.writeLong(mCreationTimeMillis); |
Tyler Gunn | 9e76fd19b | 2018-12-17 09:56:11 -0800 | [diff] [blame] | 755 | destination.writeInt(mCallDirection); |
Tyler Gunn | d57d76c | 2019-09-24 14:53:23 -0700 | [diff] [blame] | 756 | destination.writeInt(mCallerNumberVerificationStatus); |
Hall Liu | ef98bf8 | 2020-01-09 15:22:44 -0800 | [diff] [blame] | 757 | destination.writeString(mContactDisplayName); |
| 758 | destination.writeString(mActiveChildCallId); |
Edgar Arriaga | e5bec82 | 2022-10-14 14:25:43 -0700 | [diff] [blame] | 759 | destination.writeParcelable(mContactPhotoUri, 0); |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 760 | } |
Santos Cordon | b693998 | 2014-06-04 20:20:58 -0700 | [diff] [blame] | 761 | |
| 762 | @Override |
| 763 | public String toString() { |
| 764 | return String.format("[%s, parent:%s, children:%s]", mId, mParentCallId, mChildCallIds); |
| 765 | } |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 766 | } |