diff options
| author | 2024-05-06 22:20:02 +0000 | |
|---|---|---|
| committer | 2024-05-06 22:20:02 +0000 | |
| commit | 83dae4a2fe68fd533f31c6fcecd271c2e77df815 (patch) | |
| tree | cbc63d4f28c1e950309f453d691bdcf6b6dfa00c | |
| parent | 0dfb0536502bc258d8e911e0534ab63b785469ed (diff) | |
| parent | 739d647f5c40871f41e34b6fc903c3906c70afa0 (diff) | |
Merge "Do not require keyguard message's min time if being update to empty" into main
2 files changed, 23 insertions, 8 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardIndicationRotateTextViewController.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardIndicationRotateTextViewController.java index 00ec1a14bb93..44e795c3d22a 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardIndicationRotateTextViewController.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardIndicationRotateTextViewController.java @@ -187,18 +187,15 @@ public class KeyguardIndicationRotateTextViewController extends return; } - // current indication is updated to empty + // Current indication is updated to empty. + // Update to empty even if `currMsgShownForMinTime` is false. if (mCurrIndicationType == type && !hasNewIndication && showAsap) { - if (currMsgShownForMinTime) { - if (mShowNextIndicationRunnable != null) { - mShowNextIndicationRunnable.runImmediately(); - } else { - showIndication(INDICATION_TYPE_NONE); - } + if (mShowNextIndicationRunnable != null) { + mShowNextIndicationRunnable.runImmediately(); } else { - scheduleShowNextIndication(minShowDuration - timeSinceLastIndicationSwitch); + showIndication(INDICATION_TYPE_NONE); } } } diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardIndicationRotateTextViewControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardIndicationRotateTextViewControllerTest.java index 39fcd417ec7a..5b836b6b06b9 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardIndicationRotateTextViewControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardIndicationRotateTextViewControllerTest.java @@ -346,6 +346,24 @@ public class KeyguardIndicationRotateTextViewControllerTest extends SysuiTestCas } @Test + public void testStartDozing_withMinShowTime() { + // GIVEN a biometric message is showing + mController.updateIndication(INDICATION_TYPE_BIOMETRIC_MESSAGE, + new KeyguardIndication.Builder() + .setMessage("test_message") + .setMinVisibilityMillis(5000L) + .setTextColor(ColorStateList.valueOf(Color.WHITE)) + .build(), + true); + + // WHEN the device wants to hide the biometric message + mController.hideIndication(INDICATION_TYPE_BIOMETRIC_MESSAGE); + + // THEN switch to INDICATION_TYPE_NONE + verify(mView).switchIndication(null); + } + + @Test public void testStoppedDozing() { // GIVEN we're dozing & we have an indication message mStatusBarStateListener.onDozingChanged(true); |