Merge "Fix support for split-screen w/ non-resizable home" into rvc-dev am: a9233b0aab am: 3f8e82957e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11897517 Change-Id: I6f2754f8dd65c187952c1ab0adc328ed6dc8977c
This commit is contained in:
@@ -104,17 +104,18 @@ public class DividerSnapAlgorithm {
|
||||
public DividerSnapAlgorithm(Resources res, int displayWidth, int displayHeight, int dividerSize,
|
||||
boolean isHorizontalDivision, Rect insets) {
|
||||
this(res, displayWidth, displayHeight, dividerSize, isHorizontalDivision, insets,
|
||||
DOCKED_INVALID, false);
|
||||
DOCKED_INVALID, false /* minimized */, true /* resizable */);
|
||||
}
|
||||
|
||||
public DividerSnapAlgorithm(Resources res, int displayWidth, int displayHeight, int dividerSize,
|
||||
boolean isHorizontalDivision, Rect insets, int dockSide) {
|
||||
this(res, displayWidth, displayHeight, dividerSize, isHorizontalDivision, insets,
|
||||
dockSide, false);
|
||||
dockSide, false /* minimized */, true /* resizable */);
|
||||
}
|
||||
|
||||
public DividerSnapAlgorithm(Resources res, int displayWidth, int displayHeight, int dividerSize,
|
||||
boolean isHorizontalDivision, Rect insets, int dockSide, boolean isMinimizedMode) {
|
||||
boolean isHorizontalDivision, Rect insets, int dockSide, boolean isMinimizedMode,
|
||||
boolean isHomeResizable) {
|
||||
mMinFlingVelocityPxPerSecond =
|
||||
MIN_FLING_VELOCITY_DP_PER_SECOND * res.getDisplayMetrics().density;
|
||||
mMinDismissVelocityPxPerSecond =
|
||||
@@ -132,8 +133,8 @@ public class DividerSnapAlgorithm {
|
||||
com.android.internal.R.fraction.docked_stack_divider_fixed_ratio, 1, 1);
|
||||
mMinimalSizeResizableTask = res.getDimensionPixelSize(
|
||||
com.android.internal.R.dimen.default_minimal_size_resizable_task);
|
||||
mTaskHeightInMinimizedMode = res.getDimensionPixelSize(
|
||||
com.android.internal.R.dimen.task_height_of_minimized_mode);
|
||||
mTaskHeightInMinimizedMode = isHomeResizable ? res.getDimensionPixelSize(
|
||||
com.android.internal.R.dimen.task_height_of_minimized_mode) : 0;
|
||||
calculateTargets(isHorizontalDivision, dockSide);
|
||||
mFirstSplitTarget = mTargets.get(1);
|
||||
mLastSplitTarget = mTargets.get(mTargets.size() - 2);
|
||||
|
||||
@@ -127,7 +127,7 @@ public class Divider extends SystemUI implements DividerView.DividerCallbacks,
|
||||
snap.calculateNonDismissingSnapTarget(position);
|
||||
sdl.resizeSplits(target.position, t);
|
||||
|
||||
if (isSplitActive()) {
|
||||
if (isSplitActive() && mHomeStackResizable) {
|
||||
WindowManagerProxy.applyHomeTasksMinimized(sdl, mSplits.mSecondary.token, t);
|
||||
}
|
||||
if (mWindowManagerProxy.queueSyncTransactionIfWaiting(t)) {
|
||||
@@ -428,7 +428,7 @@ public class Divider extends SystemUI implements DividerView.DividerCallbacks,
|
||||
}
|
||||
|
||||
private void updateTouchable() {
|
||||
mWindowManager.setTouchable((mHomeStackResizable || !mMinimized) && !mAdjustedForIme);
|
||||
mWindowManager.setTouchable(!mAdjustedForIme);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -523,7 +523,7 @@ public class Divider extends SystemUI implements DividerView.DividerCallbacks,
|
||||
}
|
||||
|
||||
void ensureMinimizedSplit() {
|
||||
setHomeMinimized(true /* minimized */, mSplits.mSecondary.isResizeable);
|
||||
setHomeMinimized(true /* minimized */, mHomeStackResizable);
|
||||
if (!isDividerVisible()) {
|
||||
// Wasn't in split-mode yet, so enter now.
|
||||
if (DEBUG) {
|
||||
|
||||
@@ -320,8 +320,7 @@ public class DividerView extends FrameLayout implements OnTouchListener,
|
||||
super.onAttachedToWindow();
|
||||
|
||||
// Save the current target if not minimized once attached to window
|
||||
if (mHomeStackResizable && mDockSide != WindowManager.DOCKED_INVALID
|
||||
&& !mIsInMinimizeInteraction) {
|
||||
if (mDockSide != WindowManager.DOCKED_INVALID && !mIsInMinimizeInteraction) {
|
||||
saveSnapTargetBeforeMinimized(mSnapTargetBeforeMinimized);
|
||||
}
|
||||
mFirstLayout = true;
|
||||
@@ -470,8 +469,7 @@ public class DividerView extends FrameLayout implements OnTouchListener,
|
||||
}
|
||||
|
||||
public DividerSnapAlgorithm getSnapAlgorithm() {
|
||||
return mDockedStackMinimized
|
||||
&& mHomeStackResizable ? mSplitLayout.getMinimizedSnapAlgorithm()
|
||||
return mDockedStackMinimized ? mSplitLayout.getMinimizedSnapAlgorithm(mHomeStackResizable)
|
||||
: mSplitLayout.getSnapAlgorithm();
|
||||
}
|
||||
|
||||
@@ -629,7 +627,7 @@ public class DividerView extends FrameLayout implements OnTouchListener,
|
||||
}
|
||||
|
||||
// Record last snap target the divider moved to
|
||||
if (mHomeStackResizable && !mIsInMinimizeInteraction) {
|
||||
if (!mIsInMinimizeInteraction) {
|
||||
// The last snapTarget position can be negative when the last divider position was
|
||||
// offscreen. In that case, save the middle (default) SnapTarget so calculating next
|
||||
// position isn't negative.
|
||||
@@ -774,7 +772,8 @@ public class DividerView extends FrameLayout implements OnTouchListener,
|
||||
mSplitLayout.resizeSplits(midPos);
|
||||
Transaction t = mTiles.getTransaction();
|
||||
if (mDockedStackMinimized) {
|
||||
int position = mSplitLayout.getMinimizedSnapAlgorithm().getMiddleTarget().position;
|
||||
int position = mSplitLayout.getMinimizedSnapAlgorithm(mHomeStackResizable)
|
||||
.getMiddleTarget().position;
|
||||
calculateBoundsForPosition(position, mDockSide, mDockedRect);
|
||||
calculateBoundsForPosition(position, DockedDividerUtils.invertDockSide(mDockSide),
|
||||
mOtherRect);
|
||||
@@ -811,23 +810,9 @@ public class DividerView extends FrameLayout implements OnTouchListener,
|
||||
updateDockSide();
|
||||
if (!minimized) {
|
||||
resetBackground();
|
||||
} else if (!isHomeStackResizable) {
|
||||
if (mDockSide == WindowManager.DOCKED_TOP) {
|
||||
mBackground.setPivotY(0);
|
||||
mBackground.setScaleY(MINIMIZE_DOCK_SCALE);
|
||||
} else if (mDockSide == WindowManager.DOCKED_LEFT
|
||||
|| mDockSide == WindowManager.DOCKED_RIGHT) {
|
||||
mBackground.setPivotX(mDockSide == WindowManager.DOCKED_LEFT
|
||||
? 0
|
||||
: mBackground.getWidth());
|
||||
mBackground.setScaleX(MINIMIZE_DOCK_SCALE);
|
||||
}
|
||||
}
|
||||
mMinimizedShadow.setAlpha(minimized ? 1f : 0f);
|
||||
if (!isHomeStackResizable) {
|
||||
mHandle.setAlpha(minimized ? 0f : 1f);
|
||||
mDockedStackMinimized = minimized;
|
||||
} else if (mDockedStackMinimized != minimized) {
|
||||
if (mDockedStackMinimized != minimized) {
|
||||
mDockedStackMinimized = minimized;
|
||||
if (mSplitLayout.mDisplayLayout.rotation() != mDefaultDisplay.getRotation()) {
|
||||
// Splitscreen to minimize is about to starts after rotating landscape to seascape,
|
||||
@@ -840,8 +825,8 @@ public class DividerView extends FrameLayout implements OnTouchListener,
|
||||
// Relayout to recalculate the divider shadow when minimizing
|
||||
requestLayout();
|
||||
mIsInMinimizeInteraction = true;
|
||||
resizeStackSurfaces(
|
||||
mSplitLayout.getMinimizedSnapAlgorithm().getMiddleTarget(), t);
|
||||
resizeStackSurfaces(mSplitLayout.getMinimizedSnapAlgorithm(mHomeStackResizable)
|
||||
.getMiddleTarget(), t);
|
||||
} else {
|
||||
resizeStackSurfaces(mSnapTargetBeforeMinimized, t);
|
||||
mIsInMinimizeInteraction = false;
|
||||
@@ -860,11 +845,11 @@ public class DividerView extends FrameLayout implements OnTouchListener,
|
||||
t.show(sc).apply();
|
||||
mTiles.releaseTransaction(t);
|
||||
});
|
||||
if (isHomeStackResizable) {
|
||||
SnapTarget miniMid = mSplitLayout.getMinimizedSnapAlgorithm().getMiddleTarget();
|
||||
if (mDockedStackMinimized) {
|
||||
mDividerPositionY = mDividerPositionX = miniMid.position;
|
||||
}
|
||||
|
||||
SnapTarget miniMid =
|
||||
mSplitLayout.getMinimizedSnapAlgorithm(isHomeStackResizable).getMiddleTarget();
|
||||
if (mDockedStackMinimized) {
|
||||
mDividerPositionY = mDividerPositionX = miniMid.position;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -903,38 +888,15 @@ public class DividerView extends FrameLayout implements OnTouchListener,
|
||||
if (DEBUG) Slog.d(TAG, "setMinDock: " + mDockedStackMinimized + "->" + minimized);
|
||||
mHomeStackResizable = isHomeStackResizable;
|
||||
updateDockSide();
|
||||
if (!isHomeStackResizable) {
|
||||
mMinimizedShadow.animate()
|
||||
.alpha(minimized ? 1f : 0f)
|
||||
.setInterpolator(Interpolators.ALPHA_IN)
|
||||
.setDuration(animDuration)
|
||||
.start();
|
||||
mHandle.animate()
|
||||
.setInterpolator(Interpolators.FAST_OUT_SLOW_IN)
|
||||
.setDuration(animDuration)
|
||||
.alpha(minimized ? 0f : 1f)
|
||||
.start();
|
||||
if (mDockSide == WindowManager.DOCKED_TOP) {
|
||||
mBackground.setPivotY(0);
|
||||
mBackground.animate()
|
||||
.scaleY(minimized ? MINIMIZE_DOCK_SCALE : 1f);
|
||||
} else if (mDockSide == WindowManager.DOCKED_LEFT
|
||||
|| mDockSide == WindowManager.DOCKED_RIGHT) {
|
||||
mBackground.setPivotX(mDockSide == WindowManager.DOCKED_LEFT
|
||||
? 0
|
||||
: mBackground.getWidth());
|
||||
mBackground.animate()
|
||||
.scaleX(minimized ? MINIMIZE_DOCK_SCALE : 1f);
|
||||
}
|
||||
mDockedStackMinimized = minimized;
|
||||
} else if (mDockedStackMinimized != minimized) {
|
||||
if (mDockedStackMinimized != minimized) {
|
||||
mIsInMinimizeInteraction = true;
|
||||
mDockedStackMinimized = minimized;
|
||||
stopDragging(minimized
|
||||
? mSnapTargetBeforeMinimized.position
|
||||
: getCurrentPosition(),
|
||||
minimized
|
||||
? mSplitLayout.getMinimizedSnapAlgorithm().getMiddleTarget()
|
||||
? mSplitLayout.getMinimizedSnapAlgorithm(mHomeStackResizable)
|
||||
.getMiddleTarget()
|
||||
: mSnapTargetBeforeMinimized,
|
||||
animDuration, Interpolators.FAST_OUT_SLOW_IN, 0);
|
||||
setAdjustedForIme(false, animDuration);
|
||||
@@ -1127,7 +1089,7 @@ public class DividerView extends FrameLayout implements OnTouchListener,
|
||||
final boolean ownTransaction = transaction == null;
|
||||
final Transaction t = ownTransaction ? mTiles.getTransaction() : transaction;
|
||||
mLastResizeRect.set(mDockedRect);
|
||||
if (mHomeStackResizable && mIsInMinimizeInteraction) {
|
||||
if (mIsInMinimizeInteraction) {
|
||||
calculateBoundsForPosition(mSnapTargetBeforeMinimized.position, mDockSide,
|
||||
mDockedTaskRect);
|
||||
calculateBoundsForPosition(mSnapTargetBeforeMinimized.position,
|
||||
@@ -1138,8 +1100,7 @@ public class DividerView extends FrameLayout implements OnTouchListener,
|
||||
mDockedTaskRect.offset(Math.max(position, -mDividerSize)
|
||||
- mDockedTaskRect.left + mDividerSize, 0);
|
||||
}
|
||||
resizeSplitSurfaces(t, mDockedRect, mDockedTaskRect, mOtherRect,
|
||||
mOtherTaskRect);
|
||||
resizeSplitSurfaces(t, mDockedRect, mDockedTaskRect, mOtherRect, mOtherTaskRect);
|
||||
if (ownTransaction) {
|
||||
t.apply();
|
||||
mTiles.releaseTransaction(t);
|
||||
@@ -1420,7 +1381,7 @@ public class DividerView extends FrameLayout implements OnTouchListener,
|
||||
|
||||
void onUndockingTask() {
|
||||
int dockSide = mSplitLayout.getPrimarySplitSide();
|
||||
if (inSplitMode() && (mHomeStackResizable || !mDockedStackMinimized)) {
|
||||
if (inSplitMode()) {
|
||||
startDragging(false /* animate */, false /* touching */);
|
||||
SnapTarget target = dockSideTopLeft(dockSide)
|
||||
? mSplitLayout.getSnapAlgorithm().getDismissEndTarget()
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
|
||||
package com.android.systemui.stackdivider;
|
||||
|
||||
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
|
||||
import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS;
|
||||
import static android.content.res.Configuration.ORIENTATION_LANDSCAPE;
|
||||
import static android.content.res.Configuration.ORIENTATION_PORTRAIT;
|
||||
import static android.view.WindowManager.DOCKED_BOTTOM;
|
||||
@@ -113,11 +111,6 @@ public class SplitDisplayLayout {
|
||||
}
|
||||
}
|
||||
|
||||
boolean isMinimized() {
|
||||
return mTiles.mSecondary.topActivityType == ACTIVITY_TYPE_HOME
|
||||
|| mTiles.mSecondary.topActivityType == ACTIVITY_TYPE_RECENTS;
|
||||
}
|
||||
|
||||
DividerSnapAlgorithm getSnapAlgorithm() {
|
||||
if (mSnapAlgorithm == null) {
|
||||
updateResources();
|
||||
@@ -129,14 +122,14 @@ public class SplitDisplayLayout {
|
||||
return mSnapAlgorithm;
|
||||
}
|
||||
|
||||
DividerSnapAlgorithm getMinimizedSnapAlgorithm() {
|
||||
DividerSnapAlgorithm getMinimizedSnapAlgorithm(boolean homeStackResizable) {
|
||||
if (mMinimizedSnapAlgorithm == null) {
|
||||
updateResources();
|
||||
boolean isHorizontalDivision = !mDisplayLayout.isLandscape();
|
||||
mMinimizedSnapAlgorithm = new DividerSnapAlgorithm(mContext.getResources(),
|
||||
mDisplayLayout.width(), mDisplayLayout.height(), mDividerSize,
|
||||
isHorizontalDivision, mDisplayLayout.stableInsets(), getPrimarySplitSide(),
|
||||
true /* isMinimized */);
|
||||
true /* isMinimized */, homeStackResizable);
|
||||
}
|
||||
return mMinimizedSnapAlgorithm;
|
||||
}
|
||||
@@ -168,8 +161,9 @@ public class SplitDisplayLayout {
|
||||
mDisplayLayout.height(), mDividerSize);
|
||||
}
|
||||
|
||||
Rect calcMinimizedHomeStackBounds() {
|
||||
DividerSnapAlgorithm.SnapTarget miniMid = getMinimizedSnapAlgorithm().getMiddleTarget();
|
||||
Rect calcResizableMinimizedHomeStackBounds() {
|
||||
DividerSnapAlgorithm.SnapTarget miniMid =
|
||||
getMinimizedSnapAlgorithm(true /* resizable */).getMiddleTarget();
|
||||
Rect homeBounds = new Rect();
|
||||
DockedDividerUtils.calculateBoundsForPosition(miniMid.position,
|
||||
DockedDividerUtils.invertDockSide(getPrimarySplitSide()), homeBounds,
|
||||
|
||||
@@ -165,8 +165,9 @@ class SplitScreenTaskOrganizer extends TaskOrganizer {
|
||||
Log.e(TAG, "Got handleTaskInfoChanged when not initialized: " + info);
|
||||
return;
|
||||
}
|
||||
final boolean secondaryWasHomeOrRecents = mSecondary.topActivityType == ACTIVITY_TYPE_HOME
|
||||
|| mSecondary.topActivityType == ACTIVITY_TYPE_RECENTS;
|
||||
final boolean secondaryImpliedMinimize = mSecondary.topActivityType == ACTIVITY_TYPE_HOME
|
||||
|| (mSecondary.topActivityType == ACTIVITY_TYPE_RECENTS
|
||||
&& mDivider.isHomeStackResizable());
|
||||
final boolean primaryWasEmpty = mPrimary.topActivityType == ACTIVITY_TYPE_UNDEFINED;
|
||||
final boolean secondaryWasEmpty = mSecondary.topActivityType == ACTIVITY_TYPE_UNDEFINED;
|
||||
if (info.token.asBinder() == mPrimary.token.asBinder()) {
|
||||
@@ -176,13 +177,14 @@ class SplitScreenTaskOrganizer extends TaskOrganizer {
|
||||
}
|
||||
final boolean primaryIsEmpty = mPrimary.topActivityType == ACTIVITY_TYPE_UNDEFINED;
|
||||
final boolean secondaryIsEmpty = mSecondary.topActivityType == ACTIVITY_TYPE_UNDEFINED;
|
||||
final boolean secondaryIsHomeOrRecents = mSecondary.topActivityType == ACTIVITY_TYPE_HOME
|
||||
|| mSecondary.topActivityType == ACTIVITY_TYPE_RECENTS;
|
||||
final boolean secondaryImpliesMinimize = mSecondary.topActivityType == ACTIVITY_TYPE_HOME
|
||||
|| (mSecondary.topActivityType == ACTIVITY_TYPE_RECENTS
|
||||
&& mDivider.isHomeStackResizable());
|
||||
if (DEBUG) {
|
||||
Log.d(TAG, "onTaskInfoChanged " + mPrimary + " " + mSecondary);
|
||||
}
|
||||
if (primaryIsEmpty == primaryWasEmpty && secondaryWasEmpty == secondaryIsEmpty
|
||||
&& secondaryWasHomeOrRecents == secondaryIsHomeOrRecents) {
|
||||
&& secondaryImpliedMinimize == secondaryImpliesMinimize) {
|
||||
// No relevant changes
|
||||
return;
|
||||
}
|
||||
@@ -211,7 +213,7 @@ class SplitScreenTaskOrganizer extends TaskOrganizer {
|
||||
}
|
||||
mDivider.startEnterSplit();
|
||||
}
|
||||
} else if (secondaryIsHomeOrRecents) {
|
||||
} else if (secondaryImpliesMinimize) {
|
||||
// Both splits are populated but the secondary split has a home/recents stack on top,
|
||||
// so enter minimized mode.
|
||||
mDivider.ensureMinimizedSplit();
|
||||
|
||||
@@ -19,6 +19,9 @@ package com.android.systemui.stackdivider;
|
||||
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
|
||||
import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS;
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
|
||||
import static android.content.res.Configuration.ORIENTATION_LANDSCAPE;
|
||||
import static android.content.res.Configuration.ORIENTATION_UNDEFINED;
|
||||
import static android.view.Display.DEFAULT_DISPLAY;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
@@ -115,7 +118,7 @@ public class WindowManagerProxy {
|
||||
WindowOrganizer.applyTransaction(t);
|
||||
}
|
||||
|
||||
private static boolean getHomeAndRecentsTasks(List<WindowContainerToken> out,
|
||||
private static boolean getHomeAndRecentsTasks(List<ActivityManager.RunningTaskInfo> out,
|
||||
WindowContainerToken parent) {
|
||||
boolean resizable = false;
|
||||
List<ActivityManager.RunningTaskInfo> rootTasks = parent == null
|
||||
@@ -123,7 +126,7 @@ public class WindowManagerProxy {
|
||||
: TaskOrganizer.getChildTasks(parent, HOME_AND_RECENTS);
|
||||
for (int i = 0, n = rootTasks.size(); i < n; ++i) {
|
||||
final ActivityManager.RunningTaskInfo ti = rootTasks.get(i);
|
||||
out.add(ti.token);
|
||||
out.add(ti);
|
||||
if (ti.topActivityType == ACTIVITY_TYPE_HOME) {
|
||||
resizable = ti.isResizeable;
|
||||
}
|
||||
@@ -140,16 +143,37 @@ public class WindowManagerProxy {
|
||||
@NonNull WindowContainerTransaction wct) {
|
||||
// Resize the home/recents stacks to the larger minimized-state size
|
||||
final Rect homeBounds;
|
||||
final ArrayList<WindowContainerToken> homeStacks = new ArrayList<>();
|
||||
final ArrayList<ActivityManager.RunningTaskInfo> homeStacks = new ArrayList<>();
|
||||
boolean isHomeResizable = getHomeAndRecentsTasks(homeStacks, parent);
|
||||
if (isHomeResizable) {
|
||||
homeBounds = layout.calcMinimizedHomeStackBounds();
|
||||
homeBounds = layout.calcResizableMinimizedHomeStackBounds();
|
||||
} else {
|
||||
homeBounds = new Rect(0, 0, layout.mDisplayLayout.width(),
|
||||
layout.mDisplayLayout.height());
|
||||
// home is not resizable, so lock it to its inherent orientation size.
|
||||
homeBounds = new Rect(0, 0, 0, 0);
|
||||
for (int i = homeStacks.size() - 1; i >= 0; --i) {
|
||||
if (homeStacks.get(i).topActivityType == ACTIVITY_TYPE_HOME) {
|
||||
final int orient = homeStacks.get(i).configuration.orientation;
|
||||
final boolean displayLandscape = layout.mDisplayLayout.isLandscape();
|
||||
final boolean isLandscape = orient == ORIENTATION_LANDSCAPE
|
||||
|| (orient == ORIENTATION_UNDEFINED && displayLandscape);
|
||||
homeBounds.right = isLandscape == displayLandscape
|
||||
? layout.mDisplayLayout.width() : layout.mDisplayLayout.height();
|
||||
homeBounds.bottom = isLandscape == displayLandscape
|
||||
? layout.mDisplayLayout.height() : layout.mDisplayLayout.width();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = homeStacks.size() - 1; i >= 0; --i) {
|
||||
wct.setBounds(homeStacks.get(i), homeBounds);
|
||||
// For non-resizable homes, the minimized size is actually the fullscreen-size. As a
|
||||
// result, we don't minimize for recents since it only shows half-size screenshots.
|
||||
if (!isHomeResizable) {
|
||||
if (homeStacks.get(i).topActivityType == ACTIVITY_TYPE_RECENTS) {
|
||||
continue;
|
||||
}
|
||||
wct.setWindowingMode(homeStacks.get(i).token, WINDOWING_MODE_FULLSCREEN);
|
||||
}
|
||||
wct.setBounds(homeStacks.get(i).token, homeBounds);
|
||||
}
|
||||
layout.mTiles.mHomeBounds.set(homeBounds);
|
||||
return isHomeResizable;
|
||||
@@ -175,11 +199,13 @@ public class WindowManagerProxy {
|
||||
return false;
|
||||
}
|
||||
ActivityManager.RunningTaskInfo topHomeTask = null;
|
||||
boolean homeIsTop = false;
|
||||
for (int i = rootTasks.size() - 1; i >= 0; --i) {
|
||||
final ActivityManager.RunningTaskInfo rootTask = rootTasks.get(i);
|
||||
// Only move resizeable task to split secondary. WM will just ignore this anyways...
|
||||
if (!rootTask.isResizeable) continue;
|
||||
// Only move resizeable task to split secondary. However, we have an exception
|
||||
// for non-resizable home because we will minimize to show it.
|
||||
if (!rootTask.isResizeable && rootTask.topActivityType != ACTIVITY_TYPE_HOME) {
|
||||
continue;
|
||||
}
|
||||
// Only move fullscreen tasks to split secondary.
|
||||
if (rootTask.configuration.windowConfiguration.getWindowingMode()
|
||||
!= WINDOWING_MODE_FULLSCREEN) {
|
||||
@@ -193,7 +219,7 @@ public class WindowManagerProxy {
|
||||
// Move the secondary split-forward.
|
||||
wct.reorder(tiles.mSecondary.token, true /* onTop */);
|
||||
boolean isHomeResizable = applyHomeTasksMinimized(layout, null /* parent */, wct);
|
||||
if (isHomeResizable && topHomeTask != null) {
|
||||
if (topHomeTask != null) {
|
||||
// Translate/update-crop of secondary out-of-band with sync transaction -- Until BALST
|
||||
// is enabled, this temporarily syncs the home surface position with offset until
|
||||
// sync transaction finishes.
|
||||
@@ -253,6 +279,7 @@ public class WindowManagerProxy {
|
||||
wct.reparent(ti.token, null /* parent */, true /* onTop */);
|
||||
if (isHomeOrRecentTask(ti)) {
|
||||
wct.setBounds(ti.token, null);
|
||||
wct.setWindowingMode(ti.token, WINDOWING_MODE_UNDEFINED);
|
||||
if (i == 0) {
|
||||
homeOnTop = true;
|
||||
}
|
||||
@@ -293,8 +320,9 @@ public class WindowManagerProxy {
|
||||
final ActivityManager.RunningTaskInfo ti = secondaryChildren.get(i);
|
||||
if (isHomeOrRecentTask(ti)) {
|
||||
wct.reparent(ti.token, null /* parent */, true /* onTop */);
|
||||
// reset bounds too
|
||||
// reset bounds and mode too
|
||||
wct.setBounds(ti.token, null);
|
||||
wct.setWindowingMode(ti.token, WINDOWING_MODE_UNDEFINED);
|
||||
}
|
||||
}
|
||||
for (int i = primaryChildren.size() - 1; i >= 0; --i) {
|
||||
@@ -304,6 +332,7 @@ public class WindowManagerProxy {
|
||||
}
|
||||
for (int i = freeHomeAndRecents.size() - 1; i >= 0; --i) {
|
||||
wct.setBounds(freeHomeAndRecents.get(i).token, null);
|
||||
wct.setWindowingMode(freeHomeAndRecents.get(i).token, WINDOWING_MODE_UNDEFINED);
|
||||
}
|
||||
// Reset focusable to true
|
||||
wct.setFocusable(tiles.mPrimary.token, true /* focusable */);
|
||||
|
||||
@@ -3686,20 +3686,6 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
final int otherWindowingMode = other.getWindowingMode();
|
||||
|
||||
if (otherWindowingMode == WINDOWING_MODE_FULLSCREEN) {
|
||||
// In this case the home stack isn't resizeable even though we are in split-screen
|
||||
// mode. We still want the primary splitscreen stack to be visible as there will be
|
||||
// a slight hint of it in the status bar area above the non-resizeable home
|
||||
// activity. In addition, if the fullscreen assistant is over primary splitscreen
|
||||
// stack, the stack should still be visible in the background as long as the recents
|
||||
// animation is running.
|
||||
final int activityType = other.getActivityType();
|
||||
if (windowingMode == WINDOWING_MODE_SPLIT_SCREEN_PRIMARY) {
|
||||
if (activityType == ACTIVITY_TYPE_HOME
|
||||
|| (activityType == ACTIVITY_TYPE_ASSISTANT
|
||||
&& mWmService.getRecentsAnimationController() != null)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (other.isTranslucent(starting)) {
|
||||
// Can be visible behind a translucent fullscreen stack.
|
||||
gotTranslucentFullscreen = true;
|
||||
|
||||
@@ -571,14 +571,16 @@ final class TaskDisplayArea extends DisplayArea<ActivityStack> {
|
||||
// Apps and their containers are not allowed to specify an orientation while using
|
||||
// root tasks...except for the home stack if it is not resizable and currently
|
||||
// visible (top of) its root task.
|
||||
if (mRootHomeTask != null && mRootHomeTask.isVisible()) {
|
||||
final Task topMost = mRootHomeTask.getTopMostTask();
|
||||
final boolean resizable = topMost != null && topMost.isResizeable();
|
||||
if (!(resizable && mRootHomeTask.matchParentBounds())) {
|
||||
final int orientation = mRootHomeTask.getOrientation();
|
||||
if (orientation != SCREEN_ORIENTATION_UNSET) {
|
||||
return orientation;
|
||||
}
|
||||
if (mRootHomeTask != null && mRootHomeTask.isVisible()
|
||||
&& !mRootHomeTask.isResizeable()) {
|
||||
// Manually nest one-level because because getOrientation() checks fillsParent()
|
||||
// which checks that requestedOverrideBounds() is empty. However, in this case,
|
||||
// it is not empty because it's been overridden to maintain the fullscreen size
|
||||
// within a smaller split-root.
|
||||
final Task topHomeTask = mRootHomeTask.getTopMostTask();
|
||||
final int orientation = topHomeTask.getOrientation();
|
||||
if (orientation != SCREEN_ORIENTATION_UNSET) {
|
||||
return orientation;
|
||||
}
|
||||
}
|
||||
return SCREEN_ORIENTATION_UNSPECIFIED;
|
||||
|
||||
Reference in New Issue
Block a user