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

Commit 3c2fdd68 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Do not get CM instance in getActiveModemCount unless needed." am: 31bbebe1 am: 94486daa

Change-Id: I5ceb9b78bd2afc146279e87128500c853be79278
parents 4c1644cd 94486daa
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -427,14 +427,14 @@ public class TelephonyManager {
        int modemCount = 1;
        switch (getMultiSimConfiguration()) {
            case UNKNOWN:
                ConnectivityManager cm = mContext == null ? null : (ConnectivityManager) mContext
                        .getSystemService(Context.CONNECTIVITY_SERVICE);
                modemCount = MODEM_COUNT_SINGLE_MODEM;
                // check for voice and data support, 0 if not supported
                if (!isVoiceCapable() && !isSmsCapable() && cm != null
                        && !cm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE)) {
                if (!isVoiceCapable() && !isSmsCapable() && mContext != null) {
                    ConnectivityManager cm = (ConnectivityManager) mContext
                            .getSystemService(Context.CONNECTIVITY_SERVICE);
                    if (cm != null && !cm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE)) {
                        modemCount = MODEM_COUNT_NO_MODEM;
                } else {
                    modemCount = MODEM_COUNT_SINGLE_MODEM;
                    }
                }
                break;
            case DSDS: