diff options
author | Chris Wren <cwren@android.com> | 2013-08-07 17:39:35 -0400 |
---|---|---|
committer | Chris Wren <cwren@android.com> | 2013-08-08 07:23:13 -0400 |
commit | e97f90b9bbe3e75db058827887a842c5f4a0dda0 (patch) | |
tree | a7203bd5e0e08555eb16dea762aa7255c5ac0ff0 /packages/SystemUI | |
parent | 6ccf0affd0a286ea4af9d48b54070deb9e476e90 (diff) | |
download | frameworks_base-e97f90b9bbe3e75db058827887a842c5f4a0dda0.zip frameworks_base-e97f90b9bbe3e75db058827887a842c5f4a0dda0.tar.gz frameworks_base-e97f90b9bbe3e75db058827887a842c5f4a0dda0.tar.bz2 |
on screen off: convert heads up to full screen intent.
Let the app handle screen off as appropriate.
Bug: 10209767
Change-Id: I3949def1980118c0380b173a83148321ad8c5d95
Diffstat (limited to 'packages/SystemUI')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java | 7 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java | 22 |
2 files changed, 29 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index 8c54b69..2786867 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -89,6 +89,7 @@ public abstract class BaseStatusBar extends SystemUI implements protected static final int MSG_CLOSE_SEARCH_PANEL = 1025; protected static final int MSG_SHOW_HEADS_UP = 1026; protected static final int MSG_HIDE_HEADS_UP = 1027; + protected static final int MSG_ESCALATE_HEADS_UP = 1028; protected static final boolean ENABLE_HEADS_UP = true; // scores above this threshold should be displayed in heads up mode. @@ -1035,6 +1036,12 @@ public abstract class BaseStatusBar extends SystemUI implements } } + protected void notifyHeadsUpScreenOn(boolean screenOn) { + if (!screenOn && mInterruptingNotificationEntry != null) { + mHandler.sendEmptyMessage(MSG_ESCALATE_HEADS_UP); + } + } + protected boolean shouldInterrupt(StatusBarNotification sbn) { Notification notification = sbn.getNotification(); // some predicates to make the boolean logic legible 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 db738c4..ed9b542 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -1354,6 +1354,27 @@ public class PhoneStatusBar extends BaseStatusBar { setHeadsUpVisibility(false); mInterruptingNotificationEntry = null; break; + case MSG_ESCALATE_HEADS_UP: + escalateHeadsUp(); + setHeadsUpVisibility(false); + mInterruptingNotificationEntry = null; + break; + } + } + } + + /** if the interrupting notification had a fullscreen intent, fire it now. */ + private void escalateHeadsUp() { + if (mInterruptingNotificationEntry != null) { + final StatusBarNotification sbn = mInterruptingNotificationEntry.notification; + final Notification notification = sbn.getNotification(); + if (notification.fullScreenIntent != null) { + if (DEBUG) + Log.d(TAG, "converting a heads up to fullScreen"); + try { + notification.fullScreenIntent.send(); + } catch (PendingIntent.CanceledException e) { + } } } } @@ -2516,6 +2537,7 @@ public class PhoneStatusBar extends BaseStatusBar { // no waiting! makeExpandedInvisible(); notifyNavigationBarScreenOn(false); + notifyHeadsUpScreenOn(false); } else if (Intent.ACTION_CONFIGURATION_CHANGED.equals(action)) { if (DEBUG) { |