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

Commit e2ddaa2e authored by Beverly's avatar Beverly
Browse files

GPay activity can use passive biometric auth

- User can face authenticate immediately after tapping the gpay icon on
the LS
- User can use rear fp sensor to authenticate while the GPay activity
from LS is showing
- Update udfps bouncer logic so that longpress on a notification works
with udfps
- Never listen for UDFPS on the keyguard if the device already has trust

Test: atest SystemUITests
Test: atest KeyguardUpdateMonitorTest
Test: manual (unlock with and withou biometric on notification, shade,
bouncer, gpay surfaces)
Fixes: 187020022
Fixes: 183112863
Bug: 183024921
Bug: 185433347

Change-Id: I47aa58505535267c56b88c021791066c36a6c717
parent 357a7d7b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ data class KeyguardFaceListenModel(
    val isListeningForFace: Boolean,
    val isBouncer: Boolean,
    val isAuthInterruptActive: Boolean,
    val isOccludingAppRequestingFaceAuth: Boolean,
    val isKeyguardAwake: Boolean,
    val isListeningForFaceAssistant: Boolean,
    val isSwitchingUser: Boolean,
+39 −10
Original line number Diff line number Diff line
@@ -276,6 +276,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
    private boolean mHasLockscreenWallpaper;
    private boolean mAssistantVisible;
    private boolean mKeyguardOccluded;
    private boolean mOccludingAppRequestingFp;
    private boolean mOccludingAppRequestingFace;
    private boolean mSecureCameraLaunched;
    @VisibleForTesting
    protected boolean mTelephonyCapable;
@@ -587,6 +589,29 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
        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.
     */
@@ -2093,6 +2118,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab

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

        // Only listen if this KeyguardUpdateMonitor belongs to the primary user. There is an
        // 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
                || (!getUserCanSkipBouncer(getCurrentUser())
                    && !isEncryptedOrLockdown(getCurrentUser())
                && mStrongAuthTracker.hasUserAuthenticatedSinceBoot());
                    && mStrongAuthTracker.hasUserAuthenticatedSinceBoot()
                    && userDoesNotHaveTrust);

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

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

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

    private void cancelCountdown() {
Loading