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

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

Merge "GPay activity can use passive biometric auth" into sc-dev am: 2fa8f9b3

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

Change-Id: I02d21bedc91e6dd6856ebda36f4ab7a6ac75b6e6
parents 5836d720 2fa8f9b3
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -12,6 +12,7 @@ data class KeyguardFaceListenModel(
    val isListeningForFace: Boolean,
    val isListeningForFace: Boolean,
    val isBouncer: Boolean,
    val isBouncer: Boolean,
    val isAuthInterruptActive: Boolean,
    val isAuthInterruptActive: Boolean,
    val isOccludingAppRequestingFaceAuth: Boolean,
    val isKeyguardAwake: Boolean,
    val isKeyguardAwake: Boolean,
    val isListeningForFaceAssistant: Boolean,
    val isListeningForFaceAssistant: Boolean,
    val isSwitchingUser: Boolean,
    val isSwitchingUser: Boolean,
+39 −10
Original line number Original line Diff line number Diff line
@@ -276,6 +276,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
    private boolean mHasLockscreenWallpaper;
    private boolean mHasLockscreenWallpaper;
    private boolean mAssistantVisible;
    private boolean mAssistantVisible;
    private boolean mKeyguardOccluded;
    private boolean mKeyguardOccluded;
    private boolean mOccludingAppRequestingFp;
    private boolean mOccludingAppRequestingFace;
    private boolean mSecureCameraLaunched;
    private boolean mSecureCameraLaunched;
    @VisibleForTesting
    @VisibleForTesting
    protected boolean mTelephonyCapable;
    protected boolean mTelephonyCapable;
@@ -587,6 +589,29 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
        updateBiometricListeningState();
        updateBiometricListeningState();
    }
    }



    /**
     * Request to listen for face authentication when an app is occluding keyguard.
     * @param request if true and mKeyguardOccluded, request face auth listening, else default
     *                to normal behavior.
     *                See {@link KeyguardUpdateMonitor#shouldListenForFace()}
     */
    public void requestFaceAuthOnOccludingApp(boolean request) {
        mOccludingAppRequestingFace = request;
        updateFaceListeningState();
    }

    /**
     * Request to listen for fingerprint when an app is occluding keyguard.
     * @param request if true and mKeyguardOccluded, request fingerprint listening, else default
     *                to normal behavior.
     *                See {@link KeyguardUpdateMonitor#shouldListenForFingerprint(boolean)}
     */
    public void requestFingerprintAuthOnOccludingApp(boolean request) {
        mOccludingAppRequestingFp = request;
        updateFingerprintListeningState();
    }

    /**
    /**
     * Invoked when the secure camera is launched.
     * Invoked when the secure camera is launched.
     */
     */
