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

Commit fbbca48d authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Ignore SIM state events during shutdown" am: 1db27cdf am: 1e11a1e9 am: 8ec96b45

Original change: https://android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/1398930

Change-Id: I766acba4ef566aeacd63a421a808e6eeb4f134cd
parents 926fb849 8ec96b45
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -682,6 +682,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;

@@ -910,6 +917,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;

@@ -1226,6 +1240,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);