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

Commit 648fb1d9 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Isolate mAnimationCompleteLock from mSync."

parents 5bac3f05 29fd42c9
Loading
Loading
Loading
Loading
+10 −7
Original line number Diff line number Diff line
@@ -493,6 +493,7 @@ public class Instrumentation {
    public Activity startActivitySync(@NonNull Intent intent, @Nullable Bundle options) {
        validateNotAppThread();

        final Activity activity;
        synchronized (mSync) {
            intent = new Intent(intent);

@@ -527,16 +528,18 @@ public class Instrumentation {
                } catch (InterruptedException e) {
                }
            } while (mWaitingActivities.contains(aw));
            activity = aw.activity;
        }

            waitForEnterAnimationComplete(aw.activity);
        // Do not call this method within mSync, lest it could block the main thread.
        waitForEnterAnimationComplete(activity);

        // Apply an empty transaction to ensure SF has a chance to update before
        // the Activity is ready (b/138263890).
        try (SurfaceControl.Transaction t = new SurfaceControl.Transaction()) {
            t.apply(true);
        }
            return aw.activity;
        }
        return activity;
    }

    /**