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

Commit b873ee2b authored by Danny Baumann's avatar Danny Baumann
Browse files

Back out persistent storage of lock screen disable state.

This also disables the SIM PIN entry screen, which is an unwanted
behaviour change that should be avoided before release.
parent 3e50c9c1
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -6,7 +6,6 @@ import android.app.KeyguardManager;
import android.app.KeyguardManager.KeyguardLock;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.view.View;

public class LockScreenButton extends PowerButton {
@@ -36,20 +35,13 @@ public class LockScreenButton extends PowerButton {
            mLock.reenableKeyguard();
            mLock = null;
        } else if (view != null) {
            Context context = view.getContext();
            mDisabledLockscreen = getPreferences(context).getBoolean(KEY_DISABLED, false);
            applyState(context);
            applyState(view.getContext());
        }
    }

    @Override
    protected void toggleState(Context context) {
        mDisabledLockscreen = !mDisabledLockscreen;

        SharedPreferences.Editor editor = getPreferences(context).edit();
        editor.putBoolean(KEY_DISABLED, mDisabledLockscreen);
        editor.apply();

        applyState(context);
    }

+0 −5
Original line number Diff line number Diff line
@@ -6,7 +6,6 @@ import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.graphics.PorterDuff.Mode;
@@ -178,8 +177,4 @@ public abstract class PowerButton {
    void setExternalLongClickListener(View.OnLongClickListener listener) {
        mExternalLongClickListener = listener;
    }

    protected SharedPreferences getPreferences(Context context) {
        return context.getSharedPreferences("PowerButton-" + mType, Context.MODE_PRIVATE);
    }
}