Loading packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java +1 −2 Original line number Diff line number Diff line Loading @@ -637,6 +637,7 @@ public class AuthContainerView extends LinearLayout @Override public void onDetachedFromWindow() { mPanelInteractionDetector.disable(); OnBackInvokedDispatcher dispatcher = findOnBackInvokedDispatcher(); if (dispatcher != null) { findOnBackInvokedDispatcher().unregisterOnBackInvokedCallback(mBackCallback); Loading Loading @@ -674,7 +675,6 @@ public class AuthContainerView extends LinearLayout @Override public void dismissWithoutCallback(boolean animate) { mPanelInteractionDetector.disable(); if (animate) { animateAway(false /* sendReason */, 0 /* reason */); } else { Loading @@ -685,7 +685,6 @@ public class AuthContainerView extends LinearLayout @Override public void dismissFromSystemServer() { mPanelInteractionDetector.disable(); animateAway(false /* sendReason */, 0 /* reason */); } Loading packages/SystemUI/src/com/android/systemui/biometrics/AuthDialogPanelInteractionDetector.kt +2 −1 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ constructor( @MainThread fun disable() { if (action != null) { Log.i(TAG, "Disable dectector") action = null shadeExpansionStateManager.removeExpansionListener(this::onPanelExpansionChanged) } Loading @@ -40,7 +41,7 @@ constructor( mainExecutor.execute { action?.let { if (event.tracking || (event.expanded && event.fraction > 0)) { Log.v(TAG, "Detected panel interaction, event: $event") Log.i(TAG, "Detected panel interaction, event: $event") it.onPanelInteraction.run() disable() } Loading packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthContainerViewTest.kt +6 −14 Original line number Diff line number Diff line Loading @@ -170,24 +170,16 @@ class AuthContainerViewTest : SysuiTestCase() { } @Test fun testFocusLossAfterRotating() { fun testActionCancel_panelInteractionDetectorDisable() { val container = initializeFingerprintContainer() waitForIdleSync() val requestID = authContainer?.requestId ?: 0L verify(callback).onDialogAnimatedIn(requestID) container.onOrientationChanged() container.onWindowFocusChanged(false) waitForIdleSync() verify(callback, never()).onDismissed( eq(AuthDialogCallback.DISMISSED_USER_CANCELED), eq<ByteArray?>(null), /* credentialAttestation */ eq(requestID) container.mBiometricCallback.onAction( AuthBiometricView.Callback.ACTION_USER_CANCELED ) waitForIdleSync() verify(panelInteractionDetector).disable() } @Test fun testActionAuthenticated_sendsDismissedAuthenticated() { val container = initializeFingerprintContainer() Loading Loading
packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java +1 −2 Original line number Diff line number Diff line Loading @@ -637,6 +637,7 @@ public class AuthContainerView extends LinearLayout @Override public void onDetachedFromWindow() { mPanelInteractionDetector.disable(); OnBackInvokedDispatcher dispatcher = findOnBackInvokedDispatcher(); if (dispatcher != null) { findOnBackInvokedDispatcher().unregisterOnBackInvokedCallback(mBackCallback); Loading Loading @@ -674,7 +675,6 @@ public class AuthContainerView extends LinearLayout @Override public void dismissWithoutCallback(boolean animate) { mPanelInteractionDetector.disable(); if (animate) { animateAway(false /* sendReason */, 0 /* reason */); } else { Loading @@ -685,7 +685,6 @@ public class AuthContainerView extends LinearLayout @Override public void dismissFromSystemServer() { mPanelInteractionDetector.disable(); animateAway(false /* sendReason */, 0 /* reason */); } Loading
packages/SystemUI/src/com/android/systemui/biometrics/AuthDialogPanelInteractionDetector.kt +2 −1 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ constructor( @MainThread fun disable() { if (action != null) { Log.i(TAG, "Disable dectector") action = null shadeExpansionStateManager.removeExpansionListener(this::onPanelExpansionChanged) } Loading @@ -40,7 +41,7 @@ constructor( mainExecutor.execute { action?.let { if (event.tracking || (event.expanded && event.fraction > 0)) { Log.v(TAG, "Detected panel interaction, event: $event") Log.i(TAG, "Detected panel interaction, event: $event") it.onPanelInteraction.run() disable() } Loading
packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthContainerViewTest.kt +6 −14 Original line number Diff line number Diff line Loading @@ -170,24 +170,16 @@ class AuthContainerViewTest : SysuiTestCase() { } @Test fun testFocusLossAfterRotating() { fun testActionCancel_panelInteractionDetectorDisable() { val container = initializeFingerprintContainer() waitForIdleSync() val requestID = authContainer?.requestId ?: 0L verify(callback).onDialogAnimatedIn(requestID) container.onOrientationChanged() container.onWindowFocusChanged(false) waitForIdleSync() verify(callback, never()).onDismissed( eq(AuthDialogCallback.DISMISSED_USER_CANCELED), eq<ByteArray?>(null), /* credentialAttestation */ eq(requestID) container.mBiometricCallback.onAction( AuthBiometricView.Callback.ACTION_USER_CANCELED ) waitForIdleSync() verify(panelInteractionDetector).disable() } @Test fun testActionAuthenticated_sendsDismissedAuthenticated() { val container = initializeFingerprintContainer() Loading