summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Joe Huang <joethhuang@google.com> 2020-03-25 12:38:37 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2020-03-25 12:38:37 +0000
commita02b54d79c24e5ff54799d2db50a0fc01b91aa0c (patch)
tree4af2d54565b8108f914f0a82b4e8a4e6647eab26
parentdffe0cee3c33617279e0a7b5cc1f7063e6b4414b (diff)
parent61e565b733e5f40a54cf5e497c8e8be3be66876c (diff)
Merge "Use sub specific telephony for emergency supl" into rvc-dev
-rw-r--r--services/core/java/com/android/server/location/GnssNetworkConnectivityHandler.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/location/GnssNetworkConnectivityHandler.java b/services/core/java/com/android/server/location/GnssNetworkConnectivityHandler.java
index 93f47b1bf592..5d6474bdbccc 100644
--- a/services/core/java/com/android/server/location/GnssNetworkConnectivityHandler.java
+++ b/services/core/java/com/android/server/location/GnssNetworkConnectivityHandler.java
@@ -711,6 +711,15 @@ class GnssNetworkConnectivityHandler {
}
TelephonyManager phone = (TelephonyManager)
mContext.getSystemService(Context.TELEPHONY_SERVICE);
+ // During an emergency call with an active sub id, get the Telephony Manager specific
+ // to the active sub to get the correct value from getServiceState and getNetworkType
+ if (mNiHandler.getInEmergency() && mActiveSubId >= 0) {
+ TelephonyManager subIdTelManager =
+ phone.createForSubscriptionId(mActiveSubId);
+ if (subIdTelManager != null) {
+ phone = subIdTelManager;
+ }
+ }
ServiceState serviceState = phone.getServiceState();
String projection = null;
String selection = null;