Loading packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java +10 −1 Original line number Diff line number Diff line Loading @@ -405,6 +405,15 @@ public class AuthContainerView extends LinearLayout maybeUpdatePositionForUdfps(true /* invalidate */); } @Override public void onWindowFocusChanged(boolean hasWindowFocus) { super.onWindowFocusChanged(hasWindowFocus); if (!hasWindowFocus) { Log.v(TAG, "Lost window focus, dismissing the dialog"); animateAway(AuthDialogCallback.DISMISSED_USER_CANCELED); } } @Override public void onAttachedToWindow() { super.onAttachedToWindow(); Loading Loading @@ -720,7 +729,7 @@ public class AuthContainerView extends LinearLayout final WindowManager.LayoutParams lp = new WindowManager.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.TYPE_STATUS_BAR_SUB_PANEL, WindowManager.LayoutParams.TYPE_STATUS_BAR_ADDITIONAL, windowFlags, PixelFormat.TRANSLUCENT); lp.privateFlags |= WindowManager.LayoutParams.SYSTEM_FLAG_SHOW_FOR_ALL_USERS; Loading packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthContainerViewTest.kt +17 −0 Original line number Diff line number Diff line Loading @@ -105,6 +105,23 @@ class AuthContainerViewTest : SysuiTestCase() { verify(callback).onDialogAnimatedIn() } @Test fun testDismissesOnFocusLoss() { val container = initializeContainer() waitForIdleSync() verify(callback).onDialogAnimatedIn() container.onWindowFocusChanged(false) waitForIdleSync() verify(callback).onDismissed( eq(AuthDialogCallback.DISMISSED_USER_CANCELED), eq<ByteArray?>(null) /* credentialAttestation */ ) assertThat(container.parent).isNull() } @Test fun testActionAuthenticated_sendsDismissedAuthenticated() { val container = initializeContainer() Loading Loading
packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java +10 −1 Original line number Diff line number Diff line Loading @@ -405,6 +405,15 @@ public class AuthContainerView extends LinearLayout maybeUpdatePositionForUdfps(true /* invalidate */); } @Override public void onWindowFocusChanged(boolean hasWindowFocus) { super.onWindowFocusChanged(hasWindowFocus); if (!hasWindowFocus) { Log.v(TAG, "Lost window focus, dismissing the dialog"); animateAway(AuthDialogCallback.DISMISSED_USER_CANCELED); } } @Override public void onAttachedToWindow() { super.onAttachedToWindow(); Loading Loading @@ -720,7 +729,7 @@ public class AuthContainerView extends LinearLayout final WindowManager.LayoutParams lp = new WindowManager.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.TYPE_STATUS_BAR_SUB_PANEL, WindowManager.LayoutParams.TYPE_STATUS_BAR_ADDITIONAL, windowFlags, PixelFormat.TRANSLUCENT); lp.privateFlags |= WindowManager.LayoutParams.SYSTEM_FLAG_SHOW_FOR_ALL_USERS; Loading
packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthContainerViewTest.kt +17 −0 Original line number Diff line number Diff line Loading @@ -105,6 +105,23 @@ class AuthContainerViewTest : SysuiTestCase() { verify(callback).onDialogAnimatedIn() } @Test fun testDismissesOnFocusLoss() { val container = initializeContainer() waitForIdleSync() verify(callback).onDialogAnimatedIn() container.onWindowFocusChanged(false) waitForIdleSync() verify(callback).onDismissed( eq(AuthDialogCallback.DISMISSED_USER_CANCELED), eq<ByteArray?>(null) /* credentialAttestation */ ) assertThat(container.parent).isNull() } @Test fun testActionAuthenticated_sendsDismissedAuthenticated() { val container = initializeContainer() Loading