diff options
| author | 2020-02-25 12:17:22 +0800 | |
|---|---|---|
| committer | 2020-03-25 12:37:55 +0000 | |
| commit | 61e565b733e5f40a54cf5e497c8e8be3be66876c (patch) | |
| tree | 21bb1cca29a943a399ee94f1bb82372de1fd5b29 | |
| parent | 7ed187c63eb055e07ab891e2635bf0322d2c964e (diff) | |
Use sub specific telephony for emergency supl
In multi-sim cases, we need to get the sub specific
telephony service in order to get the correct value
from functions getNetworkType and getServiceState
for the active sub instead of the default sub.
Bug: 150115901
Change-Id: Icb2e50500fe567fa1fee14eaaf04f0b308bc6cc6
CRs-fixed: 2616763
| -rw-r--r-- | services/core/java/com/android/server/location/GnssNetworkConnectivityHandler.java | 9 |
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 93227bd78a81..9ee9dcba9a81 100644 --- a/services/core/java/com/android/server/location/GnssNetworkConnectivityHandler.java +++ b/services/core/java/com/android/server/location/GnssNetworkConnectivityHandler.java @@ -598,6 +598,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; |