Fixes a usability issue where groups were clearable

If any child is not dismissable the summary now also becomes
non-dismissable.

Change-Id: I4a7b64dc6cd2151f46b4034195b895bfb868a990
Fixes: 30182606
This commit is contained in:
Selim Cinek
2016-07-20 15:43:59 -07:00
parent 9e624e732a
commit 506deb69a7

View File

@@ -1175,7 +1175,20 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
* @see #canViewBeDismissed()
*/
public boolean isClearable() {
return mStatusBarNotification != null && mStatusBarNotification.isClearable();
if (mStatusBarNotification == null || !mStatusBarNotification.isClearable()) {
return false;
}
if (mIsSummaryWithChildren) {
List<ExpandableNotificationRow> notificationChildren =
mChildrenContainer.getNotificationChildren();
for (int i = 0; i < notificationChildren.size(); i++) {
ExpandableNotificationRow child = notificationChildren.get(i);
if (!child.isClearable()) {
return false;
}
}
}
return true;
}
@Override