|
70 | 70 | import com.android.systemui.statusbar.NotificationData; |
71 | 71 | import com.android.systemui.statusbar.SignalClusterView; |
72 | 72 | import com.android.systemui.statusbar.StatusBarIconView; |
| 73 | +import com.android.systemui.statusbar.NotificationData.Entry; |
73 | 74 | import com.android.systemui.statusbar.policy.BatteryController; |
74 | 75 | import com.android.systemui.statusbar.policy.BluetoothController; |
75 | 76 | import com.android.systemui.statusbar.policy.CompatModeButton; |
@@ -111,6 +112,9 @@ public class TabletStatusBar extends BaseStatusBar implements |
111 | 112 | final static int NOTIFICATION_PEEK_HOLD_THRESH = 200; // ms |
112 | 113 | final static int NOTIFICATION_PEEK_FADE_DELAY = 3000; // ms |
113 | 114 |
|
| 115 | + private static final int NOTIFICATION_PRIORITY_MULTIPLIER = 10; // see NotificationManagerService |
| 116 | + private static final int HIDE_ICONS_BELOW_SCORE = Notification.PRIORITY_LOW * NOTIFICATION_PRIORITY_MULTIPLIER; |
| 117 | + |
114 | 118 | // The height of the bar, as definied by the build. It may be taller if we're plugged |
115 | 119 | // into hdmi. |
116 | 120 | int mNaturalBarHeight = -1; |
@@ -1713,9 +1717,12 @@ private void updateNotificationIcons() { |
1713 | 1717 | if (mInputMethodSwitchButton.getVisibility() != View.GONE) maxNotificationIconsCount --; |
1714 | 1718 | if (mCompatModeButton.getVisibility() != View.GONE) maxNotificationIconsCount --; |
1715 | 1719 |
|
1716 | | - for (int i=0; i< maxNotificationIconsCount; i++) { |
1717 | | - if (i>=N) break; |
1718 | | - toShow.add(mNotificationData.get(N-i-1).icon); |
| 1720 | + for (int i=0; toShow.size()< maxNotificationIconsCount; i++) { |
| 1721 | + if (i >= N) break; |
| 1722 | + Entry ent = mNotificationData.get(N-i-1); |
| 1723 | + if (ent.notification.score >= HIDE_ICONS_BELOW_SCORE) { |
| 1724 | + toShow.add(ent.icon); |
| 1725 | + } |
1719 | 1726 | } |
1720 | 1727 |
|
1721 | 1728 | ArrayList<View> toRemove = new ArrayList<View>(); |
@@ -1764,7 +1771,8 @@ private void loadNotificationPanel() { |
1764 | 1771 | for (int i=0; i<toShow.size(); i++) { |
1765 | 1772 | View v = toShow.get(i); |
1766 | 1773 | if (v.getParent() == null) { |
1767 | | - mPile.addView(v, N-1-i); // the notification panel has newest at the bottom |
| 1774 | + // the notification panel has the most important things at the bottom |
| 1775 | + mPile.addView(v, N-1-i); |
1768 | 1776 | } |
1769 | 1777 | } |
1770 | 1778 |
|
|
0 commit comments