summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2018-10-10 19:28:31 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2018-10-10 19:28:31 +0000
commit3109f4a1dbdc26aa2772069cbcfe27a98a884a77 (patch)
tree51cae8441e4c65206e12d1d1e3c95b790cb54a3a
parentc6426b0e4107f319262124697d86c9ff3ff43761 (diff)
parentb274079f209625501e0703e442cdfde6475b2a33 (diff)
Merge "Check that ViewTreeObserver is alive before unregistering listener."
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
index d8f7b6142dd8..7fa042655e53 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
@@ -436,7 +436,9 @@ public class NotificationShelf extends ActivatableNotificationView implements
public boolean onPreDraw() {
boolean animatingY = ViewState.isAnimatingY(icon);
if (!animatingY) {
- observer.removeOnPreDrawListener(this);
+ if (observer.isAlive()) {
+ observer.removeOnPreDrawListener(this);
+ }
icon.setTag(TAG_CONTINUOUS_CLIPPING, null);
return true;
}
@@ -453,7 +455,9 @@ public class NotificationShelf extends ActivatableNotificationView implements
@Override
public void onViewDetachedFromWindow(View v) {
if (v == icon) {
- observer.removeOnPreDrawListener(predrawListener);
+ if (observer.isAlive()) {
+ observer.removeOnPreDrawListener(predrawListener);
+ }
icon.setTag(TAG_CONTINUOUS_CLIPPING, null);
}
}