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

Commit 5e0ebe87 authored by Beverly Tai's avatar Beverly Tai Committed by Automerger Merge Worker
Browse files

Merge "Allow bypass + show errors on alt bouncer" into sc-dev am: 14fe9345 am: 74dd644f

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15225636

Change-Id: I232b60ca31394dbec2a8ea8dc61b8dbfd72d4e61
parents 42c8eaad 74dd644f
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ public class KeyguardMessageArea extends TextView implements SecurityMessageDisp
    private CharSequence mMessage;
    private ColorStateList mNextMessageColorState = ColorStateList.valueOf(DEFAULT_COLOR);
    private boolean mBouncerVisible;
    private boolean mAltBouncerShowing;

    public KeyguardMessageArea(Context context, AttributeSet attrs) {
        super(context, attrs);
@@ -144,7 +145,8 @@ public class KeyguardMessageArea extends TextView implements SecurityMessageDisp

    void update() {
        CharSequence status = mMessage;
        setVisibility(TextUtils.isEmpty(status) || !mBouncerVisible ? INVISIBLE : VISIBLE);
        setVisibility(TextUtils.isEmpty(status) || (!mBouncerVisible && !mAltBouncerShowing)
                ? INVISIBLE : VISIBLE);
        setText(status);
        ColorStateList colorState = mDefaultColorState;
        if (mNextMessageColorState.getDefaultColor() != DEFAULT_COLOR) {
@@ -158,6 +160,16 @@ public class KeyguardMessageArea extends TextView implements SecurityMessageDisp
        mBouncerVisible = bouncerVisible;
    }

    /**
     * Set whether the alt bouncer is showing
     */
    void setAltBouncerShowing(boolean showing) {
        if (mAltBouncerShowing != showing) {
            mAltBouncerShowing = showing;
            update();
        }
    }

    /**
     * Runnable used to delay accessibility announcements.
     */
+8 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ import javax.inject.Inject;
public class KeyguardMessageAreaController extends ViewController<KeyguardMessageArea> {
    private final KeyguardUpdateMonitor mKeyguardUpdateMonitor;
    private final ConfigurationController mConfigurationController;

    private boolean mAltBouncerShowing;

    private KeyguardUpdateMonitorCallback mInfoCallback = new KeyguardUpdateMonitorCallback() {
        public void onFinishedGoingToSleep(int why) {
@@ -81,6 +81,13 @@ public class KeyguardMessageAreaController extends ViewController<KeyguardMessag
        mKeyguardUpdateMonitor.removeCallback(mInfoCallback);
    }

    /**
     * Set whether alt bouncer is showing
     */
    public void setAltBouncerShowing(boolean showing) {
        mView.setAltBouncerShowing(showing);
    }

    public void setMessage(CharSequence s) {
        mView.setMessage(s);
    }
+11 −2
Original line number Diff line number Diff line
@@ -797,8 +797,12 @@ public class KeyguardIndicationController implements KeyguardStateController.Cal
        }

        if (mStatusBarKeyguardViewManager.isBouncerShowing()) {
            if (mStatusBarKeyguardViewManager.isShowingAlternateAuth()) {
                return; // udfps affordance is highlighted, no need to surface face auth error
            } else {
                String message = mContext.getString(R.string.keyguard_retry);
                mStatusBarKeyguardViewManager.showBouncerMessage(message, mInitialTextColorState);
            }
        } else if (mKeyguardUpdateMonitor.isScreenOn()) {
            showTransientIndication(mContext.getString(R.string.keyguard_unlock),
                    false /* isError */, true /* hideOnScreenOff */);
@@ -922,6 +926,11 @@ public class KeyguardIndicationController implements KeyguardStateController.Cal
                        && mKeyguardUpdateMonitor.isFingerprintDetectionRunning()) {
                    // suggest trying fingerprint
                    showTransientIndication(R.string.keyguard_try_fingerprint);
                } else if (mStatusBarKeyguardViewManager.isShowingAlternateAuth()) {
                    mStatusBarKeyguardViewManager.showBouncerMessage(
                            mContext.getResources().getString(R.string.keyguard_try_fingerprint),
                            mInitialTextColorState
                    );
                } else {
                    // suggest swiping up to unlock (try face auth again or swipe up to bouncer)
                    showSwipeUpToUnlock();
+2 −1
Original line number Diff line number Diff line
@@ -588,7 +588,8 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp
            return MODE_UNLOCK_COLLAPSING;
        }
        if (mKeyguardViewController.isShowing()) {
            if (mKeyguardViewController.bouncerIsOrWillBeShowing() && unlockingAllowed) {
            if ((mKeyguardViewController.bouncerIsOrWillBeShowing()
                    || mKeyguardBypassController.getAltBouncerShowing()) && unlockingAllowed) {
                if (bypass && mKeyguardBypassController.canPlaySubtleWindowAnimations()) {
                    return MODE_UNLOCK_FADING;
                } else {
+3 −0
Original line number Diff line number Diff line
@@ -82,6 +82,7 @@ open class KeyguardBypassController : Dumpable {
        private set

    var bouncerShowing: Boolean = false
    var altBouncerShowing: Boolean = false
    var launchingAffordance: Boolean = false
    var qSExpanded = false
        set(value) {
@@ -172,6 +173,7 @@ open class KeyguardBypassController : Dumpable {
        if (bypassEnabled) {
            return when {
                bouncerShowing -> true
                altBouncerShowing -> true
                statusBarStateController.state != StatusBarState.KEYGUARD -> false
                launchingAffordance -> false
                isPulseExpanding || qSExpanded -> false
@@ -210,6 +212,7 @@ open class KeyguardBypassController : Dumpable {
        pw.println("  bypassEnabled: $bypassEnabled")
        pw.println("  canBypass: ${canBypass()}")
        pw.println("  bouncerShowing: $bouncerShowing")
        pw.println("  altBouncerShowing: $altBouncerShowing")
        pw.println("  isPulseExpanding: $isPulseExpanding")
        pw.println("  launchingAffordance: $launchingAffordance")
        pw.println("  qSExpanded: $qSExpanded")
Loading