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

Commit 44c80fdb authored by Adnan Begovic's avatar Adnan Begovic
Browse files

telephony: Avoid NPE during hotswap where user nw is not set for invalid sub.

TICKET: CYNGNOS-1432
Change-Id: Ia20bb91d4157855224110d75136c5d3c5bd81eef
parent a14ab34c
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -1473,10 +1473,13 @@ public class SubscriptionController extends ISub.Stub {
                    networkType1 = getUserNwMode(id);
                    if (networkType1 == SubscriptionManager.DEFAULT_NW_MODE) {
                        SubscriptionInfo subInfo = getActiveSubscriptionInfo(subId);
                        // user mode is unset, prefer the default network mode
                        // user mode is unset, prefer the default network mode but only if
                        // the subscription is valid and available
                        if (subInfo != null) {
                            networkType1 = TelephonyManager.getTelephonyProperty(
                                    "ro.telephony.default_network", subInfo.getSimSlotIndex(), -1);
                        }
                    }
                    phoneId1 = phoneId;
                    if (DBG) logdl("[setDefaultDataSubNetworkType] networkType1: "
                            + networkType1 + ", phoneId1: " + phoneId1);