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

Commit 09881f2e authored by DvTonder's avatar DvTonder
Browse files

Framework: Add missing part of 'Lock before unlock'

Keyguard: Turn lock-before-unlock into a user-configurable setting

Showing the unsecured lock screen (Slider/widget screen) before the
security screen is now a secure Setting (still defaulting to off)

Change-Id: I0a11f82ffe074d289129b2b972ffc0135eea81ed

Other parts were merged already
parent f6f2e58a
Loading
Loading
Loading
Loading
+16 −13
Original line number Diff line number Diff line
@@ -16,16 +16,6 @@

package com.android.internal.policy.impl;

import com.android.internal.R;
import com.android.internal.policy.impl.KeyguardUpdateMonitor.InfoCallback;
import com.android.internal.policy.impl.KeyguardUpdateMonitor.InfoCallbackImpl;
import com.android.internal.policy.impl.LockPatternKeyguardView.UnlockMode;
import com.android.internal.telephony.IccCard;
import com.android.internal.widget.LockPatternUtils;
import com.android.internal.widget.LockScreenWidgetCallback;
import com.android.internal.widget.LockScreenWidgetInterface;
import com.android.internal.widget.TransportControlView;

import android.accounts.Account;
import android.accounts.AccountManager;
import android.accounts.AccountManagerCallback;
@@ -40,16 +30,15 @@ import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.PixelFormat;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Parcelable;
import android.os.PowerManager;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.provider.Settings;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.Log;
@@ -60,6 +49,13 @@ import android.view.View;
import android.view.WindowManager;
import android.view.accessibility.AccessibilityManager;

import com.android.internal.R;
import com.android.internal.policy.impl.KeyguardUpdateMonitor.InfoCallbackImpl;
import com.android.internal.telephony.IccCard;
import com.android.internal.widget.LockPatternUtils;
import com.android.internal.widget.LockScreenWidgetCallback;
import com.android.internal.widget.TransportControlView;

import java.io.IOException;


@@ -683,7 +679,9 @@ public class LockPatternKeyguardView extends KeyguardViewBase {

    protected void onConfigurationChanged(Configuration newConfig) {
        Resources resources = getResources();
        mShowLockBeforeUnlock = resources.getBoolean(R.bool.config_enableLockBeforeUnlockScreen);
        mShowLockBeforeUnlock = resources.getBoolean(R.bool.config_enableLockBeforeUnlockScreen) ||
                        (Settings.Secure.getInt(mContext.getContentResolver(),
                        Settings.Secure.LOCK_BEFORE_UNLOCK, 0) != 0);
        mConfiguration = newConfig;
        if (DEBUG_CONFIGURATION) Log.v(TAG, "**** re-creating lock screen since config changed");
        saveWidgetState();
@@ -1045,6 +1043,11 @@ public class LockPatternKeyguardView extends KeyguardViewBase {
     */
    private Mode getInitialMode() {
        final IccCard.State simState = mUpdateMonitor.getSimState();

        mShowLockBeforeUnlock = mContext.getResources().getBoolean(R.bool.config_enableLockBeforeUnlockScreen) ||
                        (Settings.Secure.getInt(mContext.getContentResolver(),
                        Settings.Secure.LOCK_BEFORE_UNLOCK, 0) != 0);

        if (stuckOnLockScreenBecauseSimMissing() ||
                (simState == IccCard.State.PUK_REQUIRED &&
                        !mLockPatternUtils.isPukUnlockScreenEnable())) {