| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.telecom; |
| 18 |
|
| 19 |
import android.annotation.Nullable; |
| 20 |
import android.compat.annotation.UnsupportedAppUsage; |
| 21 |
import android.net.Uri; |
| 22 |
import android.os.Build; |
| 23 |
import android.os.Bundle; |
| 24 |
import android.os.Parcel; |
| 25 |
import android.os.Parcelable; |
| 26 |
import android.os.RemoteException; |
| 27 |
import android.telecom.Call.Details.CallDirection; |
| 28 |
|
| 29 |
import com.android.internal.telecom.IVideoProvider; |
| 30 |
|
| 31 |
import java.util.ArrayList; |
| 32 |
import java.util.Collections; |
| 33 |
import java.util.List; |
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
public final class ParcelableCall implements Parcelable { |
| 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 |
|
| 299 |
private final String mId; |
| 300 |
private final int mState; |
| 301 |
private final DisconnectCause mDisconnectCause; |
| 302 |
private final List<String> mCannedSmsResponses; |
| 303 |
private final int mCapabilities; |
| 304 |
private final int mProperties; |
| 305 |
private final int mSupportedAudioRoutes; |
| 306 |
private final long mConnectTimeMillis; |
| 307 |
private final Uri mHandle; |
| 308 |
private final int mHandlePresentation; |
| 309 |
private final String mCallerDisplayName; |
| 310 |
private final int mCallerDisplayNamePresentation; |
| 311 |
private final GatewayInfo mGatewayInfo; |
| 312 |
private final PhoneAccountHandle mAccountHandle; |
| 313 |
private final boolean mIsVideoCallProviderChanged; |
| 314 |
private final IVideoProvider mVideoCallProvider; |
| 315 |
private VideoCallImpl mVideoCall; |
| 316 |
private final boolean mIsRttCallChanged; |
| 317 |
private final ParcelableRttCall mRttCall; |
| 318 |
private final String mParentCallId; |
| 319 |
private final List<String> mChildCallIds; |
| 320 |
private final StatusHints mStatusHints; |
| 321 |
private final int mVideoState; |
| 322 |
private final List<String> mConferenceableCallIds; |
| 323 |
private final Bundle mIntentExtras; |
| 324 |
private final Bundle mExtras; |
| 325 |
private final long mCreationTimeMillis; |
| 326 |
private final int mCallDirection; |
| 327 |
private final int mCallerNumberVerificationStatus; |
| 328 |
private final String mContactDisplayName; |
| 329 |
private final String mActiveChildCallId; |
| 330 |
|
| 331 |
public ParcelableCall( |
| 332 |
String id, |
| 333 |
int state, |
| 334 |
DisconnectCause disconnectCause, |
| 335 |
List<String> cannedSmsResponses, |
| 336 |
int capabilities, |
| 337 |
int properties, |
| 338 |
int supportedAudioRoutes, |
| 339 |
long connectTimeMillis, |
| 340 |
Uri handle, |
| 341 |
int handlePresentation, |
| 342 |
String callerDisplayName, |
| 343 |
int callerDisplayNamePresentation, |
| 344 |
GatewayInfo gatewayInfo, |
| 345 |
PhoneAccountHandle accountHandle, |
| 346 |
boolean isVideoCallProviderChanged, |
| 347 |
IVideoProvider videoCallProvider, |
| 348 |
boolean isRttCallChanged, |
| 349 |
ParcelableRttCall rttCall, |
| 350 |
String parentCallId, |
| 351 |
List<String> childCallIds, |
| 352 |
StatusHints statusHints, |
| 353 |
int videoState, |
| 354 |
List<String> conferenceableCallIds, |
| 355 |
Bundle intentExtras, |
| 356 |
Bundle extras, |
| 357 |
long creationTimeMillis, |
| 358 |
int callDirection, |
| 359 |
int callerNumberVerificationStatus, |
| 360 |
String contactDisplayName, |
| 361 |
String activeChildCallId |
| 362 |
) { |
| 363 |
mId = id; |
| 364 |
mState = state; |
| 365 |
mDisconnectCause = disconnectCause; |
| 366 |
mCannedSmsResponses = cannedSmsResponses; |
| 367 |
mCapabilities = capabilities; |
| 368 |
mProperties = properties; |
| 369 |
mSupportedAudioRoutes = supportedAudioRoutes; |
| 370 |
mConnectTimeMillis = connectTimeMillis; |
| 371 |
mHandle = handle; |
| 372 |
mHandlePresentation = handlePresentation; |
| 373 |
mCallerDisplayName = callerDisplayName; |
| 374 |
mCallerDisplayNamePresentation = callerDisplayNamePresentation; |
| 375 |
mGatewayInfo = gatewayInfo; |
| 376 |
mAccountHandle = accountHandle; |
| 377 |
mIsVideoCallProviderChanged = isVideoCallProviderChanged; |
| 378 |
mVideoCallProvider = videoCallProvider; |
| 379 |
mIsRttCallChanged = isRttCallChanged; |
| 380 |
mRttCall = rttCall; |
| 381 |
mParentCallId = parentCallId; |
| 382 |
mChildCallIds = childCallIds; |
| 383 |
mStatusHints = statusHints; |
| 384 |
mVideoState = videoState; |
| 385 |
mConferenceableCallIds = Collections.unmodifiableList(conferenceableCallIds); |
| 386 |
mIntentExtras = intentExtras; |
| 387 |
mExtras = extras; |
| 388 |
mCreationTimeMillis = creationTimeMillis; |
| 389 |
mCallDirection = callDirection; |
| 390 |
mCallerNumberVerificationStatus = callerNumberVerificationStatus; |
| 391 |
mContactDisplayName = contactDisplayName; |
| 392 |
mActiveChildCallId = activeChildCallId; |
| 393 |
} |
| 394 |
|
| 395 |
|
| 396 |
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) |
| 397 |
public String getId() { |
| 398 |
return mId; |
| 399 |
} |
| 400 |
|
| 401 |
|
| 402 |
public @Call.CallState int getState() { |
| 403 |
return mState; |
| 404 |
} |
| 405 |
|
| 406 |
|
| 407 |
|
| 408 |
|
| 409 |
|
| 410 |
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) |
| 411 |
public DisconnectCause getDisconnectCause() { |
| 412 |
return mDisconnectCause; |
| 413 |
} |
| 414 |
|
| 415 |
|
| 416 |
|
| 417 |
|
| 418 |
public List<String> getCannedSmsResponses() { |
| 419 |
return mCannedSmsResponses; |
| 420 |
} |
| 421 |
|
| 422 |
|
| 423 |
public int getCapabilities() { |
| 424 |
return mCapabilities; |
| 425 |
} |
| 426 |
|
| 427 |
|
| 428 |
public int getProperties() { return mProperties; } |
| 429 |
|
| 430 |
|
| 431 |
public int getSupportedAudioRoutes() { |
| 432 |
return mSupportedAudioRoutes; |
| 433 |
} |
| 434 |
|
| 435 |
|
| 436 |
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) |
| 437 |
public long getConnectTimeMillis() { |
| 438 |
return mConnectTimeMillis; |
| 439 |
} |
| 440 |
|
| 441 |
|
| 442 |
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) |
| 443 |
public Uri getHandle() { |
| 444 |
return mHandle; |
| 445 |
} |
| 446 |
|
| 447 |
|
| 448 |
|
| 449 |
|
| 450 |
public int getHandlePresentation() { |
| 451 |
return mHandlePresentation; |
| 452 |
} |
| 453 |
|
| 454 |
|
| 455 |
public String getCallerDisplayName() { |
| 456 |
return mCallerDisplayName; |
| 457 |
} |
| 458 |
|
| 459 |
|
| 460 |
|
| 461 |
|
| 462 |
|
| 463 |
public int getCallerDisplayNamePresentation() { |
| 464 |
return mCallerDisplayNamePresentation; |
| 465 |
} |
| 466 |
|
| 467 |
|
| 468 |
public GatewayInfo getGatewayInfo() { |
| 469 |
return mGatewayInfo; |
| 470 |
} |
| 471 |
|
| 472 |
|
| 473 |
public PhoneAccountHandle getAccountHandle() { |
| 474 |
return mAccountHandle; |
| 475 |
} |
| 476 |
|
| 477 |
|
| 478 |
|
| 479 |
|
| 480 |
|
| 481 |
|
| 482 |
|
| 483 |
|
| 484 |
public VideoCallImpl getVideoCallImpl(String callingPackageName, int targetSdkVersion) { |
| 485 |
if (mVideoCall == null && mVideoCallProvider != null) { |
| 486 |
try { |
| 487 |
mVideoCall = new VideoCallImpl(mVideoCallProvider, callingPackageName, |
| 488 |
targetSdkVersion); |
| 489 |
} catch (RemoteException ignored) { |
| 490 |
|
| 491 |
} |
| 492 |
} |
| 493 |
|
| 494 |
return mVideoCall; |
| 495 |
} |
| 496 |
|
| 497 |
public IVideoProvider getVideoProvider() { |
| 498 |
return mVideoCallProvider; |
| 499 |
} |
| 500 |
|
| 501 |
public boolean getIsRttCallChanged() { |
| 502 |
return mIsRttCallChanged; |
| 503 |
} |
| 504 |
|
| 505 |
|
| 506 |
|
| 507 |
|
| 508 |
|
| 509 |
public ParcelableRttCall getParcelableRttCall() { |
| 510 |
return mRttCall; |
| 511 |
} |
| 512 |
|
| 513 |
|
| 514 |
|
| 515 |
|
| 516 |
public String getParentCallId() { |
| 517 |
return mParentCallId; |
| 518 |
} |
| 519 |
|
| 520 |
|
| 521 |
|
| 522 |
|
| 523 |
|
| 524 |
public List<String> getChildCallIds() { |
| 525 |
return mChildCallIds; |
| 526 |
} |
| 527 |
|
| 528 |
public List<String> getConferenceableCallIds() { |
| 529 |
return mConferenceableCallIds; |
| 530 |
} |
| 531 |
|
| 532 |
|
| 533 |
|
| 534 |
|
| 535 |
|
| 536 |
|
| 537 |
public StatusHints getStatusHints() { |
| 538 |
return mStatusHints; |
| 539 |
} |
| 540 |
|
| 541 |
|
| 542 |
|
| 543 |
|
| 544 |
|
| 545 |
public int getVideoState() { |
| 546 |
return mVideoState; |
| 547 |
} |
| 548 |
|
| 549 |
|
| 550 |
|
| 551 |
|
| 552 |
|
| 553 |
|
| 554 |
public Bundle getExtras() { |
| 555 |
return mExtras; |
| 556 |
} |
| 557 |
|
| 558 |
|
| 559 |
|
| 560 |
|
| 561 |
|
| 562 |
|
| 563 |
public Bundle getIntentExtras() { |
| 564 |
return mIntentExtras; |
| 565 |
} |
| 566 |
|
| 567 |
|
| 568 |
|
| 569 |
|
| 570 |
|
| 571 |
|
| 572 |
|
| 573 |
|
| 574 |
|
| 575 |
public boolean isVideoCallProviderChanged() { |
| 576 |
return mIsVideoCallProviderChanged; |
| 577 |
} |
| 578 |
|
| 579 |
|
| 580 |
|
| 581 |
|
| 582 |
public long getCreationTimeMillis() { |
| 583 |
return mCreationTimeMillis; |
| 584 |
} |
| 585 |
|
| 586 |
|
| 587 |
|
| 588 |
|
| 589 |
public @CallDirection int getCallDirection() { |
| 590 |
return mCallDirection; |
| 591 |
} |
| 592 |
|
| 593 |
|
| 594 |
|
| 595 |
|
| 596 |
|
| 597 |
|
| 598 |
public @Connection.VerificationStatus int getCallerNumberVerificationStatus() { |
| 599 |
return mCallerNumberVerificationStatus; |
| 600 |
} |
| 601 |
|
| 602 |
|
| 603 |
|
| 604 |
|
| 605 |
public @Nullable String getContactDisplayName() { |
| 606 |
return mContactDisplayName; |
| 607 |
} |
| 608 |
|
| 609 |
|
| 610 |
|
| 611 |
|
| 612 |
|
| 613 |
public @Nullable String getActiveChildCallId() { |
| 614 |
return mActiveChildCallId; |
| 615 |
} |
| 616 |
|
| 617 |
|
| 618 |
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) |
| 619 |
public static final @android.annotation.NonNull Parcelable.Creator<ParcelableCall> CREATOR = |
| 620 |
new Parcelable.Creator<ParcelableCall> () { |
| 621 |
@Override |
| 622 |
public ParcelableCall createFromParcel(Parcel source) { |
| 623 |
ClassLoader classLoader = ParcelableCall.class.getClassLoader(); |
| 624 |
String id = source.readString(); |
| 625 |
int state = source.readInt(); |
| 626 |
DisconnectCause disconnectCause = source.readParcelable(classLoader, android.telecom.DisconnectCause.class); |
| 627 |
List<String> cannedSmsResponses = new ArrayList<>(); |
| 628 |
source.readList(cannedSmsResponses, classLoader, java.lang.String.class); |
| 629 |
int capabilities = source.readInt(); |
| 630 |
int properties = source.readInt(); |
| 631 |
long connectTimeMillis = source.readLong(); |
| 632 |
Uri handle = Uri.CREATOR.createFromParcel(source); |
| 633 |
int handlePresentation = source.readInt(); |
| 634 |
String callerDisplayName = source.readString(); |
| 635 |
int callerDisplayNamePresentation = source.readInt(); |
| 636 |
GatewayInfo gatewayInfo = source.readParcelable(classLoader, android.telecom.GatewayInfo.class); |
| 637 |
PhoneAccountHandle accountHandle = source.readParcelable(classLoader, android.telecom.PhoneAccountHandle.class); |
| 638 |
boolean isVideoCallProviderChanged = source.readByte() == 1; |
| 639 |
IVideoProvider videoCallProvider = |
| 640 |
IVideoProvider.Stub.asInterface(source.readStrongBinder()); |
| 641 |
String parentCallId = source.readString(); |
| 642 |
List<String> childCallIds = new ArrayList<>(); |
| 643 |
source.readList(childCallIds, classLoader, java.lang.String.class); |
| 644 |
StatusHints statusHints = source.readParcelable(classLoader, android.telecom.StatusHints.class); |
| 645 |
int videoState = source.readInt(); |
| 646 |
List<String> conferenceableCallIds = new ArrayList<>(); |
| 647 |
source.readList(conferenceableCallIds, classLoader, java.lang.String.class); |
| 648 |
Bundle intentExtras = source.readBundle(classLoader); |
| 649 |
Bundle extras = source.readBundle(classLoader); |
| 650 |
int supportedAudioRoutes = source.readInt(); |
| 651 |
boolean isRttCallChanged = source.readByte() == 1; |
| 652 |
ParcelableRttCall rttCall = source.readParcelable(classLoader, android.telecom.ParcelableRttCall.class); |
| 653 |
long creationTimeMillis = source.readLong(); |
| 654 |
int callDirection = source.readInt(); |
| 655 |
int callerNumberVerificationStatus = source.readInt(); |
| 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(); |
| 690 |
} |
| 691 |
|
| 692 |
@Override |
| 693 |
public ParcelableCall[] newArray(int size) { |
| 694 |
return new ParcelableCall[size]; |
| 695 |
} |
| 696 |
}; |
| 697 |
|
| 698 |
|
| 699 |
@Override |
| 700 |
public int describeContents() { |
| 701 |
return 0; |
| 702 |
} |
| 703 |
|
| 704 |
|
| 705 |
@Override |
| 706 |
public void writeToParcel(Parcel destination, int flags) { |
| 707 |
destination.writeString(mId); |
| 708 |
destination.writeInt(mState); |
| 709 |
destination.writeParcelable(mDisconnectCause, 0); |
| 710 |
destination.writeList(mCannedSmsResponses); |
| 711 |
destination.writeInt(mCapabilities); |
| 712 |
destination.writeInt(mProperties); |
| 713 |
destination.writeLong(mConnectTimeMillis); |
| 714 |
Uri.writeToParcel(destination, mHandle); |
| 715 |
destination.writeInt(mHandlePresentation); |
| 716 |
destination.writeString(mCallerDisplayName); |
| 717 |
destination.writeInt(mCallerDisplayNamePresentation); |
| 718 |
destination.writeParcelable(mGatewayInfo, 0); |
| 719 |
destination.writeParcelable(mAccountHandle, 0); |
| 720 |
destination.writeByte((byte) (mIsVideoCallProviderChanged ? 1 : 0)); |
| 721 |
destination.writeStrongBinder( |
| 722 |
mVideoCallProvider != null ? mVideoCallProvider.asBinder() : null); |
| 723 |
destination.writeString(mParentCallId); |
| 724 |
destination.writeList(mChildCallIds); |
| 725 |
destination.writeParcelable(mStatusHints, 0); |
| 726 |
destination.writeInt(mVideoState); |
| 727 |
destination.writeList(mConferenceableCallIds); |
| 728 |
destination.writeBundle(mIntentExtras); |
| 729 |
destination.writeBundle(mExtras); |
| 730 |
destination.writeInt(mSupportedAudioRoutes); |
| 731 |
destination.writeByte((byte) (mIsRttCallChanged ? 1 : 0)); |
| 732 |
destination.writeParcelable(mRttCall, 0); |
| 733 |
destination.writeLong(mCreationTimeMillis); |
| 734 |
destination.writeInt(mCallDirection); |
| 735 |
destination.writeInt(mCallerNumberVerificationStatus); |
| 736 |
destination.writeString(mContactDisplayName); |
| 737 |
destination.writeString(mActiveChildCallId); |
| 738 |
} |
| 739 |
|
| 740 |
@Override |
| 741 |
public String toString() { |
| 742 |
return String.format("[%s, parent:%s, children:%s]", mId, mParentCallId, mChildCallIds); |
| 743 |
} |
| 744 |
} |