Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java +0 −14 Original line number Original line Diff line number Diff line Loading @@ -394,20 +394,6 @@ public class NotificationData { return false; return false; } } /** * Return whether there are any clearable notifications (that aren't errors). */ public boolean hasActiveClearableNotifications() { for (Entry e : mSortedAndFiltered) { if (e.getContentView() != null) { // the view successfully inflated if (e.notification.isClearable()) { return true; } } } return false; } // Q: What kinds of notifications should show during setup? // Q: What kinds of notifications should show during setup? // A: Almost none! Only things coming from the system (package is "android") that also // 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). // have special "kind" tags marking them as relevant for setup (see below). Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +32 −6 Original line number Original line Diff line number Diff line Loading @@ -1196,6 +1196,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, List<ExpandableNotificationRow> children = row.getNotificationChildren(); List<ExpandableNotificationRow> children = row.getNotificationChildren(); if (row.areChildrenExpanded() && children != null) { if (row.areChildrenExpanded() && children != null) { for (ExpandableNotificationRow childRow : children) { for (ExpandableNotificationRow childRow : children) { if (mStackScroller.canChildBeDismissed(childRow)) { if (childRow.getVisibility() == View.VISIBLE) { if (childRow.getVisibility() == View.VISIBLE) { viewsToHide.add(childRow); viewsToHide.add(childRow); } } Loading @@ -1203,6 +1204,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, } } } } } } } if (viewsToHide.isEmpty()) { if (viewsToHide.isEmpty()) { animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE); animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE); return; return; Loading Loading @@ -1682,8 +1684,15 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, } } List<ExpandableNotificationRow> notificationChildren = List<ExpandableNotificationRow> notificationChildren = entry.row.getNotificationChildren(); entry.row.getNotificationChildren(); ArrayList<ExpandableNotificationRow> toRemove = new ArrayList<>(notificationChildren); ArrayList<ExpandableNotificationRow> toRemove = new ArrayList<>(); for (int i = 0; i < toRemove.size(); i++) { for (int i = 0; i < notificationChildren.size(); i++) { ExpandableNotificationRow row = notificationChildren.get(i); if ((row.getStatusBarNotification().getNotification().flags & Notification.FLAG_FOREGROUND_SERVICE) != 0) { // the child is a forground service notification which we can't remove! continue; } toRemove.add(row); toRemove.get(i).setKeepInParent(true); toRemove.get(i).setKeepInParent(true); // we need to set this state earlier as otherwise we might generate some weird // we need to set this state earlier as otherwise we might generate some weird // animations // animations Loading Loading @@ -1949,10 +1958,27 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, private void updateClearAll() { private void updateClearAll() { boolean showDismissView = boolean showDismissView = mState != StatusBarState.KEYGUARD && mState != StatusBarState.KEYGUARD && mNotificationData.hasActiveClearableNotifications(); hasActiveClearableNotifications(); mStackScroller.updateDismissView(showDismissView); mStackScroller.updateDismissView(showDismissView); } } /** * Return whether there are any clearable notifications */ private boolean hasActiveClearableNotifications() { int childCount = mStackScroller.getChildCount(); for (int i = 0; i < childCount; i++) { View child = mStackScroller.getChildAt(i); if (!(child instanceof ExpandableNotificationRow)) { continue; } if (((ExpandableNotificationRow) child).canViewBeDismissed()) { return true; } } return false; } private void updateEmptyShadeView() { private void updateEmptyShadeView() { boolean showEmptyShade = boolean showEmptyShade = mState != StatusBarState.KEYGUARD && mState != StatusBarState.KEYGUARD && Loading Loading @@ -1999,7 +2025,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, if (SPEW) { if (SPEW) { final boolean clearable = hasActiveNotifications() && final boolean clearable = hasActiveNotifications() && mNotificationData.hasActiveClearableNotifications(); hasActiveClearableNotifications(); Log.d(TAG, "setAreThereNotifications: N=" + Log.d(TAG, "setAreThereNotifications: N=" + mNotificationData.getActiveNotifications().size() + " any=" + mNotificationData.getActiveNotifications().size() + " any=" + hasActiveNotifications() + " clearable=" + clearable); hasActiveNotifications() + " clearable=" + clearable); Loading services/core/java/com/android/server/notification/NotificationManagerService.java +2 −1 Original line number Original line Diff line number Diff line Loading @@ -3576,7 +3576,8 @@ public class NotificationManagerService extends SystemService { NotificationRecord childR = mNotificationList.get(i); NotificationRecord childR = mNotificationList.get(i); StatusBarNotification childSbn = childR.sbn; StatusBarNotification childSbn = childR.sbn; if ((childSbn.isGroup() && !childSbn.getNotification().isGroupSummary()) && if ((childSbn.isGroup() && !childSbn.getNotification().isGroupSummary()) && childR.getGroupKey().equals(r.getGroupKey())) { childR.getGroupKey().equals(r.getGroupKey()) && (childR.getFlags() & Notification.FLAG_FOREGROUND_SERVICE) == 0) { EventLogTags.writeNotificationCancel(callingUid, callingPid, pkg, childSbn.getId(), EventLogTags.writeNotificationCancel(callingUid, callingPid, pkg, childSbn.getId(), childSbn.getTag(), userId, 0, 0, reason, listenerName); childSbn.getTag(), userId, 0, 0, reason, listenerName); mNotificationList.remove(i); mNotificationList.remove(i); Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java +0 −14 Original line number Original line Diff line number Diff line Loading @@ -394,20 +394,6 @@ public class NotificationData { return false; return false; } } /** * Return whether there are any clearable notifications (that aren't errors). */ public boolean hasActiveClearableNotifications() { for (Entry e : mSortedAndFiltered) { if (e.getContentView() != null) { // the view successfully inflated if (e.notification.isClearable()) { return true; } } } return false; } // Q: What kinds of notifications should show during setup? // Q: What kinds of notifications should show during setup? // A: Almost none! Only things coming from the system (package is "android") that also // 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). // have special "kind" tags marking them as relevant for setup (see below). Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +32 −6 Original line number Original line Diff line number Diff line Loading @@ -1196,6 +1196,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, List<ExpandableNotificationRow> children = row.getNotificationChildren(); List<ExpandableNotificationRow> children = row.getNotificationChildren(); if (row.areChildrenExpanded() && children != null) { if (row.areChildrenExpanded() && children != null) { for (ExpandableNotificationRow childRow : children) { for (ExpandableNotificationRow childRow : children) { if (mStackScroller.canChildBeDismissed(childRow)) { if (childRow.getVisibility() == View.VISIBLE) { if (childRow.getVisibility() == View.VISIBLE) { viewsToHide.add(childRow); viewsToHide.add(childRow); } } Loading @@ -1203,6 +1204,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, } } } } } } } if (viewsToHide.isEmpty()) { if (viewsToHide.isEmpty()) { animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE); animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE); return; return; Loading Loading @@ -1682,8 +1684,15 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, } } List<ExpandableNotificationRow> notificationChildren = List<ExpandableNotificationRow> notificationChildren = entry.row.getNotificationChildren(); entry.row.getNotificationChildren(); ArrayList<ExpandableNotificationRow> toRemove = new ArrayList<>(notificationChildren); ArrayList<ExpandableNotificationRow> toRemove = new ArrayList<>(); for (int i = 0; i < toRemove.size(); i++) { for (int i = 0; i < notificationChildren.size(); i++) { ExpandableNotificationRow row = notificationChildren.get(i); if ((row.getStatusBarNotification().getNotification().flags & Notification.FLAG_FOREGROUND_SERVICE) != 0) { // the child is a forground service notification which we can't remove! continue; } toRemove.add(row); toRemove.get(i).setKeepInParent(true); toRemove.get(i).setKeepInParent(true); // we need to set this state earlier as otherwise we might generate some weird // we need to set this state earlier as otherwise we might generate some weird // animations // animations Loading Loading @@ -1949,10 +1958,27 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, private void updateClearAll() { private void updateClearAll() { boolean showDismissView = boolean showDismissView = mState != StatusBarState.KEYGUARD && mState != StatusBarState.KEYGUARD && mNotificationData.hasActiveClearableNotifications(); hasActiveClearableNotifications(); mStackScroller.updateDismissView(showDismissView); mStackScroller.updateDismissView(showDismissView); } } /** * Return whether there are any clearable notifications */ private boolean hasActiveClearableNotifications() { int childCount = mStackScroller.getChildCount(); for (int i = 0; i < childCount; i++) { View child = mStackScroller.getChildAt(i); if (!(child instanceof ExpandableNotificationRow)) { continue; } if (((ExpandableNotificationRow) child).canViewBeDismissed()) { return true; } } return false; } private void updateEmptyShadeView() { private void updateEmptyShadeView() { boolean showEmptyShade = boolean showEmptyShade = mState != StatusBarState.KEYGUARD && mState != StatusBarState.KEYGUARD && Loading Loading @@ -1999,7 +2025,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, if (SPEW) { if (SPEW) { final boolean clearable = hasActiveNotifications() && final boolean clearable = hasActiveNotifications() && mNotificationData.hasActiveClearableNotifications(); hasActiveClearableNotifications(); Log.d(TAG, "setAreThereNotifications: N=" + Log.d(TAG, "setAreThereNotifications: N=" + mNotificationData.getActiveNotifications().size() + " any=" + mNotificationData.getActiveNotifications().size() + " any=" + hasActiveNotifications() + " clearable=" + clearable); hasActiveNotifications() + " clearable=" + clearable); Loading
services/core/java/com/android/server/notification/NotificationManagerService.java +2 −1 Original line number Original line Diff line number Diff line Loading @@ -3576,7 +3576,8 @@ public class NotificationManagerService extends SystemService { NotificationRecord childR = mNotificationList.get(i); NotificationRecord childR = mNotificationList.get(i); StatusBarNotification childSbn = childR.sbn; StatusBarNotification childSbn = childR.sbn; if ((childSbn.isGroup() && !childSbn.getNotification().isGroupSummary()) && if ((childSbn.isGroup() && !childSbn.getNotification().isGroupSummary()) && childR.getGroupKey().equals(r.getGroupKey())) { childR.getGroupKey().equals(r.getGroupKey()) && (childR.getFlags() & Notification.FLAG_FOREGROUND_SERVICE) == 0) { EventLogTags.writeNotificationCancel(callingUid, callingPid, pkg, childSbn.getId(), EventLogTags.writeNotificationCancel(callingUid, callingPid, pkg, childSbn.getId(), childSbn.getTag(), userId, 0, 0, reason, listenerName); childSbn.getTag(), userId, 0, 0, reason, listenerName); mNotificationList.remove(i); mNotificationList.remove(i); Loading