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

Commit ece2c844 authored by Takanori Nakano's avatar Takanori Nakano Committed by Yoshiaki Naka
Browse files

Restarting the device must be triggered even in the airplane mode

The device does not trigger to restart itself while the radio power is
off in the current implementation, so user can replace SIM cards in the
airplane mode even if the SIM hot swap feature is disabled. The device
must be restarted in that scenario unless it is still in the start-up
procedure.

Bug: 123387537
Test: Manual

Change-Id: I9034cecd1cc7ecb7f6f662bfc02091db5053814c
parent 1e530f68
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -105,9 +105,9 @@ public class UiccSlot extends Handler {
            //   2. The latest mCardState is not ABSENT, but there is no UiccCard instance.
            } else if ((oldState == null || oldState == CardState.CARDSTATE_ABSENT
                    || mUiccCard == null) && mCardState != CardState.CARDSTATE_ABSENT) {
                // No notifications while radio is off or we just powering up
                if (radioState == TelephonyManager.RADIO_POWER_ON
                        && mLastRadioState == TelephonyManager.RADIO_POWER_ON) {
                // No notification while we are just powering up
                if (radioState != TelephonyManager.RADIO_POWER_UNAVAILABLE
                        && mLastRadioState != TelephonyManager.RADIO_POWER_UNAVAILABLE) {
                    if (DBG) log("update: notify card added");
                    sendMessage(obtainMessage(EVENT_CARD_ADDED, null));
                }
@@ -183,9 +183,9 @@ public class UiccSlot extends Handler {
    private void updateCardStateAbsent() {
        int radioState =
                (mCi == null) ? TelephonyManager.RADIO_POWER_UNAVAILABLE : mCi.getRadioState();
        // No notifications while radio is off or we just powering up
        if (radioState == TelephonyManager.RADIO_POWER_ON
                && mLastRadioState == TelephonyManager.RADIO_POWER_ON) {
        // No notification while we are just powering up
        if (radioState != TelephonyManager.RADIO_POWER_UNAVAILABLE
                && mLastRadioState != TelephonyManager.RADIO_POWER_UNAVAILABLE) {
            if (DBG) log("update: notify card removed");
            sendMessage(obtainMessage(EVENT_CARD_REMOVED, null));
        }