Merge "Fixed a crash with the autocancelling" into nyc-dev am: 4a4b76f6e8 am: 45df222972

am: eca834dd8c

* commit 'eca834dd8c8b4acbb8a6a870d76e9fb74dcdcc4e':
  Fixed a crash with the autocancelling

Change-Id: If9343d4a276de3b81270221f74a9468e44a9274a
This commit is contained in:
Selim Cinek
2016-05-23 19:35:04 +00:00
committed by android-build-merger

View File

@@ -215,17 +215,23 @@ public class NotificationGroupManager implements HeadsUpManager.OnHeadsUpChanged
public boolean isOnlyChildInSuppressedGroup(StatusBarNotification sbn) {
return isGroupSuppressed(sbn.getGroupKey())
&& isOnlyChildInGroup(sbn);
&& isOnlyChild(sbn);
}
public boolean isOnlyChildInGroup(StatusBarNotification sbn) {
private boolean isOnlyChild(StatusBarNotification sbn) {
return !sbn.getNotification().isGroupSummary()
&& getTotalNumberOfChildren(sbn) == 1;
}
public boolean isOnlyChildInGroup(StatusBarNotification sbn) {
return isOnlyChild(sbn) && getLogicalGroupSummary(sbn) != null;
}
private int getTotalNumberOfChildren(StatusBarNotification sbn) {
return getNumberOfIsolatedChildren(sbn.getGroupKey())
+ mGroupMap.get(sbn.getGroupKey()).children.size();
int isolatedChildren = getNumberOfIsolatedChildren(sbn.getGroupKey());
NotificationGroup group = mGroupMap.get(sbn.getGroupKey());
int realChildren = group != null ? group.children.size() : 0;
return isolatedChildren + realChildren;
}
private boolean isGroupSuppressed(String groupKey) {