Merge "Pilfer pointers when alternate bouncer is showing" into udc-dev am: a03af9df53
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22144153 Change-Id: Ic3b144aec5518f955ca1ce1019f175b97b3ec1dc Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -618,9 +618,9 @@ public class UdfpsController implements DozeReceiver, Dumpable {
|
||||
}
|
||||
logBiometricTouch(processedTouch.getEvent(), data);
|
||||
|
||||
// Always pilfer pointers that are within sensor area
|
||||
if (isWithinSensorArea(mOverlay.getOverlayView(), event.getRawX(), event.getRawY(), true)) {
|
||||
Log.d("Austin", "pilferTouch invalid overlap");
|
||||
// Always pilfer pointers that are within sensor area or when alternate bouncer is showing
|
||||
if (isWithinSensorArea(mOverlay.getOverlayView(), event.getRawX(), event.getRawY(), true)
|
||||
|| mAlternateBouncerInteractor.isVisibleState()) {
|
||||
mInputManager.pilferPointers(
|
||||
mOverlay.getOverlayView().getViewRootImpl().getInputToken());
|
||||
}
|
||||
|
||||
@@ -1343,6 +1343,46 @@ public class UdfpsControllerTest extends SysuiTestCase {
|
||||
verify(mInputManager, times(0)).pilferPointers(any());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onTouch_withNewTouchDetection_pilferPointerWhenAltBouncerShowing()
|
||||
throws RemoteException {
|
||||
final NormalizedTouchData touchData = new NormalizedTouchData(0, 0f, 0f, 0f, 0f, 0f, 0L,
|
||||
0L);
|
||||
final TouchProcessorResult processorResultUnchanged =
|
||||
new TouchProcessorResult.ProcessedTouch(InteractionEvent.UNCHANGED,
|
||||
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 not accept the ACTION_DOWN event
|
||||
when(mUdfpsView.isDisplayConfigured()).thenReturn(false);
|
||||
when(mUdfpsView.isWithinSensorArea(anyFloat(), anyFloat())).thenReturn(false);
|
||||
|
||||
// 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());
|
||||
|
||||
// WHEN ACTION_DOWN is received and touch is not within sensor
|
||||
when(mSinglePointerTouchProcessor.processTouch(any(), anyInt(), any())).thenReturn(
|
||||
processorResultUnchanged);
|
||||
MotionEvent downEvent = MotionEvent.obtain(0, 0, ACTION_DOWN, 0, 0, 0);
|
||||
mTouchListenerCaptor.getValue().onTouch(mUdfpsView, downEvent);
|
||||
mBiometricExecutor.runAllReady();
|
||||
downEvent.recycle();
|
||||
|
||||
// THEN the touch is pilfered
|
||||
verify(mInputManager, times(1)).pilferPointers(any());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onAodInterrupt_onAcquiredGood_fingerNoLongerDown() throws RemoteException {
|
||||
// GIVEN UDFPS overlay is showing
|
||||
|
||||
Reference in New Issue
Block a user