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

Skip to content
Commit df830e17 authored by Jordan Demeulenaere's avatar Jordan Demeulenaere
Browse files

Post ActivityLaunchAnimator timeout on Looper.mainLooper()

This CL fixes weird shade state bugs that can happen during Activity
launches animated by the ActivityLaunchAnimator.

Before this CL, if a WindowManager timeout happened (i.e. WM never
starts or cancels the remote animation) *and* that the launchContainer
(the ViewRootImpl where the launch started) was detached, then the
timeout would never be triggered, leaving our UI in an invalid state.
This bug is currently easily reproducible using the steps from
b/300056100#comment4, where we incorrectly animate an activity launch
from a dialog then instantly dismiss that dialog.

This CL fixes this bug by posting the timeout on Looper.getMainLooper()
instead of using launchContainer.postDelayed(). That way, the timeout is
always called after 1s if WM didn't start or cancel the remote
animation.

I suspect that this is somehow what is also happening with b/288507023,
but I was not able to confirm this theory yet.

Bug: b/300056100
Bug: b/288507023
Test: Manual, made sure that b/300056100#comment4 is not reproducible
 with this CL. Unfortunately ActivityLaunchAnimator is in a separate
 library so it can't use our DelayableExecutor (that is testable), so
 I don't think there is a good way to write a unit test for this.
Change-Id: Iaa019d6d0aabdf97af0cb6995ad81270f275f3e7
parent 742e559d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment