summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI
diff options
context:
space:
mode:
authorSelim Cinek <cinek@google.com>2015-05-21 12:11:12 -0700
committerSelim Cinek <cinek@google.com>2015-05-21 23:35:52 +0000
commitffa6eb8791b65d3959682ee187124c1a06d28884 (patch)
treee2b55c5f9e38744cec1a76a6bcc981ca32a84ca1 /packages/SystemUI
parent769832d11163abaa8a355650e796c2e39d7e0f3d (diff)
downloadframeworks_base-ffa6eb8791b65d3959682ee187124c1a06d28884.zip
frameworks_base-ffa6eb8791b65d3959682ee187124c1a06d28884.tar.gz
frameworks_base-ffa6eb8791b65d3959682ee187124c1a06d28884.tar.bz2
Fixed a crash with HUN notifications
Bug: 20925733 Change-Id: Id96c9e476d9faa770b5bcd3c35213dd0debdeaea
Diffstat (limited to 'packages/SystemUI')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
index bd3b9eb..e73c593 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
@@ -1656,7 +1656,7 @@ public class NotificationStackScrollLayout extends ViewGroup
*/
private boolean generateRemoveAnimation(View child) {
if (mIsExpanded && mAnimationsEnabled && !isChildInInvisibleGroup(child)) {
- if (!mChildrenToAddAnimated.contains(child)) {
+ if (!mChildrenToAddAnimated.contains(child) && !mAddedHeadsUpChildren.contains(child)) {
// Generate Animations
mChildrenToRemoveAnimated.add(child);
mNeedsAnimation = true;
@@ -1664,12 +1664,27 @@ public class NotificationStackScrollLayout extends ViewGroup
} else {
mChildrenToAddAnimated.remove(child);
mFromMoreCardAdditions.remove(child);
+ boolean remove = mAddedHeadsUpChildren.remove(child);
+ if (remove) {
+ removeChildFromHeadsUpChangeAnimations(child);
+ }
return false;
}
}
return false;
}
+ private void removeChildFromHeadsUpChangeAnimations(View child) {
+ ArrayList<Pair<ExpandableNotificationRow, Boolean> > toRemove = new ArrayList<>();
+ for (Pair<ExpandableNotificationRow, Boolean> eventPair : mHeadsUpChangeAnimations) {
+ ExpandableNotificationRow row = eventPair.first;
+ if (child == row) {
+ toRemove.add(eventPair);
+ }
+ }
+ mHeadsUpChangeAnimations.removeAll(toRemove);
+ }
+
/**
* @param child the child to query
* @return whether a view is not a top level child but a child notification and that group is