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

Commit 8a6b0a41 authored by Ruthwar Kumar Ambeer's avatar Ruthwar Kumar Ambeer Committed by Linux Build Service Account
Browse files

Grey out PIN1 enable/disable option when SUB is not ready

Since it is not possible to interact with UICC card for
PIN1 enable/Disable when SIM is deactivated, PIN1 option
is Disabled in UI.

Change-Id: I64d2ad3a85c15c4ea8936987e384ffd013c1f533
CRs-Fixed: 662114
parent 23c6b886
Loading
Loading
Loading
Loading
+13 −3
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ import android.widget.TabHost.TabSpec;
import android.widget.TabWidget;
import android.widget.Toast;
import com.android.internal.logging.MetricsProto.MetricsEvent;
import com.android.internal.telephony.IccCardConstants.State;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneFactory;
import com.android.internal.telephony.TelephonyIntents;
@@ -247,11 +248,20 @@ public class IccLockSettings extends SettingsPreferenceFragment
    }

    private void updatePreferences() {
        mPinDialog.setEnabled(mPhone != null);
        mPinToggle.setEnabled(mPhone != null);

        if (mPhone != null) {
            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 greyout PIN options.
                mPinToggle.setEnabled(false);
                mPinDialog.setEnabled(false);
            } else {
                mPinToggle.setEnabled(true);
                mPinDialog.setEnabled(true);
            }
            mPinToggle.setChecked(mPhone.getIccCard().getIccLockEnabled());
        } else {
            mPinDialog.setEnabled(false);
            mPinToggle.setEnabled(false);
        }
    }