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

Commit a338219a authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Fix threading issue with splash screens

If we use a different thread to remove the view than we added it,
it leads to suffering. WindowManagerGlobal.removeView ends up
setting mParent of the DecorView to null, without any locking,
which can lead to crashes.

Test: Device boots, starting windows work. Otherwise: Pray
Change-Id: Ifc1e0d0236746aef4ed2b63e08af7de695ce69aa
Fixes: 63664477
parent 331a2876
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -685,7 +685,10 @@ public class AppWindowContainerController

            if (DEBUG_STARTING_WINDOW) Slog.v(TAG_WM, "Schedule remove starting " + mContainer
                    + " startingWindow=" + mContainer.startingWindow);
            mHandler.post(mRemoveStartingWindow);

            // Use the same thread to remove the window as we used to add it, as otherwise we end up
            // with things in the view hierarchy being called from different threads.
            mService.mAnimationHandler.post(mRemoveStartingWindow);
        }
    }