Loading packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java +26 −17 Original line number Diff line number Diff line Loading @@ -198,12 +198,17 @@ public class AuthController implements CoreStartable, CommandQueue.Callbacks, final BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { if (mCurrentDialog != null && Intent.ACTION_CLOSE_SYSTEM_DIALOGS.equals(intent.getAction())) { if (Intent.ACTION_CLOSE_SYSTEM_DIALOGS.equals(intent.getAction())) { String reason = intent.getStringExtra("reason"); reason = (reason != null) ? reason : "unknown"; Log.d(TAG, "ACTION_CLOSE_SYSTEM_DIALOGS received, reason: " + reason); closeDioalog(reason); } } }; private void closeDioalog(String reason) { if (isShowing()) { Log.i(TAG, "Close BP, reason :" + reason); mCurrentDialog.dismissWithoutCallback(true /* animate */); mCurrentDialog = null; Loading @@ -222,7 +227,6 @@ public class AuthController implements CoreStartable, CommandQueue.Callbacks, } } } }; private void cancelIfOwnerIsNotInForeground() { mExecution.assertIsMainThread(); Loading Loading @@ -546,6 +550,11 @@ public class AuthController implements CoreStartable, CommandQueue.Callbacks, } } @Override public void handleShowGlobalActionsMenu() { closeDioalog("PowerMenu shown"); } /** * @return where the UDFPS exists on the screen in pixels in portrait mode. */ Loading packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthControllerTest.java +9 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,6 @@ import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.inOrder; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.reset; Loading Loading @@ -930,6 +929,15 @@ public class AuthControllerTest extends SysuiTestCase { assertNotSame(firstFpLocation, mAuthController.getFingerprintSensorLocation()); } @Test public void testCloseDialog_whenGlobalActionsMenuShown() throws Exception { showDialog(new int[]{1} /* sensorIds */, false /* credentialAllowed */); mAuthController.handleShowGlobalActionsMenu(); verify(mReceiver).onDialogDismissed( eq(BiometricPrompt.DISMISSED_REASON_USER_CANCEL), eq(null) /* credentialAttestation */); } private void showDialog(int[] sensorIds, boolean credentialAllowed) { mAuthController.showAuthenticationDialog(createTestPromptInfo(), mReceiver /* receiver */, Loading Loading
packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java +26 −17 Original line number Diff line number Diff line Loading @@ -198,12 +198,17 @@ public class AuthController implements CoreStartable, CommandQueue.Callbacks, final BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { if (mCurrentDialog != null && Intent.ACTION_CLOSE_SYSTEM_DIALOGS.equals(intent.getAction())) { if (Intent.ACTION_CLOSE_SYSTEM_DIALOGS.equals(intent.getAction())) { String reason = intent.getStringExtra("reason"); reason = (reason != null) ? reason : "unknown"; Log.d(TAG, "ACTION_CLOSE_SYSTEM_DIALOGS received, reason: " + reason); closeDioalog(reason); } } }; private void closeDioalog(String reason) { if (isShowing()) { Log.i(TAG, "Close BP, reason :" + reason); mCurrentDialog.dismissWithoutCallback(true /* animate */); mCurrentDialog = null; Loading @@ -222,7 +227,6 @@ public class AuthController implements CoreStartable, CommandQueue.Callbacks, } } } }; private void cancelIfOwnerIsNotInForeground() { mExecution.assertIsMainThread(); Loading Loading @@ -546,6 +550,11 @@ public class AuthController implements CoreStartable, CommandQueue.Callbacks, } } @Override public void handleShowGlobalActionsMenu() { closeDioalog("PowerMenu shown"); } /** * @return where the UDFPS exists on the screen in pixels in portrait mode. */ Loading
packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthControllerTest.java +9 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,6 @@ import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.inOrder; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.reset; Loading Loading @@ -930,6 +929,15 @@ public class AuthControllerTest extends SysuiTestCase { assertNotSame(firstFpLocation, mAuthController.getFingerprintSensorLocation()); } @Test public void testCloseDialog_whenGlobalActionsMenuShown() throws Exception { showDialog(new int[]{1} /* sensorIds */, false /* credentialAllowed */); mAuthController.handleShowGlobalActionsMenu(); verify(mReceiver).onDialogDismissed( eq(BiometricPrompt.DISMISSED_REASON_USER_CANCEL), eq(null) /* credentialAttestation */); } private void showDialog(int[] sensorIds, boolean credentialAllowed) { mAuthController.showAuthenticationDialog(createTestPromptInfo(), mReceiver /* receiver */, Loading