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