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

Commit cae29ec6 authored by Tomasz Wasilczyk's avatar Tomasz Wasilczyk
Browse files

CarrierPrivilegesTracker: additional logging to diagnose lost SIM state

Bug: 398737967
Change-Id: Id98468f5283dffa7a4e862aaa43f7f0b2d5427f3
Test: TH
Flag: EXEMPT logging only
parent 0f8783b4
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -559,6 +559,9 @@ public class CarrierPrivilegesTracker extends Handler {
    private void handleSimStateChanged(int slotId, int simState) {
        if (slotId != mPhone.getPhoneId()) return;

        // TODO(b/398737967): remove or silence down when diagnosed
        Rlog.d(TAG, "handleSimStateChanged: slotId=" + slotId + " simState=" + simState);

        List<UiccAccessRule> updatedUiccRules = Collections.EMPTY_LIST;

        mPrivilegedPackageInfoLock.writeLock().lock();
@@ -570,7 +573,7 @@ public class CarrierPrivilegesTracker extends Handler {

        // Only include the UICC rules if the SIM is fully loaded
        if (simState == SIM_STATE_LOADED) {
            mLocalLog.log("SIM fully loaded, handleUiccAccessRulesLoaded.");
            Rlog.d(TAG, "handleSimStateChanged: SIM fully loaded.");
            handleUiccAccessRulesLoaded();
        } else {
            if (!mUiccRules.isEmpty()
@@ -579,12 +582,13 @@ public class CarrierPrivilegesTracker extends Handler {
                        SystemClock.uptimeMillis() + CLEAR_UICC_RULES_DELAY_MILLIS;
                mCurrentHandler.sendMessageAtTime(obtainMessage(ACTION_CLEAR_UICC_RULES),
                        mClearUiccRulesUptimeMillis);
                mLocalLog.log("SIM is gone, simState=" + TelephonyManager.simStateToString(simState)
                Rlog.d(TAG, "handleSimStateChanged: SIM is gone, simState="
                        + TelephonyManager.simStateToString(simState)
                        + ". Delay " + TimeUnit.MILLISECONDS.toSeconds(
                        CLEAR_UICC_RULES_DELAY_MILLIS) + " seconds to clear UICC rules.");
            } else {
                mLocalLog.log(
                        "Ignore SIM gone event while UiccRules is empty or waiting to be emptied.");
                Rlog.d(TAG, "handleSimStateChanged: Ignore SIM gone event while"
                        + " UiccRules is empty or waiting to be emptied.");
            }
        }
    }