summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorDaniel Sandler <dsandler@android.com>2012-06-14 16:10:13 -0400
committerDaniel Sandler <dsandler@android.com>2012-06-14 16:10:13 -0400
commit590d515d912396a0c293d78529ac0dbc224400bf (patch)
tree2be832b79c60fc41276563144bef08b9b91ba9b3 /packages
parent0a4cbc3267c12fb4f5831ea70286b0664f90891a (diff)
downloadframeworks_base-590d515d912396a0c293d78529ac0dbc224400bf.zip
frameworks_base-590d515d912396a0c293d78529ac0dbc224400bf.tar.gz
frameworks_base-590d515d912396a0c293d78529ac0dbc224400bf.tar.bz2
Show even fewer notifications in Setup.
Restricting to pkg="android" didn't filter out things like open wifi networks, etc. So now we have a whitelist: notifications must be sent the "android" pseudo-package, *and* they must have one of these "kind" tags: - android.system.imeswitcher (IME switcher, needed by SUW) - android.system.update (OTAs) Note that OTAs currently use a fullScreenIntent, so they bypass this logic anyway, but for consistency's sake we now allow OTA icons in the status bar explicitly. Bug: 6645469 Change-Id: Ib2e2f22d7a0817a1acaf8137ed4f3c7d3ddf8af5
Diffstat (limited to 'packages')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java21
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 56de506..c7cde3c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -812,6 +812,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;
@@ -823,7 +840,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);
}
}
@@ -878,7 +895,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);
}
}