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

Commit 44f0bb28 authored by Pawit Pornkitprasan's avatar Pawit Pornkitprasan Committed by Steve Kondik
Browse files

UiccController: use registerForAvailable only when persist.radio.apm_sim_not_pwdn is enabled

Some QCOM RILs allow the SIM to be loaded in airplane mode, thus
CAF changed the callback to registerForAvailable, but that does
not work on other RILs where the SIM information will not be
loaded successfully.

Change-Id: I9f9124417db2fe983e716a2825fc08d87511f8aa
parent 12514057
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.os.Handler;
import android.os.Message;
import android.os.Registrant;
import android.os.RegistrantList;
import android.os.SystemProperties;
import android.telephony.TelephonyManager;
import android.telephony.Rlog;

@@ -124,11 +125,17 @@ public class UiccController extends Handler {
                com.android.internal.R.bool.config_sim_refresh_for_dual_mode_card);
        for (int i = 0; i < mCis.length; i++) {
            Integer index = new Integer(i);
            if (SystemProperties.getBoolean("persist.radio.apm_sim_not_pwdn", false)) {
                // Reading ICC status in airplane mode is only supported in QCOM
                // RILs when this property is set to true
                mCis[i].registerForAvailable(this, EVENT_ICC_STATUS_CHANGED, index);
            } else {
                mCis[i].registerForOn(this, EVENT_ICC_STATUS_CHANGED, index);
            }

            mCis[i].registerForIccStatusChanged(this, EVENT_ICC_STATUS_CHANGED, index);
            // TODO remove this once modem correctly notifies the unsols
            mCis[i].registerForAvailable(this, EVENT_ICC_STATUS_CHANGED, index);
            mCis[i].registerForNotAvailable(this, EVENT_RADIO_UNAVAILABLE, index);
            mCis[i].registerForOn(this, EVENT_ICC_STATUS_CHANGED, index);
            if (mOEMHookSimRefresh) {
                mCis[i].registerForSimRefreshEvent(this, EVENT_REFRESH_OEM, index);
            } else {