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

Commit e08bfc51 authored by Abhisek Devkota's avatar Abhisek Devkota Committed by Gerrit Code Review
Browse files

Merge "Settings: Only disable menu unlock options with custom keyguard" into cm-11.0

parents ac59a304 1c5f27fe
Loading
Loading
Loading
Loading
+16 −3
Original line number Diff line number Diff line
@@ -149,9 +149,23 @@ public class LockscreenButtons extends SettingsPreferenceFragment
    }

    private void updateUnlockButtonTypes() {
        boolean secure = new LockPatternUtils(getActivity()).isSecure();
        boolean canEnableModLockscreen = false;
        final Bundle keyguard_metadata = Utils.getApplicationMetadata(
                getActivity(), "com.android.keyguard");
        if (keyguard_metadata != null) {
            canEnableModLockscreen = keyguard_metadata.getBoolean(
                    "com.cyanogenmod.keyguard", false);
        }
        if (!canEnableModLockscreen) {
            // only applicable to mod lockscreen
            return;
        }

        if (secure) {
        boolean secure = new LockPatternUtils(getActivity()).isSecure();
        boolean customKeyguardEnabled = Settings.System.getInt(
                getActivity().getContentResolver(),
                Settings.System.LOCKSCREEN_MODLOCK_ENABLED, 1) == 1;
        if (secure && customKeyguardEnabled) {
            mHomeUnlock.setEnabled(false);
            mCameraUnlock.setEnabled(false);
            mMenuUnlock.setEnabled(false);
@@ -161,7 +175,6 @@ public class LockscreenButtons extends SettingsPreferenceFragment
            mCameraUnlock.setSummary(disabled);
            mMenuUnlock.setSummary(disabled);
        }

    }

    private void updateEntry(ListPreference pref) {