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

Commit 70e03d95 authored by Jayachandran C's avatar Jayachandran C Committed by calvinpan
Browse files

Remove usage of Telephonymanager getDefault() hidden API

This CL replaces with getSystemService(TelephonyManager.class)

Bug: 140768340
Test: Build
Change-Id: Ifb7b53af787b86b1d6c2f91a96a330bde57271d7
Merged-In: Ifb7b53af787b86b1d6c2f91a96a330bde57271d7
parent 6eac9290
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -2574,8 +2574,12 @@ class DatabaseHelper extends SQLiteOpenHelper {
            // value defined in system property
            StringBuilder val = new StringBuilder();
            List<Integer> defaultNetworks = TelephonyProperties.default_network();
            for (int phoneId = 0;
                    phoneId < TelephonyManager.getDefault().getPhoneCount(); phoneId++) {
            int phoneCount = 1;
            TelephonyManager telephonyManager = mContext.getSystemService(TelephonyManager.class);
            if (telephonyManager != null) {
                phoneCount = telephonyManager.getSupportedModemCount();
            }
            for (int phoneId = 0; phoneId < phoneCount; phoneId++) {
                int mode = defaultNetworks.size() <= phoneId
                        || defaultNetworks.get(phoneId) == null
                        ? RILConstants.PREFERRED_NETWORK_MODE : defaultNetworks.get(phoneId);