Get phone instance before connection is cleared.
Bug: 269086509
Test: Testing using Anritsu test bed
Change-Id: I8e3f4da88d189dcd48e1684ed89fdf004e519e7b
diff --git a/src/com/android/services/telephony/TelephonyConnectionService.java b/src/com/android/services/telephony/TelephonyConnectionService.java
index 519655e..828dae8 100644
--- a/src/com/android/services/telephony/TelephonyConnectionService.java
+++ b/src/com/android/services/telephony/TelephonyConnectionService.java
@@ -2410,7 +2410,7 @@
+ ", psCause:" + reasonInfo);
if (mDomainSelectionConnection != null && c.getOriginalConnection() != null) {
- Phone phone = c.getPhone();
+ Phone phone = c.getPhone().getDefaultPhone();
final String number = c.getAddress().getSchemeSpecificPart();
int videoState = c.getOriginalConnection().getVideoState();
SelectionAttributes selectionAttributes = NormalCallDomainSelectionConnection
@@ -2424,7 +2424,7 @@
.reselectDomain(selectionAttributes);
if (future != null) {
future.thenAcceptAsync((result) -> {
- onNormalCallRedial(c, result, videoState);
+ onNormalCallRedial(c, phone, result, videoState);
}, mDomainSelectionMainExecutor);
return true;
}
@@ -2598,14 +2598,13 @@
onEmergencyRedialOnDomain(connection, phone, result);
}
- private void onNormalCallRedial(TelephonyConnection connection,
+ private void onNormalCallRedial(TelephonyConnection connection, Phone phone,
@NetworkRegistrationInfo.Domain int domain, int videocallState) {
Log.v(LOG_TAG, "Redialing the call in domain:"
+ DomainSelectionService.getDomainName(domain));
String number = connection.getAddress().getSchemeSpecificPart();
- Phone phone = connection.getPhone();
Bundle extras = new Bundle();
extras.putInt(PhoneConstants.EXTRA_DIAL_DOMAIN, domain);