Isolate mAnimationCompleteLock from mSync.

Sometimes the test fail because activity starts for more than 5
seconds, and it seems only happen when calling startActivitySync
and running for split screen tests.

If there are two activities A and B are running in the same
process. Consider the following sequence:

1. Start ActivityA then move it to primary split screen.
2. Start ActivityB with startActivitySync, it would launched on
second split screen and wait for enter animation complete.
3. Resume ActivityA naturally, but since ActivityB is blocking mSync
in waitForEnterAnimationComplete, performResume for ActivityA would
waiting for mSync on main thread.
4. Animation complete, scheduleEnterAnimationComplete for ActivityB,
however ENTER_ANIMATION_COMPLETE cannot be executed due to main
thread was blocked.
The deadlock occurs until mAnimationCompleteLock timeout.

Note: There is also another case where the first activity is started
more than 5 seconds at the beginning of the test.

Bug: 127741025
Test: atest ActivityThreadTest
Test: atest android.server.wm.lifecycle
Change-Id: I8b4fe44f962dd31d130ee6b38dabf6e0c90b4060
1 file changed