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

Commit e62d7d50 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Remove some duplicated code of transient launch

The inRecentsTransition is the same as isTransientHide, while the
latter might be a bit more efficient.

Also use asyncTraceForTrackBegin to make the trace display
in the same row of perfetto view.

Bug: 275508603
Test: CtsActivityManagerDeviceTestCases
Change-Id: I0326035a1c63cda1581cc017074983ecb05596bc
parent ebba1751
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -466,8 +466,7 @@ abstract class AbsAppSnapshotController<TYPE extends WindowContainer,
    }
    }


    boolean isAnimatingByRecents(@NonNull Task task) {
    boolean isAnimatingByRecents(@NonNull Task task) {
        return task.isAnimatingByRecents()
        return task.isAnimatingByRecents();
                || mService.mAtmService.getTransitionController().inRecentsTransition(task);
    }
    }


    void dump(PrintWriter pw, String prefix) {
    void dump(PrintWriter pw, String prefix) {
+1 −2
Original line number Original line Diff line number Diff line
@@ -3543,8 +3543,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
                // the best capture timing (e.g. IME window capture),
                // the best capture timing (e.g. IME window capture),
                // No need additional task capture while task is controlled by RecentsAnimation.
                // No need additional task capture while task is controlled by RecentsAnimation.
                if (mAtmService.mWindowManager.mTaskSnapshotController != null
                if (mAtmService.mWindowManager.mTaskSnapshotController != null
                        && !(task.isAnimatingByRecents()
                        && !task.isAnimatingByRecents()) {
                                || mTransitionController.inRecentsTransition(task))) {
                    final ArraySet<Task> tasks = Sets.newArraySet(task);
                    final ArraySet<Task> tasks = Sets.newArraySet(task);
                    mAtmService.mWindowManager.mTaskSnapshotController.snapshotTasks(tasks);
                    mAtmService.mWindowManager.mTaskSnapshotController.snapshotTasks(tasks);
                    mAtmService.mWindowManager.mTaskSnapshotController
                    mAtmService.mWindowManager.mTaskSnapshotController
+0 −1
Original line number Original line Diff line number Diff line
@@ -577,7 +577,6 @@ public class ActivityStartController {
            final Transition transition = controller.getCollectingTransition();
            final Transition transition = controller.getCollectingTransition();
            if (transition != null) {
            if (transition != null) {
                transition.setRemoteAnimationApp(r.app.getThread());
                transition.setRemoteAnimationApp(r.app.getThread());
                controller.collect(task);
                controller.setTransientLaunch(r, TaskDisplayArea.getRootTaskAbove(rootTask));
                controller.setTransientLaunch(r, TaskDisplayArea.getRootTaskAbove(rootTask));
            }
            }
            task.moveToFront("startExistingRecents");
            task.moveToFront("startExistingRecents");
+1 −0
Original line number Original line Diff line number Diff line
@@ -2546,6 +2546,7 @@ class ActivityStarter {
        mAvoidMoveToFront = false;
        mAvoidMoveToFront = false;
        mFrozeTaskList = false;
        mFrozeTaskList = false;
        mTransientLaunch = false;
        mTransientLaunch = false;
        mPriorAboveTask = null;
        mDisplayLockAndOccluded = false;
        mDisplayLockAndOccluded = false;


        mVoiceSession = null;
        mVoiceSession = null;
+2 −1
Original line number Original line Diff line number Diff line
@@ -3008,7 +3008,8 @@ class Task extends TaskFragment {


    /** Checking if self or its child tasks are animated by recents animation. */
    /** Checking if self or its child tasks are animated by recents animation. */
    boolean isAnimatingByRecents() {
    boolean isAnimatingByRecents() {
        return isAnimating(CHILDREN, ANIMATION_TYPE_RECENTS);
        return isAnimating(CHILDREN, ANIMATION_TYPE_RECENTS)
                || mTransitionController.isTransientHide(this);
    }
    }


    WindowState getTopVisibleAppMainWindow() {
    WindowState getTopVisibleAppMainWindow() {
Loading