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

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

Merge "Stop checking StorageManager.inCryptKeeperBounce()"

parents 8f565e31 b8e3e2c4
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@ import android.os.Message;
import android.os.PowerManager;
import android.os.RegistrantList;
import android.os.SystemProperties;
import android.os.storage.StorageManager;
import android.sysprop.TelephonyProperties;
import android.telephony.PhoneCapability;
import android.telephony.SubscriptionManager;
@@ -113,11 +112,7 @@ public class PhoneConfigurationManager {
    }

    private void registerForRadioState(Phone phone) {
        if (!StorageManager.inCryptKeeperBounce()) {
        phone.mCi.registerForAvailable(mHandler, Phone.EVENT_RADIO_AVAILABLE, phone);
        } else {
            phone.mCi.registerForOn(mHandler, Phone.EVENT_RADIO_ON, phone);
        }
    }

    private PhoneCapability getDefaultCapability() {
+2 −13
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ import android.os.Handler;
import android.os.HandlerThread;
import android.os.Looper;
import android.os.Message;
import android.os.storage.StorageManager;
import android.util.ArraySet;
import android.util.Log;

@@ -42,7 +41,6 @@ public class RadioInterfaceCapabilityController extends Handler {
    private static RadioInterfaceCapabilityController sInstance;
    private final RadioConfig mRadioConfig;
    private final CommandsInterface mCommandsInterface;
    private final boolean mRegisterForOn;
    private Set<String> mRadioInterfaceCapabilities;
    private final Object mLockRadioInterfaceCapabilities = new Object();
    private static final int EVENT_GET_HAL_DEVICE_CAPABILITIES_DONE = 100;
@@ -83,7 +81,6 @@ public class RadioInterfaceCapabilityController extends Handler {
        super(looper);
        mRadioConfig = radioConfig;
        mCommandsInterface = commandsInterface;
        mRegisterForOn = StorageManager.inCryptKeeperBounce();
        register();
    }

@@ -147,20 +144,12 @@ public class RadioInterfaceCapabilityController extends Handler {
            return;
        }

        if (mRegisterForOn) {
            mCommandsInterface.registerForOn(this, Phone.EVENT_RADIO_ON, null);
        } else {
        mCommandsInterface.registerForAvailable(this, Phone.EVENT_RADIO_AVAILABLE, null);
    }
    }

    private void unregister() {
        if (mRegisterForOn) {
            mCommandsInterface.unregisterForOn(this);
        } else {
        mCommandsInterface.unregisterForAvailable(this);
    }
    }

    @Override
    public void handleMessage(final Message msg) {
+1 −19
Original line number Diff line number Diff line
@@ -34,7 +34,6 @@ import android.os.Handler;
import android.os.Message;
import android.os.Registrant;
import android.os.RegistrantList;
import android.os.storage.StorageManager;
import android.preference.PreferenceManager;
import android.sysprop.TelephonyProperties;
import android.telephony.CarrierConfigManager;
@@ -242,13 +241,7 @@ public class UiccController extends Handler {
        mRadioConfig.registerForSimSlotStatusChanged(this, EVENT_SLOT_STATUS_CHANGED, null);
        for (int i = 0; i < mCis.length; i++) {
            mCis[i].registerForIccStatusChanged(this, EVENT_ICC_STATUS_CHANGED, i);

            if (!StorageManager.inCryptKeeperBounce()) {
            mCis[i].registerForAvailable(this, EVENT_RADIO_AVAILABLE, i);
            } else {
                mCis[i].registerForOn(this, EVENT_RADIO_ON, i);
            }

            mCis[i].registerForNotAvailable(this, EVENT_RADIO_UNAVAILABLE, i);
            mCis[i].registerForIccRefresh(this, EVENT_SIM_REFRESH, i);
        }
@@ -622,18 +615,7 @@ public class UiccController extends Handler {
        for (int i = prevActiveModemCount; i < newActiveModemCount; i++) {
            mPhoneIdToSlotId[i] = INVALID_SLOT_ID;
            mCis[i].registerForIccStatusChanged(this, EVENT_ICC_STATUS_CHANGED, i);

            /*
             * To support FDE (deprecated), additional check is needed:
             *
             * if (!StorageManager.inCryptKeeperBounce()) {
             *     mCis[i].registerForAvailable(this, EVENT_RADIO_AVAILABLE, i);
             * } else {
             *     mCis[i].registerForOn(this, EVENT_RADIO_ON, i);
             * }
             */
            mCis[i].registerForAvailable(this, EVENT_RADIO_AVAILABLE, i);

            mCis[i].registerForNotAvailable(this, EVENT_RADIO_UNAVAILABLE, i);
            mCis[i].registerForIccRefresh(this, EVENT_SIM_REFRESH, i);
        }