diff options
author | Daniel Sandler <dsandler@android.com> | 2012-06-14 16:07:45 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-06-14 16:07:45 -0700 |
commit | 68a808bc702f03536bd0cf3e2556127e364119d6 (patch) | |
tree | 031ca2015247958d2ba2e13eba00f57d2880c579 /packages/SystemUI | |
parent | 9add56546b1a5ddbf54f058f2ddb807a0ca02dff (diff) | |
parent | 590d515d912396a0c293d78529ac0dbc224400bf (diff) | |
download | frameworks_base-68a808bc702f03536bd0cf3e2556127e364119d6.zip frameworks_base-68a808bc702f03536bd0cf3e2556127e364119d6.tar.gz frameworks_base-68a808bc702f03536bd0cf3e2556127e364119d6.tar.bz2 |
Merge "Show even fewer notifications in Setup." into jb-dev
Diffstat (limited to 'packages/SystemUI')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java | 21 |
1 files changed, 19 insertions, 2 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 393ff0b..9c99653 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -820,6 +820,23 @@ public class PhoneStatusBar extends BaseStatusBar { R.integer.config_show_search_delay); } + // Q: What kinds of notifications should show during setup? + // A: Almost none! Only things coming from the system (package is "android") that also + // have special "kind" tags marking them as relevant for setup (see below). + private boolean showNotificationEvenIfUnprovisioned(StatusBarNotification sbn) { + if ("android".equals(sbn.pkg)) { + if (sbn.notification.kind != null) { + for (String aKind : sbn.notification.kind) { + // IME switcher, created by InputMethodManagerService + if ("android.system.imeswitcher".equals(aKind)) return true; + // OTA availability & errors, created by SystemUpdateService + if ("android.system.update".equals(aKind)) return true; + } + } + } + return false; + } + private void loadNotificationShade() { if (mPile == null) return; @@ -831,7 +848,7 @@ public class PhoneStatusBar extends BaseStatusBar { // If the device hasn't been through Setup, we only show system notifications for (int i=0; i<N; i++) { Entry ent = mNotificationData.get(N-i-1); - if (provisioned || "android".equals(ent.notification.pkg)) { + if (provisioned || showNotificationEvenIfUnprovisioned(ent.notification)) { toShow.add(ent.row); } } @@ -886,7 +903,7 @@ public class PhoneStatusBar extends BaseStatusBar { for (int i=0; i<N; i++) { Entry ent = mNotificationData.get(N-i-1); if ((provisioned && ent.notification.score >= HIDE_ICONS_BELOW_SCORE) - || "android".equals(ent.notification.pkg)) { + || showNotificationEvenIfUnprovisioned(ent.notification)) { toShow.add(ent.icon); } } |