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

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

Merge "Always allow UDFPS touches if alt bouncer is visible" into udc-qpr-dev...

Merge "Always allow UDFPS touches if alt bouncer is visible" into udc-qpr-dev am: 165af035 am: 9a46ce9d

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



Change-Id: I118029a5ab2459fe42ce1efd84f08b59ee599964
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents dafd8dcc 9a46ce9d
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -580,7 +580,9 @@ public class UdfpsController implements DozeReceiver, Dumpable {
                    + mOverlay.getRequestId());
            return false;
        }
        if (mLockscreenShadeTransitionController.getQSDragProgress() != 0f

        if ((mLockscreenShadeTransitionController.getQSDragProgress() != 0f
                && !mAlternateBouncerInteractor.isVisibleState())
                || mPrimaryBouncerInteractor.isInTransit()) {
            return false;
        }
+47 −0
Original line number Diff line number Diff line
@@ -1575,6 +1575,53 @@ public class UdfpsControllerTest extends SysuiTestCase {
                anyBoolean());
    }


    @Test
    public void onTouch_withNewTouchDetection_qsDrag_processesTouchWhenAlternateBouncerVisible()
            throws RemoteException {
        final NormalizedTouchData touchData = new NormalizedTouchData(0, 0f, 0f, 0f, 0f, 0f, 0L,
                0L);
        final TouchProcessorResult processorResultMove =
                new TouchProcessorResult.ProcessedTouch(InteractionEvent.DOWN,
                        1 /* pointerId */, touchData);

        // Enable new touch detection.
        when(mFeatureFlags.isEnabled(Flags.UDFPS_NEW_TOUCH_DETECTION)).thenReturn(true);

        // Configure UdfpsController to use FingerprintManager as opposed to AlternateTouchProvider.
        initUdfpsController(mOpticalProps, false /* hasAlternateTouchProvider */);

        // Configure UdfpsView to accept the ACTION_MOVE event
        when(mUdfpsView.isDisplayConfigured()).thenReturn(false);
        when(mUdfpsView.isWithinSensorArea(anyFloat(), anyFloat())).thenReturn(true);

        // GIVEN that the alternate bouncer is showing and a11y touch exploration NOT enabled
        when(mAccessibilityManager.isTouchExplorationEnabled()).thenReturn(false);
        when(mAlternateBouncerInteractor.isVisibleState()).thenReturn(true);
        mOverlayController.showUdfpsOverlay(TEST_REQUEST_ID, mOpticalProps.sensorId,
                BiometricOverlayConstants.REASON_AUTH_KEYGUARD, mUdfpsOverlayControllerCallback);
        mFgExecutor.runAllReady();

        verify(mUdfpsView).setOnTouchListener(mTouchListenerCaptor.capture());

        // GIVEN swipe down for QS
        when(mPrimaryBouncerInteractor.isInTransit()).thenReturn(false);
        when(mLockscreenShadeTransitionController.getQSDragProgress()).thenReturn(1f);

        // WHEN ACTION_MOVE is received and touch is within sensor
        when(mSinglePointerTouchProcessor.processTouch(any(), anyInt(), any())).thenReturn(
                processorResultMove);
        MotionEvent moveEvent = MotionEvent.obtain(0, 0, ACTION_MOVE, 0, 0, 0);
        mTouchListenerCaptor.getValue().onTouch(mUdfpsView, moveEvent);
        mBiometricExecutor.runAllReady();
        moveEvent.recycle();

        // THEN the touch is still processed
        verify(mFingerprintManager).onPointerDown(anyLong(), anyInt(), anyInt(),
                anyFloat(), anyFloat(), anyFloat(), anyFloat(), anyFloat(), anyLong(), anyLong(),
                anyBoolean());
    }

    @Test
    public void onAodInterrupt_onAcquiredGood_fingerNoLongerDown() throws RemoteException {
        // GIVEN UDFPS overlay is showing