Fix divider not updated when moving split-tasks from fold -> unfold

As starting unfold transition animation that the running split-tasks may
not yet visible and the transition type could possible be
TRSANSIT_TO_FRONT instead of TRANSIT_CHANGE depends on the user
unfolding speed and the display power state, which leads to the
SplitTaskUnfoldAnimator could not receive onTaskAppeared to update
divider surface by wrong transition type and isApplicableTask check in
UnfoldTransitionHandler.

Ensure SplitTaskUnfoldAnimator receives onTaskAppeared when unfolding
the device during starting unfold transition through
UnfoldTransitionHandler#startAnimation with the right logic check.

Fix: 278045290
Test: manual as following scenarios:
  A) Disable auto-rotate on folded screen
    1. Enter split-screen on folded screen in portrait.
    2. Unfolded the screen
    3. Expect not seeing the divider gone.

  B) Enable auto-rotate on folded screen
    1. enber split-screen on folded screen in landscape.
    2. unfolded the screen.
    3. Expect not seeing the divider being miss-placed on
       top or on left hand side.

Change-Id: I08f737257f1cbc84f08ec4036ed561017b99f67a
This commit is contained in:
Ming-Shin Lu
2023-05-15 18:38:49 +00:00
parent aefac4e024
commit e554b085ac
2 changed files with 13 additions and 3 deletions

View File

@@ -18,6 +18,8 @@ package com.android.wm.shell.unfold;
import static android.view.WindowManager.TRANSIT_CHANGE;
import static com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_TRANSITIONS;
import android.os.IBinder;
import android.view.SurfaceControl;
import android.window.TransitionInfo;
@@ -27,6 +29,7 @@ import android.window.WindowContainerTransaction;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.android.internal.protolog.common.ProtoLog;
import com.android.wm.shell.common.TransactionPool;
import com.android.wm.shell.sysui.ShellInit;
import com.android.wm.shell.transition.Transitions;
@@ -36,6 +39,7 @@ import com.android.wm.shell.unfold.ShellUnfoldProgressProvider.UnfoldListener;
import com.android.wm.shell.unfold.animation.FullscreenUnfoldTaskAnimator;
import com.android.wm.shell.unfold.animation.SplitTaskUnfoldAnimator;
import com.android.wm.shell.unfold.animation.UnfoldTaskAnimator;
import com.android.wm.shell.util.TransitionUtil;
import java.util.ArrayList;
import java.util.List;
@@ -105,8 +109,14 @@ public class UnfoldTransitionHandler implements TransitionHandler, UnfoldListene
animator.clearTasks();
info.getChanges().forEach(change -> {
if (change.getTaskInfo() != null
&& change.getMode() == TRANSIT_CHANGE
if (change.getTaskInfo() != null) {
ProtoLog.v(WM_SHELL_TRANSITIONS,
"startAnimation, check taskInfo: %s, mode: %s, isApplicableTask: %s",
change.getTaskInfo(), TransitionInfo.modeToString(change.getMode()),
animator.isApplicableTask(change.getTaskInfo()));
}
if (change.getTaskInfo() != null && (change.getMode() == TRANSIT_CHANGE
|| TransitionUtil.isOpeningType(change.getMode()))
&& animator.isApplicableTask(change.getTaskInfo())) {
animator.onTaskAppeared(change.getTaskInfo(), change.getLeash());
}

View File

@@ -213,7 +213,7 @@ public class SplitTaskUnfoldAnimator implements UnfoldTaskAnimator,
@Override
public boolean isApplicableTask(TaskInfo taskInfo) {
return taskInfo.hasParentTask()
&& taskInfo.isVisible
&& taskInfo.isRunning
&& taskInfo.realActivity != null // to filter out parents created by organizer
&& taskInfo.getWindowingMode() == WINDOWING_MODE_MULTI_WINDOW;
}