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

Commit 1db27cdf authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Ignore SIM state events during shutdown"

parents 889980a0 966242ef
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -686,6 +686,13 @@ public class UiccController extends Handler {
            Rlog.e(LOG_TAG,"onGetIccCardStatusDone: invalid index : " + index);
            return;
        }
        if (isShuttingDown()) {
            // Do not process the SIM/SLOT events during device shutdown,
            // as it may unnecessarily modify the persistent information
            // like, SubscriptionManager.UICC_APPLICATIONS_ENABLED.
            log("onGetIccCardStatusDone: shudown in progress ignore event");
            return;
        }

        IccCardStatus status = (IccCardStatus)ar.result;

@@ -914,6 +921,13 @@ public class UiccController extends Handler {
            }
            return;
        }
        if (isShuttingDown()) {
            // Do not process the SIM/SLOT events during device shutdown,
            // as it may unnecessarily modify the persistent information
            // like, SubscriptionManager.UICC_APPLICATIONS_ENABLED.
            log("onGetSlotStatusDone: shudown in progress ignore event");
            return;
        }

        ArrayList<IccSlotStatus> status = (ArrayList<IccSlotStatus>) ar.result;

@@ -1230,6 +1244,16 @@ public class UiccController extends Handler {
        return (index >= 0 && index < mUiccSlots.length);
    }

    private boolean isShuttingDown() {
        for (int i = 0; i < TelephonyManager.getDefault().getActiveModemCount(); i++) {
            if (PhoneFactory.getPhone(i) != null &&
                    PhoneFactory.getPhone(i).isShuttingDown()) {
                return true;
            }
        }
        return false;
    }

    @UnsupportedAppUsage
    private void log(String string) {
        Rlog.d(LOG_TAG, string);