From 91d0466102739ad9d17d7f1f11460fe7fe0ce84d Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Mon, 24 Jun 2019 17:13:06 -0700 Subject: [PATCH] Made sure huns received while dozing time out Huns received during dozing will now time out following the regular hun timeout after we woke up. This ensures that we can't have huns hanging around for too long. Bug: 130327302 Test: get HUn while dozing, wake up, observe normal timeout Change-Id: Ie2fbc4a9ab7634f56f5db26bb7acb98c4248d59c --- .../systemui/statusbar/phone/HeadsUpManagerPhone.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpManagerPhone.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpManagerPhone.java index fe71f8a6d2933..ade855e755e32 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpManagerPhone.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpManagerPhone.java @@ -234,6 +234,17 @@ public class HeadsUpManagerPhone extends HeadsUpManager implements Dumpable, mStatusBarState = newState; } + @Override + public void onDozingChanged(boolean isDozing) { + if (!isDozing) { + // Let's make sure all huns we got while dozing time out within the normal timeout + // duration. Otherwise they could get stuck for a very long time + for (AlertEntry entry : mAlertEntries.values()) { + entry.updateEntry(true /* updatePostTime */); + } + } + } + /** * Set that we are exiting the headsUp pinned mode, but some notifications might still be * animating out. This is used to keep the touchable regions in a sane state.