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

Commit bfde6b2e authored by Schneider Victor-tulias's avatar Schneider Victor-tulias
Browse files

Fix a potential null-pointer onActivityDestroyed

Fixes: 234082544
Test: started recents from a large screen and phone
Change-Id: I54ee93793ec146d1b0b0f00f23256aaca5975bc0
parent 3bc7b93e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -866,6 +866,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
        TaskUtils.closeSystemWindowsAsync(CLOSE_SYSTEM_WINDOWS_REASON_RECENTS);

        if (mRecentsView != null) {
            final View rv = mRecentsView;
            mRecentsView.getViewTreeObserver().addOnDrawListener(new OnDrawListener() {
                boolean mHandled = false;

@@ -881,8 +882,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
                    InteractionJankMonitorWrapper.begin(mRecentsView,
                            InteractionJankMonitorWrapper.CUJ_APP_CLOSE_TO_HOME);

                    mRecentsView.post(() ->
                            mRecentsView.getViewTreeObserver().removeOnDrawListener(this));
                    rv.post(() -> rv.getViewTreeObserver().removeOnDrawListener(this));
                }
            });
        }