summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-08-15 07:24:29 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-08-15 07:24:29 +0000
commit4752e0a00fb210067260028ed5cc3607e4604de6 (patch)
tree377c77cc9c6ff7bc7e4d224c5c1680d1b88110a6
parent37fd72bf892ea48ae2dbf367608e81b4b8a84de2 (diff)
parent798ac7862886826ac98dffd8a7651086fe43b30c (diff)
downloadplatform_packages_services_Telephony-oreo-dr1-release.tar.gz
platform_packages_services_Telephony-oreo-dr1-release.tar.bz2
platform_packages_services_Telephony-oreo-dr1-release.zip
Change-Id: I593d27fd878a30278797bf18734013f31ea9c316
-rw-r--r--src/com/android/services/telephony/PstnIncomingCallNotifier.java20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/com/android/services/telephony/PstnIncomingCallNotifier.java b/src/com/android/services/telephony/PstnIncomingCallNotifier.java
index 381c131cf..e52ca722f 100644
--- a/src/com/android/services/telephony/PstnIncomingCallNotifier.java
+++ b/src/com/android/services/telephony/PstnIncomingCallNotifier.java
@@ -30,7 +30,9 @@ import android.text.TextUtils;
import com.android.internal.telephony.Call;
import com.android.internal.telephony.CallStateException;
import com.android.internal.telephony.Connection;
+import com.android.internal.telephony.GsmCdmaPhone;
import com.android.internal.telephony.Phone;
+import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.cdma.CdmaCallWaitingNotification;
import com.android.internal.telephony.imsphone.ImsExternalCallTracker;
import com.android.internal.telephony.imsphone.ImsExternalConnection;
@@ -320,14 +322,16 @@ final class PstnIncomingCallNotifier {
if (original instanceof ImsExternalConnection) {
return true;
}
- // Since we have set the new connection as the original connection, disconnect the old
- // one, since it is no longer needed.
- try {
- original.hangup();
- Log.i(this, "Hung up original connection: " + original);
- } catch (CallStateException e) {
- Log.w(this, "Couldn't hang up original connection: " + original + ", Error: "
- + e.getError());
+ // If the connection we're replacing was a GSM or CDMA connection, call upon the call
+ // tracker to perform cleanup of calls. This ensures that we don't end up with a
+ // call stuck in the call tracker preventing other calls from being placed.
+ if (original.getCall() != null && original.getCall().getPhone() != null &&
+ original.getCall().getPhone() instanceof GsmCdmaPhone) {
+
+ GsmCdmaPhone phone = (GsmCdmaPhone) original.getCall().getPhone();
+ phone.getCallTracker().cleanupCalls();
+ Log.i(this, "maybeSwapWithUnknownConnection - Invoking call tracker cleanup "
+ + "for connection: " + original);
}
return true;
}