Listen to changes in the original connection for domain tracking
In EmergencyStateTracker, we need to know the domain of the call
in order to perform different procedures when we move into ECBM.
This change adds a listener that fires when the original
connection changes, causing us to be able to determine which
domain the emergency call is going over.
Bug: 247639718
Test: atest TeleServiceTests:TelephonyConnectionServiceTest; Placed call/sms, used data
Change-Id: I38ebd47a70687395d868b507549b98b0c6b36045
diff --git a/src/com/android/services/telephony/TelephonyConnectionService.java b/src/com/android/services/telephony/TelephonyConnectionService.java
index a5be6c3..8da1b7d 100644
--- a/src/com/android/services/telephony/TelephonyConnectionService.java
+++ b/src/com/android/services/telephony/TelephonyConnectionService.java
@@ -532,7 +532,17 @@
*/
private final TelephonyConnection.TelephonyConnectionListener mEmergencyConnectionListener =
new TelephonyConnection.TelephonyConnectionListener() {
- @Override
+ @Override
+ public void onOriginalConnectionConfigured(TelephonyConnection c) {
+ com.android.internal.telephony.Connection origConn = c.getOriginalConnection();
+ if (origConn == null) return;
+ // Update the domain in the case that it changes,for example during initial
+ // setup or when there was an srvcc or internal redial.
+ mEmergencyStateTracker.onEmergencyCallDomainUpdated(
+ origConn.getPhoneType(), c.getTelecomCallId());
+ }
+
+ @Override
public void onStateChanged(Connection connection, @Connection.ConnectionState int state) {
if (connection != null) {
TelephonyConnection c = (TelephonyConnection) connection;