Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 83dae4a2 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Do not require keyguard message's min time if being update to empty" into main

parents 0dfb0536 739d647f
Loading
Loading
Loading
Loading
+5 −8
Original line number Diff line number Diff line
@@ -187,19 +187,16 @@ 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);
            }
            } else {
                scheduleShowNextIndication(minShowDuration - timeSinceLastIndicationSwitch);
            }
        }
    }

+18 −0
Original line number Diff line number Diff line
@@ -345,6 +345,24 @@ public class KeyguardIndicationRotateTextViewControllerTest extends SysuiTestCas
        verify(mView).switchIndication(null);
    }

    @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