Merge changes Ib1728d85,Ia5683a28 into udc-qpr-dev

* changes:
  Add test logs for animating in split launch
  Add granular transition names for launching split
This commit is contained in:
Vinit Nayak
2023-07-19 20:56:30 +00:00
committed by Android (Google) Code Review
3 changed files with 16 additions and 5 deletions
@@ -38,6 +38,8 @@ import static com.android.launcher3.QuickstepTransitionManager.RECENTS_LAUNCH_DU
import static com.android.launcher3.QuickstepTransitionManager.SPLIT_DIVIDER_ANIM_DURATION;
import static com.android.launcher3.QuickstepTransitionManager.SPLIT_LAUNCH_DURATION;
import static com.android.launcher3.Utilities.getDescendantCoordRelativeToAncestor;
import static com.android.launcher3.testing.shared.TestProtocol.LAUNCH_SPLIT_PAIR;
import static com.android.launcher3.testing.shared.TestProtocol.testLogD;
import static com.android.launcher3.util.MultiPropertyFactory.MULTI_PROPERTY_VALUE;
import static com.android.quickstep.views.DesktopTaskView.DESKTOP_MODE_SUPPORTED;
@@ -431,6 +433,7 @@ public final class TaskViewUtils {
int initialTaskId, int secondTaskId, @NonNull TransitionInfo transitionInfo,
SurfaceControl.Transaction t, @NonNull Runnable finishCallback) {
if (launchingTaskView != null) {
testLogD(LAUNCH_SPLIT_PAIR, "composeRecentsSplitLaunchAnimator taskView not-null");
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.addListener(new AnimatorListenerAdapter() {
@Override
@@ -463,7 +466,10 @@ public final class TaskViewUtils {
TransitionInfo.Change splitRoot2 = null;
for (int i = 0; i < transitionInfo.getChanges().size(); ++i) {
final TransitionInfo.Change change = transitionInfo.getChanges().get(i);
if (change.getTaskInfo() == null) continue;
if (change.getTaskInfo() == null) {
testLogD(LAUNCH_SPLIT_PAIR, "changeTaskInfo null; change: " + change);
continue;
}
final int taskId = change.getTaskInfo().taskId;
final int mode = change.getMode();
@@ -499,6 +505,7 @@ public final class TaskViewUtils {
private static void animateSplitRoot(SurfaceControl.Transaction t,
TransitionInfo.Change splitRoot) {
testLogD(LAUNCH_SPLIT_PAIR, "animateSplitRoot: " + splitRoot);
if (splitRoot != null) {
t.show(splitRoot.getLeash());
t.setAlpha(splitRoot.getLeash(), 1.f);
@@ -17,6 +17,8 @@
package com.android.quickstep.util;
import static com.android.launcher3.Utilities.postAsyncCallback;
import static com.android.launcher3.testing.shared.TestProtocol.LAUNCH_SPLIT_PAIR;
import static com.android.launcher3.testing.shared.TestProtocol.testLogD;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.launcher3.util.SplitConfigurationOptions.DEFAULT_SPLIT_RATIO;
import static com.android.quickstep.util.SplitSelectDataHolder.SPLIT_PENDINGINTENT_PENDINGINTENT;
@@ -293,7 +295,7 @@ public class SplitSelectStateController {
if (TaskAnimationManager.ENABLE_SHELL_TRANSITIONS) {
final RemoteTransition remoteTransition = getShellRemoteTransition(firstTaskId,
secondTaskId, callback);
secondTaskId, callback, "LaunchSplitPair");
switch (launchData.getSplitLaunchType()) {
case SPLIT_TASK_TASK ->
mSystemUiProxy.startTasks(firstTaskId, optionsBundle, secondTaskId,
@@ -385,7 +387,7 @@ public class SplitSelectStateController {
if (TaskAnimationManager.ENABLE_SHELL_TRANSITIONS) {
final RemoteTransition remoteTransition = getShellRemoteTransition(firstTaskId,
secondTaskId, callback);
secondTaskId, callback, "LaunchExistingPair");
mSystemUiProxy.startTasks(firstTaskId, optionsBundle, secondTaskId,
null /* options2 */, stagePosition, splitRatio,
remoteTransition, null /*shellInstanceId*/);
@@ -455,11 +457,11 @@ public class SplitSelectStateController {
}
private RemoteTransition getShellRemoteTransition(int firstTaskId, int secondTaskId,
Consumer<Boolean> callback) {
Consumer<Boolean> callback, String transitionName) {
final RemoteSplitLaunchTransitionRunner animationRunner =
new RemoteSplitLaunchTransitionRunner(firstTaskId, secondTaskId, callback);
return new RemoteTransition(animationRunner,
ActivityThread.currentActivityThread().getApplicationThread(), "LaunchSplitPair");
ActivityThread.currentActivityThread().getApplicationThread(), transitionName);
}
private RemoteAnimationAdapter getLegacyRemoteAdapter(int firstTaskId, int secondTaskId,
@@ -522,6 +524,7 @@ public class SplitSelectStateController {
public void startAnimation(IBinder transition, TransitionInfo info,
SurfaceControl.Transaction t,
IRemoteTransitionFinishedCallback finishedCallback) {
testLogD(LAUNCH_SPLIT_PAIR, "Received split startAnimation");
final Runnable finishAdapter = () -> {
try {
finishedCallback.onTransitionFinished(null /* wct */, null /* sct */);
@@ -157,6 +157,7 @@ public final class TestProtocol {
public static final String TWO_TASKBAR_LONG_CLICKS = "b/262282528";
public static final String FLAKY_ACTIVITY_COUNT = "b/260260325";
public static final String ICON_MISSING = "b/282963545";
public static final String LAUNCH_SPLIT_PAIR = "b/288939273";
public static final String REQUEST_EMULATE_DISPLAY = "emulate-display";
public static final String REQUEST_STOP_EMULATE_DISPLAY = "stop-emulate-display";