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

Commit 8edc0dfc authored by Tony Huang's avatar Tony Huang Committed by Android (Google) Code Review
Browse files

Merge "Add jank instrument support for split screen" into tm-dev

parents 2e255ed0 8f994ea7
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import com.android.quickstep.util.CancellableTask;
import com.android.quickstep.util.RecentsOrientedState;
import com.android.systemui.shared.recents.model.Task;
import com.android.systemui.shared.recents.model.ThumbnailData;
import com.android.systemui.shared.system.InteractionJankMonitorWrapper;

import java.util.HashMap;
import java.util.function.Consumer;
@@ -171,8 +172,14 @@ public class GroupedTaskView extends TaskView {
        RunnableList endCallback = new RunnableList();
        RecentsView recentsView = getRecentsView();
        // Callbacks run from remote animation when recents animation not currently running
        InteractionJankMonitorWrapper.begin(this,
                InteractionJankMonitorWrapper.CUJ_SPLIT_SCREEN_ENTER, "Enter form GroupedTaskView");
        recentsView.getSplitPlaceholder().launchTasks(this /*groupedTaskView*/,
                success -> endCallback.executeAllAndDestroy(),
                success -> {
                    endCallback.executeAllAndDestroy();
                    InteractionJankMonitorWrapper.end(
                            InteractionJankMonitorWrapper.CUJ_SPLIT_SCREEN_ENTER);
                },
                false /* freezeTaskList */);

        // Callbacks get run from recentsView for case when recents animation already running
+15 −3
Original line number Diff line number Diff line
@@ -175,6 +175,7 @@ import com.android.systemui.plugins.ResourceProvider;
import com.android.systemui.shared.recents.model.Task;
import com.android.systemui.shared.recents.model.ThumbnailData;
import com.android.systemui.shared.system.ActivityManagerWrapper;
import com.android.systemui.shared.system.InteractionJankMonitorWrapper;
import com.android.systemui.shared.system.PackageManagerWrapper;
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
import com.android.systemui.shared.system.SyncRtSurfaceTransactionApplierCompat.SurfaceParams;
@@ -2744,9 +2745,16 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
            mFirstFloatingTaskView.addAnimation(anim, startingTaskRect,
                    mTempRect, true /* fadeWithThumbnail */, true /* isStagedTask */);
        }
        InteractionJankMonitorWrapper.begin(this,
                InteractionJankMonitorWrapper.CUJ_SPLIT_SCREEN_ENTER, "First tile selected");
        anim.addEndListener(success -> {
            if (success) {
                mSplitToast.show();
                InteractionJankMonitorWrapper.end(
                        InteractionJankMonitorWrapper.CUJ_SPLIT_SCREEN_ENTER);
            } else {
                InteractionJankMonitorWrapper.cancel(
                        InteractionJankMonitorWrapper.CUJ_SPLIT_SCREEN_ENTER);
            }
        });
    }
@@ -4040,9 +4048,11 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
        mSecondFloatingTaskView.setAlpha(1);
        mSecondFloatingTaskView.addAnimation(pendingAnimation, secondTaskStartingBounds,
                secondTaskEndingBounds, true /* fadeWithThumbnail */, false /* isStagedTask */);
        pendingAnimation.addEndListener(aBoolean ->
        pendingAnimation.addEndListener(aBoolean -> {
            mSplitSelectStateController.launchSplitTasks(
                        aBoolean1 -> RecentsView.this.resetFromSplitSelectionState()));
                    aBoolean1 -> RecentsView.this.resetFromSplitSelectionState());
            InteractionJankMonitorWrapper.end(InteractionJankMonitorWrapper.CUJ_SPLIT_SCREEN_ENTER);
        });
        if (containerTaskView.containsMultipleTasks()) {
            // If we are launching from a child task, then only hide the thumbnail itself
            mSecondSplitHiddenView = thumbnailView;
@@ -4050,6 +4060,8 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
            mSecondSplitHiddenView = containerTaskView;
        }
        mSecondSplitHiddenView.setVisibility(INVISIBLE);
        InteractionJankMonitorWrapper.begin(this,
                InteractionJankMonitorWrapper.CUJ_SPLIT_SCREEN_ENTER, "Second tile selected");
        pendingAnimation.buildAnim().start();
        return true;
    }