Loading packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +7 −6 Original line number Original line Diff line number Diff line Loading @@ -2056,24 +2056,24 @@ public abstract class BaseStatusBar extends SystemUI implements } } for (int i = 0; i < N; i++) { for (int i = 0; i < N; i++) { NotificationData.Entry entry = activeNotifications.get(i); NotificationData.Entry entry = activeNotifications.get(i); boolean childNotification = mGroupManager.isChildInGroupWithSummary(entry.notification); if (onKeyguard) { if (onKeyguard) { entry.row.setOnKeyguard(true); entry.row.setOnKeyguard(true); } else { } else { entry.row.setOnKeyguard(false); entry.row.setOnKeyguard(false); boolean top = (i == 0); entry.row.setSystemExpanded(visibleNotifications == 0 && !childNotification); entry.row.setSystemExpanded(top); } } boolean childNotification = mGroupManager.isChildInGroupWithSummary(entry.notification); boolean suppressedSummary = mGroupManager.isSummaryOfSuppressedGroup(entry.notification); boolean childWithVisibleSummary = childNotification boolean childWithVisibleSummary = childNotification && mGroupManager.getGroupSummary(entry.notification).getVisibility() && mGroupManager.getGroupSummary(entry.notification).getVisibility() == View.VISIBLE; == View.VISIBLE; boolean showOnKeyguard = shouldShowOnKeyguard(entry.notification); boolean showOnKeyguard = shouldShowOnKeyguard(entry.notification); if ((isLockscreenPublicMode() && !mShowLockscreenNotifications) || if (suppressedSummary || (isLockscreenPublicMode() && !mShowLockscreenNotifications) || (onKeyguard && (visibleNotifications >= maxNotifications (onKeyguard && (visibleNotifications >= maxNotifications && !childWithVisibleSummary && !childWithVisibleSummary || !showOnKeyguard))) { || !showOnKeyguard))) { entry.row.setVisibility(View.GONE); entry.row.setVisibility(View.GONE); if (onKeyguard && showOnKeyguard && !childNotification) { if (onKeyguard && showOnKeyguard && !childNotification && !suppressedSummary) { mKeyguardIconOverflowContainer.getIconsView().addNotification(entry); mKeyguardIconOverflowContainer.getIconsView().addNotification(entry); } } } else { } else { Loading @@ -2082,7 +2082,8 @@ public abstract class BaseStatusBar extends SystemUI implements if (!childNotification) { if (!childNotification) { if (wasGone) { if (wasGone) { // notify the scroller of a child addition // notify the scroller of a child addition mStackScroller.generateAddAnimation(entry.row, true /* fromMoreCard */); mStackScroller.generateAddAnimation(entry.row, !showOnKeyguard /* fromMoreCard */); } } visibleNotifications++; visibleNotifications++; } } Loading packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +1 −4 Original line number Original line Diff line number Diff line Loading @@ -1026,11 +1026,8 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { private void onChildrenCountChanged() { private void onChildrenCountChanged() { mIsSummaryWithChildren = BaseStatusBar.ENABLE_CHILD_NOTIFICATIONS mIsSummaryWithChildren = BaseStatusBar.ENABLE_CHILD_NOTIFICATIONS && mGroupManager.hasGroupChildren(mStatusBarNotification); && mChildrenContainer != null && mChildrenContainer.getChildCount() > 0; if (mIsSummaryWithChildren) { if (mIsSummaryWithChildren) { if (mChildrenContainer == null) { mChildrenContainerStub.inflate(); } if (mNotificationHeader == null) { if (mNotificationHeader == null) { recreateNotificationHeader(); recreateNotificationHeader(); } } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationGroupManager.java +30 −22 Original line number Original line Diff line number Diff line Loading @@ -91,6 +91,7 @@ public class NotificationGroupManager implements HeadsUpManager.OnHeadsUpChanged } else { } else { group.summary = null; group.summary = null; } } updateSuppression(group); if (group.children.isEmpty()) { if (group.children.isEmpty()) { if (group.summary == null) { if (group.summary == null) { mGroupMap.remove(groupKey); mGroupMap.remove(groupKey); Loading @@ -109,15 +110,25 @@ public class NotificationGroupManager implements HeadsUpManager.OnHeadsUpChanged } } if (isGroupChild) { if (isGroupChild) { group.children.add(added); group.children.add(added); updateSuppression(group); } else { } else { group.summary = added; group.summary = added; group.expanded = added.row.areChildrenExpanded(); group.expanded = added.row.areChildrenExpanded(); updateSuppression(group); if (!group.children.isEmpty()) { if (!group.children.isEmpty()) { mListener.onGroupCreatedFromChildren(group); mListener.onGroupCreatedFromChildren(group); } } } } } } private void updateSuppression(NotificationGroup group) { boolean prevSuppressed = group.suppressed; group.suppressed = group.summary != null && group.children.size() == 1 && !group.expanded; if (prevSuppressed != group.suppressed) { mListener.onGroupsChanged(); } } public void onEntryUpdated(NotificationData.Entry entry, public void onEntryUpdated(NotificationData.Entry entry, StatusBarNotification oldNotification) { StatusBarNotification oldNotification) { if (mGroupMap.get(getGroupKey(oldNotification)) != null) { if (mGroupMap.get(getGroupKey(oldNotification)) != null) { Loading @@ -126,26 +137,17 @@ public class NotificationGroupManager implements HeadsUpManager.OnHeadsUpChanged onEntryAdded(entry); onEntryAdded(entry); } } public boolean isVisible(StatusBarNotification sbn) { public boolean isSummaryOfSuppressedGroup(StatusBarNotification sbn) { if (!isGroupChild(sbn)) { return isGroupSuppressed(sbn) && sbn.getNotification().isGroupSummary(); return true; } NotificationGroup group = mGroupMap.get(getGroupKey(sbn)); if (group != null && (group.expanded || group.summary == null)) { return true; } return false; } } public boolean hasGroupChildren(StatusBarNotification sbn) { public boolean isChildInSuppressedGroup(StatusBarNotification sbn) { if (!isGroupSummary(sbn)) { return isGroupSuppressed(sbn) && sbn.getNotification().isGroupChild(); return false; } } private boolean isGroupSuppressed(StatusBarNotification sbn) { NotificationGroup group = mGroupMap.get(getGroupKey(sbn)); NotificationGroup group = mGroupMap.get(getGroupKey(sbn)); if (group == null) { return group != null && group.suppressed; return false; } return !group.children.isEmpty(); } } public void setStatusBarState(int newState) { public void setStatusBarState(int newState) { Loading @@ -163,6 +165,7 @@ public class NotificationGroupManager implements HeadsUpManager.OnHeadsUpChanged if (group.expanded) { if (group.expanded) { setGroupExpanded(group, false); setGroupExpanded(group, false); } } updateSuppression(group); } } } } Loading @@ -174,7 +177,7 @@ public class NotificationGroupManager implements HeadsUpManager.OnHeadsUpChanged return false; return false; } } NotificationGroup group = mGroupMap.get(getGroupKey(sbn)); NotificationGroup group = mGroupMap.get(getGroupKey(sbn)); if (group == null || group.summary == null) { if (group == null || group.summary == null || group.suppressed) { return false; return false; } } return true; return true; Loading Loading @@ -258,7 +261,7 @@ public class NotificationGroupManager implements HeadsUpManager.OnHeadsUpChanged mHeadsUpedEntries.add(sbn.getKey()); mHeadsUpedEntries.add(sbn.getKey()); if (groupChild) { if (groupChild) { onEntryAdded(entry); onEntryAdded(entry); mListener.onChildIsolationChanged(); mListener.onGroupsChanged(); } } } } } else { } else { Loading @@ -271,7 +274,7 @@ public class NotificationGroupManager implements HeadsUpManager.OnHeadsUpChanged mHeadsUpedEntries.remove(sbn.getKey()); mHeadsUpedEntries.remove(sbn.getKey()); if (isolatedBefore) { if (isolatedBefore) { onEntryAdded(entry); onEntryAdded(entry); mListener.onChildIsolationChanged(); mListener.onGroupsChanged(); } } } } } } Loading @@ -281,6 +284,10 @@ public class NotificationGroupManager implements HeadsUpManager.OnHeadsUpChanged public final HashSet<NotificationData.Entry> children = new HashSet<>(); public final HashSet<NotificationData.Entry> children = new HashSet<>(); public NotificationData.Entry summary; public NotificationData.Entry summary; public boolean expanded; public boolean expanded; /** * Is this notification group suppressed, i.e its summary is hidden */ public boolean suppressed; } } public interface OnGroupChangeListener { public interface OnGroupChangeListener { Loading @@ -301,8 +308,9 @@ public class NotificationGroupManager implements HeadsUpManager.OnHeadsUpChanged void onGroupCreatedFromChildren(NotificationGroup group); void onGroupCreatedFromChildren(NotificationGroup group); /** /** * The isolation of a child has changed i.e it's group changes. * The groups have changed. This can happen if the isolation of a child has changes or if a * group became suppressed / unsuppressed */ */ void onChildIsolationChanged(); void onGroupsChanged(); } } } } packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java +3 −0 Original line number Original line Diff line number Diff line Loading @@ -114,6 +114,9 @@ public class NotificationIconAreaController { if (!PhoneStatusBar.isTopLevelChild(ent)) { if (!PhoneStatusBar.isTopLevelChild(ent)) { continue; continue; } } if (ent.row.getVisibility() == View.GONE) { continue; } toShow.add(ent.icon); toShow.add(ent.icon); } } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +6 −7 Original line number Original line Diff line number Diff line Loading @@ -132,6 +132,7 @@ import com.android.systemui.statusbar.DismissView; import com.android.systemui.statusbar.DragDownHelper; import com.android.systemui.statusbar.DragDownHelper; import com.android.systemui.statusbar.EmptyShadeView; import com.android.systemui.statusbar.EmptyShadeView; import com.android.systemui.statusbar.ExpandableNotificationRow; import com.android.systemui.statusbar.ExpandableNotificationRow; import com.android.systemui.statusbar.ExpandableView; import com.android.systemui.statusbar.GestureRecorder; import com.android.systemui.statusbar.GestureRecorder; import com.android.systemui.statusbar.KeyguardIndicationController; import com.android.systemui.statusbar.KeyguardIndicationController; import com.android.systemui.statusbar.NotificationData; import com.android.systemui.statusbar.NotificationData; Loading Loading @@ -1632,16 +1633,14 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, private void updateSpeedbump() { private void updateSpeedbump() { int speedbumpIndex = -1; int speedbumpIndex = -1; int currentIndex = 0; int currentIndex = 0; ArrayList<Entry> activeNotifications = mNotificationData.getActiveNotifications(); final int N = mStackScroller.getChildCount(); final int N = activeNotifications.size(); for (int i = 0; i < N; i++) { for (int i = 0; i < N; i++) { Entry entry = activeNotifications.get(i); View view = mStackScroller.getChildAt(i); boolean isChild = !isTopLevelChild(entry); if (view.getVisibility() == View.GONE || !(view instanceof ExpandableNotificationRow)) { if (isChild) { continue; continue; } } if (entry.row.getVisibility() != View.GONE && ExpandableNotificationRow row = (ExpandableNotificationRow) view; mNotificationData.isAmbient(entry.key)) { if (mNotificationData.isAmbient(row.getStatusBarNotification().getKey())) { speedbumpIndex = currentIndex; speedbumpIndex = currentIndex; break; break; } } Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +7 −6 Original line number Original line Diff line number Diff line Loading @@ -2056,24 +2056,24 @@ public abstract class BaseStatusBar extends SystemUI implements } } for (int i = 0; i < N; i++) { for (int i = 0; i < N; i++) { NotificationData.Entry entry = activeNotifications.get(i); NotificationData.Entry entry = activeNotifications.get(i); boolean childNotification = mGroupManager.isChildInGroupWithSummary(entry.notification); if (onKeyguard) { if (onKeyguard) { entry.row.setOnKeyguard(true); entry.row.setOnKeyguard(true); } else { } else { entry.row.setOnKeyguard(false); entry.row.setOnKeyguard(false); boolean top = (i == 0); entry.row.setSystemExpanded(visibleNotifications == 0 && !childNotification); entry.row.setSystemExpanded(top); } } boolean childNotification = mGroupManager.isChildInGroupWithSummary(entry.notification); boolean suppressedSummary = mGroupManager.isSummaryOfSuppressedGroup(entry.notification); boolean childWithVisibleSummary = childNotification boolean childWithVisibleSummary = childNotification && mGroupManager.getGroupSummary(entry.notification).getVisibility() && mGroupManager.getGroupSummary(entry.notification).getVisibility() == View.VISIBLE; == View.VISIBLE; boolean showOnKeyguard = shouldShowOnKeyguard(entry.notification); boolean showOnKeyguard = shouldShowOnKeyguard(entry.notification); if ((isLockscreenPublicMode() && !mShowLockscreenNotifications) || if (suppressedSummary || (isLockscreenPublicMode() && !mShowLockscreenNotifications) || (onKeyguard && (visibleNotifications >= maxNotifications (onKeyguard && (visibleNotifications >= maxNotifications && !childWithVisibleSummary && !childWithVisibleSummary || !showOnKeyguard))) { || !showOnKeyguard))) { entry.row.setVisibility(View.GONE); entry.row.setVisibility(View.GONE); if (onKeyguard && showOnKeyguard && !childNotification) { if (onKeyguard && showOnKeyguard && !childNotification && !suppressedSummary) { mKeyguardIconOverflowContainer.getIconsView().addNotification(entry); mKeyguardIconOverflowContainer.getIconsView().addNotification(entry); } } } else { } else { Loading @@ -2082,7 +2082,8 @@ public abstract class BaseStatusBar extends SystemUI implements if (!childNotification) { if (!childNotification) { if (wasGone) { if (wasGone) { // notify the scroller of a child addition // notify the scroller of a child addition mStackScroller.generateAddAnimation(entry.row, true /* fromMoreCard */); mStackScroller.generateAddAnimation(entry.row, !showOnKeyguard /* fromMoreCard */); } } visibleNotifications++; visibleNotifications++; } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +1 −4 Original line number Original line Diff line number Diff line Loading @@ -1026,11 +1026,8 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { private void onChildrenCountChanged() { private void onChildrenCountChanged() { mIsSummaryWithChildren = BaseStatusBar.ENABLE_CHILD_NOTIFICATIONS mIsSummaryWithChildren = BaseStatusBar.ENABLE_CHILD_NOTIFICATIONS && mGroupManager.hasGroupChildren(mStatusBarNotification); && mChildrenContainer != null && mChildrenContainer.getChildCount() > 0; if (mIsSummaryWithChildren) { if (mIsSummaryWithChildren) { if (mChildrenContainer == null) { mChildrenContainerStub.inflate(); } if (mNotificationHeader == null) { if (mNotificationHeader == null) { recreateNotificationHeader(); recreateNotificationHeader(); } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationGroupManager.java +30 −22 Original line number Original line Diff line number Diff line Loading @@ -91,6 +91,7 @@ public class NotificationGroupManager implements HeadsUpManager.OnHeadsUpChanged } else { } else { group.summary = null; group.summary = null; } } updateSuppression(group); if (group.children.isEmpty()) { if (group.children.isEmpty()) { if (group.summary == null) { if (group.summary == null) { mGroupMap.remove(groupKey); mGroupMap.remove(groupKey); Loading @@ -109,15 +110,25 @@ public class NotificationGroupManager implements HeadsUpManager.OnHeadsUpChanged } } if (isGroupChild) { if (isGroupChild) { group.children.add(added); group.children.add(added); updateSuppression(group); } else { } else { group.summary = added; group.summary = added; group.expanded = added.row.areChildrenExpanded(); group.expanded = added.row.areChildrenExpanded(); updateSuppression(group); if (!group.children.isEmpty()) { if (!group.children.isEmpty()) { mListener.onGroupCreatedFromChildren(group); mListener.onGroupCreatedFromChildren(group); } } } } } } private void updateSuppression(NotificationGroup group) { boolean prevSuppressed = group.suppressed; group.suppressed = group.summary != null && group.children.size() == 1 && !group.expanded; if (prevSuppressed != group.suppressed) { mListener.onGroupsChanged(); } } public void onEntryUpdated(NotificationData.Entry entry, public void onEntryUpdated(NotificationData.Entry entry, StatusBarNotification oldNotification) { StatusBarNotification oldNotification) { if (mGroupMap.get(getGroupKey(oldNotification)) != null) { if (mGroupMap.get(getGroupKey(oldNotification)) != null) { Loading @@ -126,26 +137,17 @@ public class NotificationGroupManager implements HeadsUpManager.OnHeadsUpChanged onEntryAdded(entry); onEntryAdded(entry); } } public boolean isVisible(StatusBarNotification sbn) { public boolean isSummaryOfSuppressedGroup(StatusBarNotification sbn) { if (!isGroupChild(sbn)) { return isGroupSuppressed(sbn) && sbn.getNotification().isGroupSummary(); return true; } NotificationGroup group = mGroupMap.get(getGroupKey(sbn)); if (group != null && (group.expanded || group.summary == null)) { return true; } return false; } } public boolean hasGroupChildren(StatusBarNotification sbn) { public boolean isChildInSuppressedGroup(StatusBarNotification sbn) { if (!isGroupSummary(sbn)) { return isGroupSuppressed(sbn) && sbn.getNotification().isGroupChild(); return false; } } private boolean isGroupSuppressed(StatusBarNotification sbn) { NotificationGroup group = mGroupMap.get(getGroupKey(sbn)); NotificationGroup group = mGroupMap.get(getGroupKey(sbn)); if (group == null) { return group != null && group.suppressed; return false; } return !group.children.isEmpty(); } } public void setStatusBarState(int newState) { public void setStatusBarState(int newState) { Loading @@ -163,6 +165,7 @@ public class NotificationGroupManager implements HeadsUpManager.OnHeadsUpChanged if (group.expanded) { if (group.expanded) { setGroupExpanded(group, false); setGroupExpanded(group, false); } } updateSuppression(group); } } } } Loading @@ -174,7 +177,7 @@ public class NotificationGroupManager implements HeadsUpManager.OnHeadsUpChanged return false; return false; } } NotificationGroup group = mGroupMap.get(getGroupKey(sbn)); NotificationGroup group = mGroupMap.get(getGroupKey(sbn)); if (group == null || group.summary == null) { if (group == null || group.summary == null || group.suppressed) { return false; return false; } } return true; return true; Loading Loading @@ -258,7 +261,7 @@ public class NotificationGroupManager implements HeadsUpManager.OnHeadsUpChanged mHeadsUpedEntries.add(sbn.getKey()); mHeadsUpedEntries.add(sbn.getKey()); if (groupChild) { if (groupChild) { onEntryAdded(entry); onEntryAdded(entry); mListener.onChildIsolationChanged(); mListener.onGroupsChanged(); } } } } } else { } else { Loading @@ -271,7 +274,7 @@ public class NotificationGroupManager implements HeadsUpManager.OnHeadsUpChanged mHeadsUpedEntries.remove(sbn.getKey()); mHeadsUpedEntries.remove(sbn.getKey()); if (isolatedBefore) { if (isolatedBefore) { onEntryAdded(entry); onEntryAdded(entry); mListener.onChildIsolationChanged(); mListener.onGroupsChanged(); } } } } } } Loading @@ -281,6 +284,10 @@ public class NotificationGroupManager implements HeadsUpManager.OnHeadsUpChanged public final HashSet<NotificationData.Entry> children = new HashSet<>(); public final HashSet<NotificationData.Entry> children = new HashSet<>(); public NotificationData.Entry summary; public NotificationData.Entry summary; public boolean expanded; public boolean expanded; /** * Is this notification group suppressed, i.e its summary is hidden */ public boolean suppressed; } } public interface OnGroupChangeListener { public interface OnGroupChangeListener { Loading @@ -301,8 +308,9 @@ public class NotificationGroupManager implements HeadsUpManager.OnHeadsUpChanged void onGroupCreatedFromChildren(NotificationGroup group); void onGroupCreatedFromChildren(NotificationGroup group); /** /** * The isolation of a child has changed i.e it's group changes. * The groups have changed. This can happen if the isolation of a child has changes or if a * group became suppressed / unsuppressed */ */ void onChildIsolationChanged(); void onGroupsChanged(); } } } }
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java +3 −0 Original line number Original line Diff line number Diff line Loading @@ -114,6 +114,9 @@ public class NotificationIconAreaController { if (!PhoneStatusBar.isTopLevelChild(ent)) { if (!PhoneStatusBar.isTopLevelChild(ent)) { continue; continue; } } if (ent.row.getVisibility() == View.GONE) { continue; } toShow.add(ent.icon); toShow.add(ent.icon); } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +6 −7 Original line number Original line Diff line number Diff line Loading @@ -132,6 +132,7 @@ import com.android.systemui.statusbar.DismissView; import com.android.systemui.statusbar.DragDownHelper; import com.android.systemui.statusbar.DragDownHelper; import com.android.systemui.statusbar.EmptyShadeView; import com.android.systemui.statusbar.EmptyShadeView; import com.android.systemui.statusbar.ExpandableNotificationRow; import com.android.systemui.statusbar.ExpandableNotificationRow; import com.android.systemui.statusbar.ExpandableView; import com.android.systemui.statusbar.GestureRecorder; import com.android.systemui.statusbar.GestureRecorder; import com.android.systemui.statusbar.KeyguardIndicationController; import com.android.systemui.statusbar.KeyguardIndicationController; import com.android.systemui.statusbar.NotificationData; import com.android.systemui.statusbar.NotificationData; Loading Loading @@ -1632,16 +1633,14 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, private void updateSpeedbump() { private void updateSpeedbump() { int speedbumpIndex = -1; int speedbumpIndex = -1; int currentIndex = 0; int currentIndex = 0; ArrayList<Entry> activeNotifications = mNotificationData.getActiveNotifications(); final int N = mStackScroller.getChildCount(); final int N = activeNotifications.size(); for (int i = 0; i < N; i++) { for (int i = 0; i < N; i++) { Entry entry = activeNotifications.get(i); View view = mStackScroller.getChildAt(i); boolean isChild = !isTopLevelChild(entry); if (view.getVisibility() == View.GONE || !(view instanceof ExpandableNotificationRow)) { if (isChild) { continue; continue; } } if (entry.row.getVisibility() != View.GONE && ExpandableNotificationRow row = (ExpandableNotificationRow) view; mNotificationData.isAmbient(entry.key)) { if (mNotificationData.isAmbient(row.getStatusBarNotification().getKey())) { speedbumpIndex = currentIndex; speedbumpIndex = currentIndex; break; break; } } Loading