Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 61e565b7 authored by Dante Russo's avatar Dante Russo Committed by Joe Huang
Browse files

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
parent 7ed187c6
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -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;