Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8ce090d9 authored by Daniel Sandler's avatar Daniel Sandler Committed by Android Git Automerger
Browse files

am 68a808bc: Merge "Show even fewer notifications in Setup." into jb-dev

* commit '68a808bc':
  Show even fewer notifications in Setup.
parents b6b2af3c 68a808bc
Loading
Loading
Loading
Loading
+19 −2
Original line number Diff line number Diff line
@@ -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);
            }
        }
+4 −0
Original line number Diff line number Diff line
@@ -586,6 +586,10 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
        mImeSwitcherNotification.defaults = 0; // please be quiet
        mImeSwitcherNotification.sound = null;
        mImeSwitcherNotification.vibrate = null;

        // Tag this notification specially so SystemUI knows it's important
        mImeSwitcherNotification.kind = new String[] { "android.system.imeswitcher" };

        Intent intent = new Intent(Settings.ACTION_SHOW_INPUT_METHOD_PICKER);
        mImeSwitchPendingIntent = PendingIntent.getBroadcast(mContext, 0, intent, 0);