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

Commit f1b6d306 authored by Roman Birg's avatar Roman Birg
Browse files

Settings: disable mobile network switch when SIM isn't ready



Change-Id: I4676390760f0d6107e706fe75cd26f7bf603cad6
Signed-off-by: default avatarRoman Birg <roman@cyngn.com>
parent 86c060ed
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -83,8 +83,10 @@ public class MobileNetworksEnabler extends GenericSwitchToggle {
    }

    private void updateState() {
        setEnabled(mTelephonyManager.getDataState() != TelephonyManager.DATA_UNKNOWN);
        setChecked(mTelephonyManager.getDataEnabled());
        final boolean simReady = mTelephonyManager.getSimState()
                == TelephonyManager.SIM_STATE_READY;
        setEnabled(simReady && mTelephonyManager.getDataState() != TelephonyManager.DATA_UNKNOWN);
        setChecked(simReady && mTelephonyManager.getDataEnabled());
    }

    @Override