Skip to content
Commit d70c6c8f authored by Ned Burns's avatar Ned Burns
Browse files

Hide silent notifications when AOD animation starts

When the user presses the power button on an unlocked device, we play a
transition animation into AOD. This animation has two parts: a black
scrim that collapses around the power button, followed by the appearance
of the AOD UI. For performance reasons, we don't mark the state of the
status bar as KEYGUARD until both sections of the animation finish. This
causes a bug with silent notifications: if the user's only notification
is one or more silent notifs and they press the power button, the AOD
animation will play, but in the moment that the AOD UI needs to appear,
the status bar is not yet in the KEYGUARD state. This means that the
silent notifications will not yet be hidden, and so the lockscreen will
use the "small" clock treatment rather than the "large" clock treatment.
A few ms later, we will enter KEYGUARD state for real, the notifs will
be hidden, and the small clock will revert to the large clock, causing a
flicker.

This change creates a new concept in StatusBarStateController: an
"upcoming state". When we start the animation, we mark our upcoming
state as KEYGUARD (without changing the actual state). At the same time,
we modify NotificationViewHierarchyManager (the thing in charge of
hiding silent notifications) to check the upcoming state rather than the
actual state.

To avoid the upcoming state desyncing from the actual state, setting the
actual state causes the upcoming state to be cleared.

Bug: 190344677
Test: manual
Change-Id: I7b3613d242516440ba2e86aa1a936aef62a53d6a
parent 30d17bd9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment