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

Commit aa47a2f8 authored by Caitlin Shkuratov's avatar Caitlin Shkuratov
Browse files

[SB][Notif] When HUN is PinnedByUser, always immediately show it.

Each HUN has a minimum earliestRemovalTime to ensure that a user sees a
HUN for long enough before a new HUN shows. However, if a user taps a
status bar chip, then we should *immediately* show that chip's HUN so
that the UI is responsive, even if there's a currently-showing HUN that
hasn't met its earliest removal time yet.

To do this, this CL:
 - Adds a `requestedPinnedStatus` field to `HeadsUpEntry`
 - Updates `AvalancheController#getDuration` to return a data class
   instead of a raw duration. If the next HUN is PinnedByUser (which is
   the state we use everywhere to know if a user tapped a status bar
   chip), then `#getDuration` returns `HideImmediately`.
 - If HeadsUpManagerImpl gets a `HideImmediately` value, it immediately
   hides the currently-showing HUN.

See demo videos in bug.

Fixes: 397505145
Bug: 364653005
Flag: com.android.systemui.status_bar_notification_chips

Test: Have 2 status bar notification chips. Tap on one chip then
immediately tap on the other chip -> verify the second HUN immediately
shows
Test: Tap on notification chip then trigger normal HUN -> verify normal
HUN still shows after 3s
Test: Send HUNs 0,1,2,3. While HUN 0 shows, tap chip to show HUN ->
verify chip HUN shows for 5 seconds, then hides (HUNs 1, 2, 3 discarded)
Test: atest HeadsUpManagerImplTest AvalancheControllerTest

Change-Id: I0c0a15147f00ec8cfda94ad22e4f5bcfe58ded17
parent 4fba341d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment