From d4db6cbc0fa5b3b1ff7ea18f7b861f0753518e4f Mon Sep 17 00:00:00 2001 From: Chris Wren Date: Wed, 7 Aug 2013 16:05:23 -0400 Subject: [PATCH] don't bump an active heads up for a corrupt notification Change-Id: I405d6438e003b08fc3e144bb870c3b3233f71e26 --- .../android/systemui/statusbar/phone/PhoneStatusBar.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index 87fcd795b438..6189a120410d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -902,20 +902,19 @@ public class PhoneStatusBar extends BaseStatusBar { if (mUseHeadsUp && shouldInterrupt(notification)) { if (DEBUG) Log.d(TAG, "launching notification in heads up mode"); - // 1. Populate mHeadsUpNotificationView - mInterruptingNotificationTime = System.currentTimeMillis(); - mInterruptingNotificationEntry = new Entry(key, notification, null); + Entry interruptionCandidate = new Entry(key, notification, null); + if (inflateViews(interruptionCandidate, mHeadsUpNotificationView.getHolder())) { + mInterruptingNotificationTime = System.currentTimeMillis(); + mInterruptingNotificationEntry = interruptionCandidate; - if (inflateViews(mInterruptingNotificationEntry, - mHeadsUpNotificationView.getHolder())) { + // 1. Populate mHeadsUpNotificationView mHeadsUpNotificationView.setNotification(mInterruptingNotificationEntry); + // 2. Animate mHeadsUpNotificationView in mHandler.sendEmptyMessage(MSG_SHOW_HEADS_UP); // 3. Set alarm to age the notification off resetHeadsUpDecayTimer(); - } else { - mInterruptingNotificationEntry = null; } } else if (notification.getNotification().fullScreenIntent != null) { // Stop screensaver if the notification has a full-screen intent. -- 2.11.0