Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b274079f authored by Robert Snoeberger's avatar Robert Snoeberger
Browse files

Check that ViewTreeObserver is alive before unregistering listener.

Test: Current tests cover.
Bug: 113260844
Change-Id: I2abfc9d475504a6c7baad733dd5a95af79e89daf
parent b3b8d16d
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -435,7 +435,9 @@ public class NotificationShelf extends ActivatableNotificationView implements
                        public boolean onPreDraw() {
                            boolean animatingY = ViewState.isAnimatingY(icon);
                            if (!animatingY) {
                                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) {
                        if (observer.isAlive()) {
                            observer.removeOnPreDrawListener(predrawListener);
                        }
                        icon.setTag(TAG_CONTINUOUS_CLIPPING, null);
                    }
                }