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

Commit 4af8f6b6 authored by Rakesh Pallerla's avatar Rakesh Pallerla Committed by Gerrit - the friendly Code Review server
Browse files

Telephony(MSIM): Disable PIN1 option when SUB is not READY.

When Subscription in not in Ready state, it is not possible to
interact with uicc app for enabling/disabling the PIN1.

So disable the PIN1 options when sub is not in READY state

Change-Id: I0b17fce2d22f9d77618e5303a4b89e83d34cbb63
CRs-Fixed: 662114
parent b844814a
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -36,6 +36,8 @@ import android.widget.Toast;
import com.android.internal.telephony.CommandException;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneFactory;
import com.android.internal.telephony.CommandException;
import com.android.internal.telephony.IccCardConstants.State;
import com.android.internal.telephony.TelephonyIntents;

/**
@@ -124,13 +126,18 @@ public class IccLockSettings extends PreferenceActivity
        public void onReceive(Context context, Intent intent) {
            final String action = intent.getAction();
            if (TelephonyIntents.ACTION_SIM_STATE_CHANGED.equals(action)) {
                if (mPhone.getIccCard().getState() != State.READY) {
                    //if Sim State is not READY, it is not possible to interact with uicc app
                    //for enabling/disabling PIN so disable PIN options.
                    mPinToggle.setEnabled(false);
                    mPinDialog.setEnabled(false);
                    if (mPhone.getIccCard().getState().isPinLocked()) {
                    //Code control lands up here only if user pressed cancel for PIN unlock.
                    //So disable the pin toggle option as card is in LOCKED state.
                        //sim is PIN locked so mark it as selected.
                        mPinToggle.setChecked(true);
                    mPinToggle.setEnabled(false);
                    }
                } else {
                    mPinToggle.setEnabled(true);
                    mPinDialog.setEnabled(true);
                    mHandler.sendMessage(mHandler.obtainMessage(MSG_SIM_STATE_CHANGED));
                }
            }