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

Commit 5690a578 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Fix NPE in allowOverlappingTransitions

The OneShotPreDrawListener from triggerViewsReady() ->
sendSharedElementDestination() may be called after clearState() if
the activity has stopped before allowing to draw. Then it will cause
NPE because clearState() set mWindow to null.

Bug: 306974798
Test: Use scene transition and stop draw by pre-draw listener.
      Then allow to draw after activity is stopped.
Change-Id: I3a714f97a6abcee51ca004ca3c919250c5d5257f
parent c9d20f37
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -706,8 +706,12 @@ class EnterTransitionCoordinator extends ActivityTransitionCoordinator {
    }

    private boolean allowOverlappingTransitions() {
        return mIsReturning ? getWindow().getAllowReturnTransitionOverlap()
                : getWindow().getAllowEnterTransitionOverlap();
        final Window window = getWindow();
        if (window == null) {
            return false;
        }
        return mIsReturning ? window.getAllowReturnTransitionOverlap()
                : window.getAllowEnterTransitionOverlap();
    }

    private void startRejectedAnimations(final ArrayList<View> rejectedSnapshots) {