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

Commit 3bad9a6c authored by Adrian Roos's avatar Adrian Roos
Browse files

HeadsUpManager: escalate via wakefulness lifecycle instead of broadcast

Fixes an issue where heads up notifications were escalated too late,
which caused notifications not to show on ambient display if they came
in after the device started dozing but before the SCREEN_OFF intent came
in.

Instead, we now escalate when we start going to sleep.

Note that SCREEN_OFF is dispatched on the wakefulness lifecycle, not the screen
lifecycle.

Change-Id: Ied73161d1007d1c65c31e8c5a6f660124a1f4385
Fixes: 63992199
Test: Receive notification right when the display turns off. Make sure AOD does not show in a weird state.
parent 4bb2f8e9
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3712,7 +3712,6 @@ public class StatusBar extends SystemUI implements DemoMode,
                }
            }
            else if (Intent.ACTION_SCREEN_OFF.equals(action)) {
                notifyHeadsUpScreenOff();
                finishBarAnimations();
                resetUserExpandedStates();
            }
@@ -5153,6 +5152,7 @@ public class StatusBar extends SystemUI implements DemoMode,

        @Override
        public void onStartedGoingToSleep() {
            notifyHeadsUpGoingToSleep();
            dismissVolumeDialog();
        }

@@ -7240,7 +7240,7 @@ public class StatusBar extends SystemUI implements DemoMode,
        setAreThereNotifications();
    }

    protected void notifyHeadsUpScreenOff() {
    protected void notifyHeadsUpGoingToSleep() {
        maybeEscalateHeadsUp();
    }