@@ -2093,6 +2118,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab


    @VisibleForTesting
    @VisibleForTesting
    protected boolean shouldListenForFingerprint(boolean isUdfps) {
    protected boolean shouldListenForFingerprint(boolean isUdfps) {
        final boolean userDoesNotHaveTrust = !getUserHasTrust(getCurrentUser());
        final boolean shouldListenKeyguardState =
        final boolean shouldListenKeyguardState =
                mKeyguardIsVisible
                mKeyguardIsVisible
                        || !mDeviceInteractive
                        || !mDeviceInteractive
@@ -2100,7 +2126,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
                        || mGoingToSleep
                        || mGoingToSleep
                        || shouldListenForFingerprintAssistant()
                        || shouldListenForFingerprintAssistant()
                        || (mKeyguardOccluded && mIsDreaming)
                        || (mKeyguardOccluded && mIsDreaming)
                     || (isUdfps && mKeyguardOccluded);
                        || (mKeyguardOccluded && userDoesNotHaveTrust
                            && (mOccludingAppRequestingFp || isUdfps));


        // Only listen if this KeyguardUpdateMonitor belongs to the primary user. There is an
        // Only listen if this KeyguardUpdateMonitor belongs to the primary user. There is an
        // instance of KeyguardUpdateMonitor for each user but KeyguardUpdateMonitor is user-aware.
        // instance of KeyguardUpdateMonitor for each user but KeyguardUpdateMonitor is user-aware.
@@ -2117,7 +2144,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
        final boolean shouldListenUdfpsState = !isUdfps
        final boolean shouldListenUdfpsState = !isUdfps
                || (!getUserCanSkipBouncer(getCurrentUser())
                || (!getUserCanSkipBouncer(getCurrentUser())
                    && !isEncryptedOrLockdown(getCurrentUser())
                    && !isEncryptedOrLockdown(getCurrentUser())
                && mStrongAuthTracker.hasUserAuthenticatedSinceBoot());
                    && mStrongAuthTracker.hasUserAuthenticatedSinceBoot()
                    && userDoesNotHaveTrust);


        return shouldListenKeyguardState && shouldListenUserState && shouldListenBouncerState
        return shouldListenKeyguardState && shouldListenUserState && shouldListenBouncerState
                && shouldListenUdfpsState;
                && shouldListenUdfpsState;
@@ -2166,7 +2194,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
        // Only listen if this KeyguardUpdateMonitor belongs to the primary user. There is an
        // Only listen if this KeyguardUpdateMonitor belongs to the primary user. There is an
        // instance of KeyguardUpdateMonitor for each user but KeyguardUpdateMonitor is user-aware.
        // instance of KeyguardUpdateMonitor for each user but KeyguardUpdateMonitor is user-aware.
        final boolean shouldListen =
        final boolean shouldListen =
                (mBouncer || mAuthInterruptActive || awakeKeyguard
                (mBouncer || mAuthInterruptActive || mOccludingAppRequestingFace || awakeKeyguard
                        || shouldListenForFaceAssistant())
                        || shouldListenForFaceAssistant())
                && !mSwitchingUser && !isFaceDisabled(user) && becauseCannotSkipBouncer
                && !mSwitchingUser && !isFaceDisabled(user) && becauseCannotSkipBouncer
                && !mKeyguardGoingAway && mBiometricEnabledForUser.get(user) && !mLockIconPressed
                && !mKeyguardGoingAway && mBiometricEnabledForUser.get(user) && !mLockIconPressed
@@ -2181,6 +2209,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
                    shouldListen,
                    shouldListen,
                    mBouncer,
                    mBouncer,
                    mAuthInterruptActive,
                    mAuthInterruptActive,
                    mOccludingAppRequestingFace,
                    awakeKeyguard,
                    awakeKeyguard,
                    shouldListenForFaceAssistant(),
                    shouldListenForFaceAssistant(),
                    mSwitchingUser,
                    mSwitchingUser,
+2 −2
Original line number Original line Diff line number Diff line
@@ -169,7 +169,7 @@ public class UdfpsKeyguardViewController extends UdfpsAnimationViewController<Ud
            mView.announceForAccessibility(mView.getContext().getString(
            mView.announceForAccessibility(mView.getContext().getString(
                    R.string.accessibility_fingerprint_bouncer));
                    R.string.accessibility_fingerprint_bouncer));
        } else {
        } else {
            mView.animateAwayUdfpsBouncer(() -> mKeyguardViewManager.cancelPostAuthActions());
            mView.animateAwayUdfpsBouncer(null);
        }
        }
        return true;
        return true;
    }
    }
@@ -231,8 +231,8 @@ public class UdfpsKeyguardViewController extends UdfpsAnimationViewController<Ud
     */
     */
    private void maybeShowInputBouncer() {
    private void maybeShowInputBouncer() {
        if (mShowingUdfpsBouncer) {
        if (mShowingUdfpsBouncer) {
            mKeyguardViewManager.resetAlternateAuth(false);
            mKeyguardViewManager.showBouncer(true);
            mKeyguardViewManager.showBouncer(true);
            mKeyguardViewManager.resetAlternateAuth(false);
        }
        }
    }
    }


+2 −2
Original line number Original line Diff line number Diff line
@@ -428,7 +428,7 @@ public class MediaControlPanel {
                    mMediaDataManagerLazy.get().dismissMediaData(mKey,
                    mMediaDataManagerLazy.get().dismissMediaData(mKey,
                            MediaViewController.GUTS_ANIMATION_DURATION + 100);
                            MediaViewController.GUTS_ANIMATION_DURATION + 100);
                    return true;
                    return true;
                }, /* requiresShadeOpen */ true);
                }, /* requiresShadeOpen */ true, false);
            } else {
            } else {
                Log.w(TAG, "Dismiss media with null notification. Token uid="
                Log.w(TAG, "Dismiss media with null notification. Token uid="
                        + data.getToken().getUid());
                        + data.getToken().getUid());
@@ -564,7 +564,7 @@ public class MediaControlPanel {
                mMediaDataManagerLazy.get().dismissSmartspaceRecommendation(
                mMediaDataManagerLazy.get().dismissSmartspaceRecommendation(
                        MediaViewController.GUTS_ANIMATION_DURATION + 100L);
                        MediaViewController.GUTS_ANIMATION_DURATION + 100L);
                return true;
                return true;
            }, true /* requiresShadeOpen */);
            }, true /* requiresShadeOpen */, false);
        });
        });


        mController = null;
        mController = null;
+1 −1
Original line number Original line Diff line number Diff line
@@ -142,7 +142,7 @@ public class ScreenRecordTile extends QSTileImpl<QSTile.BooleanState>
            mHost.getUserContext().startActivity(intent);
            mHost.getUserContext().startActivity(intent);
            return false;
            return false;
        };
        };
        mKeyguardDismissUtil.executeWhenUnlocked(dismissAction, false);
        mKeyguardDismissUtil.executeWhenUnlocked(dismissAction, false, false);
    }
    }


    private void cancelCountdown() {
    private void cancelCountdown() {
Loading