Merge "Remove inSplitScreen function" into tm-dev am: 76ebae0c6c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17976183 Change-Id: Iad473564192c9ff41e96c2918fb03e12cf7e0e22 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -19,7 +19,6 @@ package com.android.server.wm;
|
||||
import static android.app.ActivityTaskManager.INVALID_TASK_ID;
|
||||
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
|
||||
import static android.content.res.Configuration.ORIENTATION_LANDSCAPE;
|
||||
import static android.view.RemoteAnimationTarget.MODE_CLOSING;
|
||||
import static android.view.RemoteAnimationTarget.MODE_OPENING;
|
||||
import static android.view.WindowManager.INPUT_CONSUMER_RECENTS_ANIMATION;
|
||||
@@ -602,22 +601,12 @@ public class RecentsAnimationController implements DeathRecipient {
|
||||
|| mDisplayContent.getAsyncRotationController() != null) {
|
||||
return;
|
||||
}
|
||||
boolean shouldTranslateNavBar = false;
|
||||
final boolean isDisplayLandscape =
|
||||
mDisplayContent.getConfiguration().orientation == ORIENTATION_LANDSCAPE;
|
||||
for (int i = mPendingAnimations.size() - 1; i >= 0; i--) {
|
||||
final TaskAnimationAdapter adapter = mPendingAnimations.get(i);
|
||||
final Task task = adapter.mTask;
|
||||
final TaskFragment adjacentTask = task.getRootTask().getAdjacentTaskFragment();
|
||||
final boolean inSplitScreen = task.inSplitScreen();
|
||||
if (task.isActivityTypeHomeOrRecents()
|
||||
// Skip if the task is in split screen and in landscape.
|
||||
|| (inSplitScreen && isDisplayLandscape)
|
||||
// Skip if the task is the top task in split screen.
|
||||
|| (inSplitScreen && task.getBounds().top < adjacentTask.getBounds().top)) {
|
||||
if (task.isActivityTypeHomeOrRecents()) {
|
||||
continue;
|
||||
}
|
||||
shouldTranslateNavBar = inSplitScreen;
|
||||
mNavBarAttachedApp = task.getTopVisibleActivity();
|
||||
break;
|
||||
}
|
||||
@@ -630,9 +619,7 @@ public class RecentsAnimationController implements DeathRecipient {
|
||||
navWindow.mToken.cancelAnimation();
|
||||
final SurfaceControl.Transaction t = navWindow.mToken.getPendingTransaction();
|
||||
final SurfaceControl navSurfaceControl = navWindow.mToken.getSurfaceControl();
|
||||
if (shouldTranslateNavBar) {
|
||||
navWindow.setSurfaceTranslationY(-mNavBarAttachedApp.getBounds().top);
|
||||
}
|
||||
navWindow.setSurfaceTranslationY(-mNavBarAttachedApp.getBounds().top);
|
||||
t.reparent(navSurfaceControl, mNavBarAttachedApp.getSurfaceControl());
|
||||
t.show(navSurfaceControl);
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
|
||||
import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED;
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW;
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
|
||||
import static android.app.WindowConfiguration.activityTypeToString;
|
||||
@@ -1720,13 +1719,6 @@ class Task extends TaskFragment {
|
||||
&& (topTask == null || topTask.supportsSplitScreenWindowingModeInner(tda));
|
||||
}
|
||||
|
||||
/** Returns {@code true} if this task is currently in split-screen. */
|
||||
boolean inSplitScreen() {
|
||||
return getWindowingMode() == WINDOWING_MODE_MULTI_WINDOW
|
||||
&& getCreatedByOrganizerTask() != null
|
||||
&& getCreatedByOrganizerTask().getAdjacentTaskFragment() != null;
|
||||
}
|
||||
|
||||
private boolean supportsSplitScreenWindowingModeInner(@Nullable TaskDisplayArea tda) {
|
||||
return super.supportsSplitScreenWindowingMode()
|
||||
&& mAtmService.mSupportsSplitScreenMultiWindow
|
||||
|
||||
@@ -1163,20 +1163,21 @@ final class TaskDisplayArea extends DisplayArea<WindowContainer> {
|
||||
}
|
||||
}
|
||||
|
||||
// For a better split UX, If a task is launching from a created-by-organizer task, it should
|
||||
// be launched into the same created-by-organizer task as well. Unless, the candidate task
|
||||
// is already positioned in the split.
|
||||
Task preferredRootInSplit = sourceTask != null && sourceTask.inSplitScreen()
|
||||
? sourceTask.getCreatedByOrganizerTask() : null;
|
||||
if (preferredRootInSplit != null) {
|
||||
if (candidateTask != null) {
|
||||
final Task candidateRoot = candidateTask.getCreatedByOrganizerTask();
|
||||
if (candidateRoot != null && candidateRoot != preferredRootInSplit
|
||||
&& preferredRootInSplit == candidateRoot.getAdjacentTaskFragment()) {
|
||||
preferredRootInSplit = candidateRoot;
|
||||
// If a task is launching from a created-by-organizer task, it should be launched into the
|
||||
// same created-by-organizer task as well. Unless, the candidate task is already positioned
|
||||
// in the another adjacent task.
|
||||
if (sourceTask != null) {
|
||||
Task launchTarget = sourceTask.getCreatedByOrganizerTask();
|
||||
if (launchTarget != null && launchTarget.getAdjacentTaskFragment() != null) {
|
||||
if (candidateTask != null) {
|
||||
final Task candidateRoot = candidateTask.getCreatedByOrganizerTask();
|
||||
if (candidateRoot != null && candidateRoot != launchTarget
|
||||
&& launchTarget == candidateRoot.getAdjacentTaskFragment()) {
|
||||
launchTarget = candidateRoot;
|
||||
}
|
||||
}
|
||||
return launchTarget;
|
||||
}
|
||||
return preferredRootInSplit;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -3639,13 +3639,11 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
|
||||
final int requested = mLastRequestedExclusionHeight[side];
|
||||
final int granted = mLastGrantedExclusionHeight[side];
|
||||
|
||||
final boolean inSplitScreen = getTask() != null && getTask().inSplitScreen();
|
||||
|
||||
FrameworkStatsLog.write(FrameworkStatsLog.EXCLUSION_RECT_STATE_CHANGED,
|
||||
mAttrs.packageName, requested, requested - granted /* rejected */,
|
||||
side + 1 /* Sides are 1-indexed in atoms.proto */,
|
||||
(getConfiguration().orientation == ORIENTATION_LANDSCAPE),
|
||||
inSplitScreen, (int) duration);
|
||||
false /* (deprecated param) inSplitscreen */, (int) duration);
|
||||
}
|
||||
|
||||
private void initExclusionRestrictions() {
|
||||
|
||||
Reference in New Issue
Block a user