Merge "Fix split to pip with home-key not dismissing split properly" into udc-dev
This commit is contained in:
@@ -23,7 +23,6 @@ import static android.app.ComponentOptions.KEY_PENDING_INTENT_BACKGROUND_ACTIVIT
|
|||||||
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
|
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
|
||||||
import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS;
|
import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS;
|
||||||
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
|
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
|
||||||
import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW;
|
|
||||||
import static android.content.res.Configuration.SMALLEST_SCREEN_WIDTH_DP_UNDEFINED;
|
import static android.content.res.Configuration.SMALLEST_SCREEN_WIDTH_DP_UNDEFINED;
|
||||||
import static android.view.Display.DEFAULT_DISPLAY;
|
import static android.view.Display.DEFAULT_DISPLAY;
|
||||||
import static android.view.RemoteAnimationTarget.MODE_OPENING;
|
import static android.view.RemoteAnimationTarget.MODE_OPENING;
|
||||||
@@ -2823,19 +2822,19 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mRecentTasks.ifPresent(recentTasks -> {
|
if (shouldBreakPairedTaskInRecents(dismissReason)) {
|
||||||
// Notify recents if we are exiting in a way that breaks the pair, and disable further
|
// Notify recents if we are exiting in a way that breaks the pair, and disable further
|
||||||
// updates to splits in the recents until we enter split again
|
// updates to splits in the recents until we enter split again
|
||||||
if (shouldBreakPairedTaskInRecents(dismissReason)) {
|
mRecentTasks.ifPresent(recentTasks -> {
|
||||||
for (TransitionInfo.Change change : info.getChanges()) {
|
for (int i = info.getChanges().size() - 1; i >= 0; --i) {
|
||||||
final ActivityManager.RunningTaskInfo taskInfo = change.getTaskInfo();
|
final TransitionInfo.Change change = info.getChanges().get(i);
|
||||||
if (taskInfo != null
|
final ActivityManager.RunningTaskInfo taskInfo = change.getTaskInfo();
|
||||||
&& taskInfo.getWindowingMode() != WINDOWING_MODE_MULTI_WINDOW) {
|
if (taskInfo != null && getStageOfTask(taskInfo) != null) {
|
||||||
recentTasks.removeSplitPair(taskInfo.taskId);
|
recentTasks.removeSplitPair(taskInfo.taskId);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
mSplitRequest = null;
|
mSplitRequest = null;
|
||||||
|
|
||||||
// Update local states.
|
// Update local states.
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import static android.view.WindowManager.TRANSIT_TO_BACK;
|
|||||||
import static android.window.TransitionInfo.FLAG_IS_WALLPAPER;
|
import static android.window.TransitionInfo.FLAG_IS_WALLPAPER;
|
||||||
|
|
||||||
import static com.android.wm.shell.common.split.SplitScreenConstants.FLAG_IS_DIVIDER_BAR;
|
import static com.android.wm.shell.common.split.SplitScreenConstants.FLAG_IS_DIVIDER_BAR;
|
||||||
|
import static com.android.wm.shell.common.split.SplitScreenConstants.SPLIT_POSITION_UNDEFINED;
|
||||||
import static com.android.wm.shell.splitscreen.SplitScreen.STAGE_TYPE_UNDEFINED;
|
import static com.android.wm.shell.splitscreen.SplitScreen.STAGE_TYPE_UNDEFINED;
|
||||||
import static com.android.wm.shell.splitscreen.SplitScreenController.EXIT_REASON_CHILD_TASK_ENTER_PIP;
|
import static com.android.wm.shell.splitscreen.SplitScreenController.EXIT_REASON_CHILD_TASK_ENTER_PIP;
|
||||||
import static com.android.wm.shell.util.TransitionUtil.isOpeningType;
|
import static com.android.wm.shell.util.TransitionUtil.isOpeningType;
|
||||||
@@ -303,6 +304,19 @@ public class DefaultMixedHandler implements Transitions.TransitionHandler,
|
|||||||
return animateOpenIntentWithRemoteAndPip(mixed, info, startTransaction,
|
return animateOpenIntentWithRemoteAndPip(mixed, info, startTransaction,
|
||||||
finishTransaction, finishCallback);
|
finishTransaction, finishCallback);
|
||||||
} else if (mixed.mType == MixedTransition.TYPE_RECENTS_DURING_SPLIT) {
|
} else if (mixed.mType == MixedTransition.TYPE_RECENTS_DURING_SPLIT) {
|
||||||
|
for (int i = info.getChanges().size() - 1; i >= 0; --i) {
|
||||||
|
final TransitionInfo.Change change = info.getChanges().get(i);
|
||||||
|
// Pip auto-entering info might be appended to recent transition like pressing
|
||||||
|
// home-key in 3-button navigation. This offers split handler the opportunity to
|
||||||
|
// handle split to pip animation.
|
||||||
|
if (mPipHandler.isEnteringPip(change, info.getType())
|
||||||
|
&& mSplitHandler.getSplitItemPosition(change.getLastParent())
|
||||||
|
!= SPLIT_POSITION_UNDEFINED) {
|
||||||
|
return animateEnterPipFromSplit(mixed, info, startTransaction,
|
||||||
|
finishTransaction, finishCallback);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return animateRecentsDuringSplit(mixed, info, startTransaction, finishTransaction,
|
return animateRecentsDuringSplit(mixed, info, startTransaction, finishTransaction,
|
||||||
finishCallback);
|
finishCallback);
|
||||||
} else if (mixed.mType == MixedTransition.TYPE_KEYGUARD) {
|
} else if (mixed.mType == MixedTransition.TYPE_KEYGUARD) {
|
||||||
|
|||||||
Reference in New Issue
Block a user