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

Commit 142848fe authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5682183 from df1e8c9c to qt-c2f2-release

Change-Id: I1711f2f0f7e1923a7a012e910ae4a87f1be30bd0
parents 32721db7 df1e8c9c
Loading
Loading
Loading
Loading
+23 −19
Original line number Diff line number Diff line
@@ -83,16 +83,10 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback {
     */
    public static final int MODE_UNLOCK = 5;

    /**
     * Mode in which fingerprint brings up the bouncer because fingerprint unlocking is currently
     * not allowed.
     */
    public static final int MODE_DISMISS_BOUNCER = 6;

    /**
     * Mode in which fingerprint wakes and unlocks the device from a dream.
     */
    public static final int MODE_WAKE_AND_UNLOCK_FROM_DREAM = 7;
    public static final int MODE_WAKE_AND_UNLOCK_FROM_DREAM = 6;

    /**
     * How much faster we collapse the lockscreen when authenticating with biometric.
@@ -283,15 +277,18 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback {
            wakeUp.run();
        }
        switch (mMode) {
            case MODE_DISMISS_BOUNCER:
                Trace.beginSection("MODE_DISMISS");
            case MODE_UNLOCK:
                Trace.beginSection("MODE_UNLOCK");
                if (!wasDeviceInteractive) {
                    mPendingShowBouncer = true;
                } else {
                    mStatusBarKeyguardViewManager.notifyKeyguardAuthenticated(
                            false /* strongAuth */);
                }
                Trace.endSection();
                break;
            case MODE_UNLOCK:
            case MODE_SHOW_BOUNCER:
                Trace.beginSection("MODE_UNLOCK or MODE_SHOW_BOUNCER");
                Trace.beginSection("MODE_SHOW_BOUNCER");
                if (!wasDeviceInteractive) {
                    mPendingShowBouncer = true;
                } else {
@@ -381,6 +378,8 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback {
            if (!mStatusBarKeyguardViewManager.isShowing()) {
                return MODE_ONLY_WAKE;
            } else if (mDozeScrimController.isPulsing() && unlockingAllowed) {
                // Let's not wake-up to lock screen when not bypassing, otherwise the notification
                // would move as the user tried to tap it.
                return faceStayingOnKeyguard ? MODE_NONE : MODE_WAKE_AND_UNLOCK_PULSING;
            } else if (!face && (unlockingAllowed || !mUnlockMethodCache.isMethodSecure())) {
                return MODE_WAKE_AND_UNLOCK;
@@ -388,9 +387,15 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback {
                if (!(mDozeScrimController.isPulsing() && !unlockingAllowed)) {
                    Log.wtf(TAG, "Face somehow arrived when the device was not interactive");
                }
                if (faceStayingOnKeyguard) {
                    // We could theoretically return MODE_NONE, but this means that the device
                // would be not interactive, unlocked, and the user would not see the device state.
                    // would be not interactive, unlocked, and the user would not see the device
                    // state.
                    return MODE_ONLY_WAKE;
                } else {
                    // Wake-up fading out nicely
                    return MODE_WAKE_AND_UNLOCK_PULSING;
                }
            } else {
                return MODE_SHOW_BOUNCER;
            }
@@ -399,10 +404,9 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback {
            return MODE_WAKE_AND_UNLOCK_FROM_DREAM;
        }
        if (mStatusBarKeyguardViewManager.isShowing()) {
            if ((mStatusBarKeyguardViewManager.isBouncerShowing()
                    || mStatusBarKeyguardViewManager.isBouncerPartiallyVisible())
            if ((mStatusBarKeyguardViewManager.isBouncerShowing())
                    && unlockingAllowed) {
                return MODE_DISMISS_BOUNCER;
                return MODE_UNLOCK;
            } else if (unlockingAllowed) {
                return faceStayingOnKeyguard ? MODE_ONLY_WAKE : MODE_UNLOCK;
            } else if (face) {
+8 −0
Original line number Diff line number Diff line
@@ -84,6 +84,14 @@ public class DozeScrimController implements StateListener {
        public void onCancelled() {
            pulseFinished();
        }

        /**
         * Whether to timeout wallpaper or not.
         */
        @Override
        public boolean shouldTimeoutWallpaper() {
            return mPulseReason == DozeLog.PULSE_REASON_DOCKING;
        }
    };

    public DozeScrimController(DozeParameters dozeParameters) {
+0 −5
Original line number Diff line number Diff line
@@ -345,11 +345,6 @@ public class KeyguardBouncer {
                && mExpansion == EXPANSION_VISIBLE && !isAnimatingAway();
    }

    public boolean isPartiallyVisible() {
        return (mShowingSoon || (mRoot != null && mRoot.getVisibility() == View.VISIBLE))
                && mExpansion != EXPANSION_HIDDEN && !isAnimatingAway();
    }

    /**
     * @return {@code true} when bouncer's pre-hide animation already started but isn't completely
     *         hidden yet, {@code false} otherwise.
+2 −1
Original line number Diff line number Diff line
@@ -452,7 +452,8 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange

    private int getState() {
        KeyguardUpdateMonitor updateMonitor = KeyguardUpdateMonitor.getInstance(mContext);
        if ((mUnlockMethodCache.canSkipBouncer() || !mKeyguardShowing) && !mSimLocked) {
        if ((mUnlockMethodCache.canSkipBouncer() || !mKeyguardShowing
                || mKeyguardMonitor.isKeyguardGoingAway()) && !mSimLocked) {
            return STATE_LOCK_OPEN;
        } else if (mTransientBiometricsError) {
            return STATE_BIOMETRICS_ERROR;
+33 −7
Original line number Diff line number Diff line
@@ -284,15 +284,12 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo

        // AOD wallpapers should fade away after a while.
        // Docking pulses may take a long time, wallpapers should also fade away after a while.
        if (mWallpaperSupportsAmbientMode && mDozeParameters.getAlwaysOn()
                && mState == ScrimState.AOD) {
            if (!mWallpaperVisibilityTimedOut) {
        mWallpaperVisibilityTimedOut = false;
        if (shouldFadeAwayWallpaper()) {
            mTimeTicker.schedule(mDozeParameters.getWallpaperAodDuration(),
                    AlarmTimeout.MODE_IGNORE_IF_SCHEDULED);
            }
        } else {
            mTimeTicker.cancel();
            mWallpaperVisibilityTimedOut = false;
        }

        if (mKeyguardUpdateMonitor.needsSlowUnlockTransition() && mState == ScrimState.UNLOCKED) {
@@ -313,6 +310,23 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
        dispatchScrimState(mScrimBehind.getViewAlpha());
    }

    private boolean shouldFadeAwayWallpaper() {
        if (!mWallpaperSupportsAmbientMode) {
            return false;
        }

        if (mState == ScrimState.AOD && mDozeParameters.getAlwaysOn()) {
            return true;
        }

        if (mState == ScrimState.PULSING
                && mCallback != null && mCallback.shouldTimeoutWallpaper()) {
            return true;
        }

        return false;
    }

    public ScrimState getState() {
        return mState;
    }
@@ -387,6 +401,14 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
            setOrAdaptCurrentAnimation(mScrimInFront);

            dispatchScrimState(mScrimBehind.getViewAlpha());

            // Reset wallpaper timeout if it's already timeout like expanding panel while PULSING
            // and docking.
            if (mWallpaperVisibilityTimedOut) {
                mWallpaperVisibilityTimedOut = false;
                mTimeTicker.schedule(mDozeParameters.getWallpaperAodDuration(),
                        AlarmTimeout.MODE_IGNORE_IF_SCHEDULED);
            }
        }
    }

@@ -925,6 +947,10 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
        }
        default void onCancelled() {
        }
        /** Returns whether to timeout wallpaper or not. */
        default boolean shouldTimeoutWallpaper() {
            return false;
        }
    }

    /**
Loading