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

Commit 42dff0f3 authored by Daniel Hillenbrand's avatar Daniel Hillenbrand Committed by Gerrit Code Review
Browse files

Merge "Lockscreen : Quick / menu unlock" into jellybean

parents f035be5c b81413f3
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ import android.util.Slog;
import android.media.AudioManager;
import android.os.RemoteException;
import android.provider.MediaStore;
import android.provider.Settings;

import java.io.File;

@@ -427,7 +428,8 @@ class LockScreen extends LinearLayout implements KeyguardScreen {
        final boolean configDisabled = res.getBoolean(R.bool.config_disableMenuKeyInLockScreen);
        final boolean isTestHarness = ActivityManager.isRunningInTestHarness();
        final boolean fileOverride = (new File(ENABLE_MENU_KEY_FILE)).exists();
        return !configDisabled || isTestHarness || fileOverride;
        final boolean menuOverride = Settings.System.getInt(getContext().getContentResolver(), Settings.System.MENU_UNLOCK_SCREEN, 0) == 1;
        return !configDisabled || isTestHarness || fileOverride || menuOverride;
    }

    /**
+13 −3
Original line number Diff line number Diff line
@@ -35,18 +35,15 @@ import android.text.InputType;
import android.text.TextWatcher;
import android.text.method.DigitsKeyListener;
import android.text.method.TextKeyListener;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputMethodInfo;
import android.view.inputmethod.InputMethodManager;
import android.view.inputmethod.InputMethodSubtype;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.Space;
import android.widget.TextView;
import android.widget.TextView.OnEditorActionListener;

@@ -76,6 +73,7 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen

    private final KeyguardStatusViewManager mStatusViewManager;
    private final boolean mUseSystemIME = true; // TODO: Make configurable
    private boolean mQuickUnlock;
    private boolean mResuming; // used to prevent poking the wakelock during onResume()

    // To avoid accidental lockout due to events while the device in in the pocket, ignore
@@ -163,6 +161,10 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen
                mCallback.pokeWakelock();
            }
        });

        mQuickUnlock = (Settings.System.getInt(mContext.getContentResolver(),
                Settings.System.LOCKSCREEN_QUICK_UNLOCK_CONTROL, 0) == 1);

        mPasswordEntry.addTextChangedListener(new TextWatcher() {
            public void onTextChanged(CharSequence s, int start, int before, int count) {
            }
@@ -174,6 +176,14 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen
                if (!mResuming) {
                    mCallback.pokeWakelock();
                }
                if (mQuickUnlock) {
                    String entry = mPasswordEntry.getText().toString();
                    if (entry.length() > MINIMUM_PASSWORD_LENGTH_BEFORE_REPORT &&
                            mLockPatternUtils.checkPassword(entry)) {
                            mCallback.keyguardDone(true);
                            mCallback.reportSuccessfulUnlockAttempt();
                    }
                }
            }
        });