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

Commit b34891e1 authored by kun.tang's avatar kun.tang
Browse files

Fix lost query sim status in UiccController when device is unencrypted.

Some devices are unencrypted and vold.decrypt is not been setted.
In this case, UiccController cannot query sim status.

Test: build
Change-Id: Id1a06df0e1fbb92c6f68e745def88261fb503e22
parent bfc44f2e
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -89,8 +89,6 @@ public class UiccController extends Handler {
    private static final int EVENT_RADIO_UNAVAILABLE = 3;
    private static final int EVENT_SIM_REFRESH = 4;

    private static final String DECRYPT_STATE = "trigger_restart_framework";

    private CommandsInterface[] mCis;
    private UiccCard[] mUiccCards = new UiccCard[TelephonyManager.getDefault().getPhoneCount()];

@@ -125,12 +123,11 @@ public class UiccController extends Handler {
            Integer index = new Integer(i);
            mCis[i].registerForIccStatusChanged(this, EVENT_ICC_STATUS_CHANGED, index);
            // TODO remove this once modem correctly notifies the unsols
            // If the device has been decrypted or FBE is supported, read SIM when radio state is
            // available.
            // If the device is unencrypted or has been decrypted or FBE is supported,
            // i.e. not in cryptkeeper bounce, read SIM when radio state isavailable.
            // Else wait for radio to be on. This is needed for the scenario when SIM is locked --
            // to avoid overlap of CryptKeeper and SIM unlock screen.
            if (DECRYPT_STATE.equals(SystemProperties.get("vold.decrypt")) ||
                    StorageManager.isFileEncryptedNativeOrEmulated()) {
            if (!StorageManager.inCryptKeeperBounce()) {
                mCis[i].registerForAvailable(this, EVENT_ICC_STATUS_CHANGED, index);
            } else {
                mCis[i].registerForOn(this, EVENT_ICC_STATUS_CHANGED, index);