diff options
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java | 8 |
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 f7615e6448db..f524693015c9 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java @@ -435,7 +435,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; } @@ -452,7 +454,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); } } |