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

Commit 8b85fbfe authored by Andres Morales's avatar Andres Morales
Browse files

fix issue when cancelling OEM unlocking change

Bug: 26928752
Change-Id: Ibafe9df564f1035cbd6782d8982bc3b424ee3cb4
parent 08331aca
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -1702,10 +1702,18 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
    }

    private void confirmEnableOemUnlock() {
        DialogInterface.OnClickListener onConfirmListener = new DialogInterface.OnClickListener() {
        DialogInterface.OnClickListener onClickListener = new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                if (which == DialogInterface.BUTTON_POSITIVE) {
                    Utils.setOemUnlockEnabled(getActivity(), true);
                }
            }
        };

        DialogInterface.OnDismissListener onDismissListener = new DialogInterface.OnDismissListener() {
            @Override
            public void onDismiss(DialogInterface dialog) {
                updateAllOptions();
            }
        };
@@ -1713,8 +1721,9 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
        new AlertDialog.Builder(getActivity())
                .setTitle(R.string.confirm_enable_oem_unlock_title)
                .setMessage(R.string.confirm_enable_oem_unlock_text)
                .setPositiveButton(R.string.enable_text, onConfirmListener)
                .setPositiveButton(R.string.enable_text, onClickListener)
                .setNegativeButton(android.R.string.cancel, null)
                .setOnDismissListener(onDismissListener)
                .create()
                .show();
    }