Do not require keyguard message's min time if being update to empty

For example, don't require that the "Unlocked by face"
message shows the minimum show time if the biometric
message is being update to show nothing. This can happen
if the device starts dozing and the user quickly wakes
the device again. We don't want to reshow the unlocked
message when the user rewakes up the device within the
min show time since the unlocked info is no longer valid.

Test: atest KeyguardIndicationRotateTextViewControllerTest
Fixes: 228414801
Flag: None
Change-Id: Icc593319b4b717f83843d4eee3c8245436b835b6
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardIndicationRotateTextViewController.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardIndicationRotateTextViewController.java
index 00ec1a1..44e795c 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 @@
             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 39fcd41..5b836b6 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 @@
     }
 
     @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);