Merge "Clean-up displayed-bounds" into rvc-dev am: 2556dbf3ed am: b21ebd20f3 am: ed32893a49
Change-Id: I4acb8da60f2cb1d8f244e247d492a52e65ffb28c
This commit is contained in:
@@ -250,7 +250,7 @@ message TaskProto {
|
||||
reserved 3; // activity
|
||||
optional bool fills_parent = 4;
|
||||
optional .android.graphics.RectProto bounds = 5;
|
||||
optional .android.graphics.RectProto displayed_bounds = 6;
|
||||
optional .android.graphics.RectProto displayed_bounds = 6 [deprecated=true];
|
||||
optional bool defer_removal = 7;
|
||||
optional int32 surface_width = 8;
|
||||
optional int32 surface_height = 9;
|
||||
|
||||
@@ -1374,8 +1374,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
||||
final Rect spaceToFill = transformedBounds != null
|
||||
? transformedBounds
|
||||
: inMultiWindowMode()
|
||||
? task.getDisplayedBounds()
|
||||
: getRootTask().getParent().getDisplayedBounds();
|
||||
? task.getBounds()
|
||||
: getRootTask().getParent().getBounds();
|
||||
mLetterbox.layout(spaceToFill, w.getFrameLw(), mTmpPoint);
|
||||
} else if (mLetterbox != null) {
|
||||
mLetterbox.hide();
|
||||
@@ -6663,17 +6663,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
||||
return super.getBounds();
|
||||
}
|
||||
|
||||
@Override
|
||||
Rect getDisplayedBounds() {
|
||||
if (task != null) {
|
||||
final Rect overrideDisplayedBounds = task.getOverrideDisplayedBounds();
|
||||
if (!overrideDisplayedBounds.isEmpty()) {
|
||||
return overrideDisplayedBounds;
|
||||
}
|
||||
}
|
||||
return getBounds();
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
@Override
|
||||
Rect getAnimationBounds(int appStackClipMode) {
|
||||
|
||||
@@ -91,7 +91,6 @@ import static com.android.server.wm.TaskProto.ANIMATING_BOUNDS;
|
||||
import static com.android.server.wm.TaskProto.BOUNDS;
|
||||
import static com.android.server.wm.TaskProto.CREATED_BY_ORGANIZER;
|
||||
import static com.android.server.wm.TaskProto.DEFER_REMOVAL;
|
||||
import static com.android.server.wm.TaskProto.DISPLAYED_BOUNDS;
|
||||
import static com.android.server.wm.TaskProto.DISPLAY_ID;
|
||||
import static com.android.server.wm.TaskProto.FILLS_PARENT;
|
||||
import static com.android.server.wm.TaskProto.LAST_NON_FULLSCREEN_BOUNDS;
|
||||
@@ -660,8 +659,7 @@ class ActivityStack extends Task {
|
||||
setBounds(newBounds);
|
||||
} else if (overrideWindowingMode != WINDOWING_MODE_PINNED) {
|
||||
// For pinned stack, resize is now part of the {@link WindowContainerTransaction}
|
||||
resize(new Rect(newBounds), null /* configBounds */,
|
||||
PRESERVE_WINDOWS, true /* deferResume */);
|
||||
resize(new Rect(newBounds), PRESERVE_WINDOWS, true /* deferResume */);
|
||||
}
|
||||
}
|
||||
if (prevIsAlwaysOnTop != isAlwaysOnTop()) {
|
||||
@@ -835,8 +833,7 @@ class ActivityStack extends Task {
|
||||
}
|
||||
|
||||
if (!Objects.equals(getRequestedOverrideBounds(), mTmpRect2)) {
|
||||
resize(mTmpRect2, null /*configBounds*/,
|
||||
false /*preserveWindows*/, true /*deferResume*/);
|
||||
resize(mTmpRect2, false /*preserveWindows*/, true /*deferResume*/);
|
||||
}
|
||||
} finally {
|
||||
mAtmService.continueWindowLayout();
|
||||
@@ -894,9 +891,6 @@ class ActivityStack extends Task {
|
||||
setTaskBounds(mDeferredBounds);
|
||||
setBounds(mDeferredBounds);
|
||||
}
|
||||
if (mUpdateDisplayedBoundsDeferredCalled) {
|
||||
setTaskDisplayedBounds(mDeferredDisplayedBounds);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2966,8 +2960,7 @@ class ActivityStack extends Task {
|
||||
|
||||
// TODO: Can only be called from special methods in ActivityStackSupervisor.
|
||||
// Need to consolidate those calls points into this resize method so anyone can call directly.
|
||||
void resize(Rect displayedBounds, Rect configBounds, boolean preserveWindows,
|
||||
boolean deferResume) {
|
||||
void resize(Rect displayedBounds, boolean preserveWindows, boolean deferResume) {
|
||||
if (!updateBoundsAllowed(displayedBounds)) {
|
||||
return;
|
||||
}
|
||||
@@ -2979,7 +2972,7 @@ class ActivityStack extends Task {
|
||||
// Update override configurations of all tasks in the stack.
|
||||
final PooledConsumer c = PooledLambda.obtainConsumer(
|
||||
ActivityStack::processTaskResizeBounds, PooledLambda.__(Task.class),
|
||||
displayedBounds, configBounds);
|
||||
displayedBounds);
|
||||
forAllTasks(c, true /* traverseTopToBottom */);
|
||||
c.recycle();
|
||||
|
||||
@@ -3000,17 +2993,10 @@ class ActivityStack extends Task {
|
||||
}
|
||||
}
|
||||
|
||||
private static void processTaskResizeBounds(
|
||||
Task task, Rect displayedBounds, Rect configBounds) {
|
||||
private static void processTaskResizeBounds(Task task, Rect displayedBounds) {
|
||||
if (!task.isResizeable()) return;
|
||||
|
||||
if (configBounds != null && !configBounds.isEmpty()) {
|
||||
task.setOverrideDisplayedBounds(displayedBounds);
|
||||
task.setBounds(configBounds);
|
||||
} else {
|
||||
task.setOverrideDisplayedBounds(null);
|
||||
task.setBounds(displayedBounds);
|
||||
}
|
||||
task.setBounds(displayedBounds);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3032,22 +3018,6 @@ class ActivityStack extends Task {
|
||||
task.setBounds(task.isResizeable() ? bounds : null);
|
||||
}
|
||||
|
||||
/** Helper to setDisplayedBounds on all child tasks */
|
||||
private void setTaskDisplayedBounds(Rect bounds) {
|
||||
if (!updateDisplayedBoundsAllowed(bounds)) {
|
||||
return;
|
||||
}
|
||||
|
||||
final PooledConsumer c = PooledLambda.obtainConsumer(ActivityStack::setTaskDisplayedBounds,
|
||||
PooledLambda.__(Task.class), bounds);
|
||||
forAllLeafTasks(c, true /* traverseTopToBottom */);
|
||||
c.recycle();
|
||||
}
|
||||
|
||||
private static void setTaskDisplayedBounds(Task task, Rect bounds) {
|
||||
task.setOverrideDisplayedBounds(bounds == null || bounds.isEmpty() ? null : bounds);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the top-most activity that occludes the given one, or @{code null} if none.
|
||||
*/
|
||||
@@ -3569,8 +3539,8 @@ class ActivityStack extends Task {
|
||||
}
|
||||
|
||||
@Override
|
||||
void getRelativeDisplayedPosition(Point outPos) {
|
||||
super.getRelativeDisplayedPosition(outPos);
|
||||
void getRelativePosition(Point outPos) {
|
||||
super.getRelativePosition(outPos);
|
||||
final int outset = getStackOutset();
|
||||
outPos.x -= outset;
|
||||
outPos.y -= outset;
|
||||
@@ -3581,7 +3551,7 @@ class ActivityStack extends Task {
|
||||
return;
|
||||
}
|
||||
|
||||
final Rect stackBounds = getDisplayedBounds();
|
||||
final Rect stackBounds = getBounds();
|
||||
int width = stackBounds.width();
|
||||
int height = stackBounds.height();
|
||||
|
||||
@@ -3776,7 +3746,6 @@ class ActivityStack extends Task {
|
||||
proto.write(FILLS_PARENT, matchParentBounds());
|
||||
getRawBounds().dumpDebug(proto, BOUNDS);
|
||||
|
||||
getOverrideDisplayedBounds().dumpDebug(proto, DISPLAYED_BOUNDS);
|
||||
if (mLastNonFullscreenBounds != null) {
|
||||
mLastNonFullscreenBounds.dumpDebug(proto, LAST_NON_FULLSCREEN_BOUNDS);
|
||||
}
|
||||
|
||||
@@ -1357,7 +1357,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks {
|
||||
// still need moveTaskToFrontLocked() below for any transition settings.
|
||||
}
|
||||
if (stack.shouldResizeStackWithLaunchBounds()) {
|
||||
stack.resize(bounds, null /* configBounds */, !PRESERVE_WINDOWS, !DEFER_RESUME);
|
||||
stack.resize(bounds, !PRESERVE_WINDOWS, !DEFER_RESUME);
|
||||
} else {
|
||||
// WM resizeTask must be done after the task is moved to the correct stack,
|
||||
// because Task's setBounds() also updates dim layer's bounds, but that has
|
||||
|
||||
@@ -898,11 +898,11 @@ public class RecentsAnimationController implements DeathRecipient {
|
||||
TaskAnimationAdapter(Task task, boolean isRecentTaskInvisible) {
|
||||
mTask = task;
|
||||
mIsRecentTaskInvisible = isRecentTaskInvisible;
|
||||
mBounds.set(mTask.getDisplayedBounds());
|
||||
mBounds.set(mTask.getBounds());
|
||||
|
||||
mLocalBounds.set(mBounds);
|
||||
Point tmpPos = new Point();
|
||||
mTask.getRelativeDisplayedPosition(tmpPos);
|
||||
mTask.getRelativePosition(tmpPos);
|
||||
mLocalBounds.offsetTo(tmpPos.x, tmpPos.y);
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,6 @@ import static android.content.pm.ActivityInfo.RESIZE_MODE_RESIZEABLE;
|
||||
import static android.content.pm.ActivityInfo.RESIZE_MODE_RESIZEABLE_AND_PIPABLE_DEPRECATED;
|
||||
import static android.content.pm.ActivityInfo.RESIZE_MODE_RESIZEABLE_VIA_SDK_VERSION;
|
||||
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSET;
|
||||
import static android.content.res.Configuration.EMPTY;
|
||||
import static android.content.res.Configuration.ORIENTATION_LANDSCAPE;
|
||||
import static android.content.res.Configuration.ORIENTATION_PORTRAIT;
|
||||
import static android.content.res.Configuration.ORIENTATION_UNDEFINED;
|
||||
@@ -353,10 +352,6 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
final Rect mPreparedFrozenBounds = new Rect();
|
||||
final Configuration mPreparedFrozenMergedConfig = new Configuration();
|
||||
|
||||
// If non-empty, bounds used to display the task during animations/interactions.
|
||||
// TODO(b/119687367): This member is temporary.
|
||||
private final Rect mOverrideDisplayedBounds = new Rect();
|
||||
|
||||
// Id of the previous display the stack was on.
|
||||
int mPrevDisplayId = INVALID_DISPLAY;
|
||||
|
||||
@@ -2795,29 +2790,6 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Displayed bounds are used to set where the task is drawn at any given time. This is
|
||||
* separate from its actual bounds so that the app doesn't see any meaningful configuration
|
||||
* changes during transitionary periods.
|
||||
*/
|
||||
void setOverrideDisplayedBounds(Rect overrideDisplayedBounds) {
|
||||
if (overrideDisplayedBounds != null) {
|
||||
adjustForMinimalTaskDimensions(overrideDisplayedBounds, mOverrideDisplayedBounds);
|
||||
mOverrideDisplayedBounds.set(overrideDisplayedBounds);
|
||||
} else {
|
||||
mOverrideDisplayedBounds.setEmpty();
|
||||
}
|
||||
updateSurfacePosition();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the bounds that override where the task is displayed. See
|
||||
* {@link android.app.IActivityTaskManager#resizeDockedStack} why this is needed.
|
||||
*/
|
||||
Rect getOverrideDisplayedBounds() {
|
||||
return mOverrideDisplayedBounds;
|
||||
}
|
||||
|
||||
boolean isResizeable(boolean checkSupportsPip) {
|
||||
return (mAtmService.mForceResizableActivities || ActivityInfo.isResizeableMode(mResizeMode)
|
||||
|| (checkSupportsPip && mSupportsPictureInPicture));
|
||||
@@ -2851,49 +2823,6 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
mPreparedFrozenMergedConfig.setTo(getConfiguration());
|
||||
}
|
||||
|
||||
/**
|
||||
* Align the task to the adjusted bounds.
|
||||
*
|
||||
* @param adjustedBounds Adjusted bounds to which the task should be aligned.
|
||||
* @param tempInsetBounds Insets bounds for the task.
|
||||
* @param alignBottom True if the task's bottom should be aligned to the adjusted
|
||||
* bounds's bottom; false if the task's top should be aligned
|
||||
* the adjusted bounds's top.
|
||||
*/
|
||||
void alignToAdjustedBounds(Rect adjustedBounds, Rect tempInsetBounds, boolean alignBottom) {
|
||||
if (!isResizeable() || EMPTY.equals(getRequestedOverrideConfiguration())) {
|
||||
return;
|
||||
}
|
||||
|
||||
getBounds(mTmpRect2);
|
||||
if (alignBottom) {
|
||||
int offsetY = adjustedBounds.bottom - mTmpRect2.bottom;
|
||||
mTmpRect2.offset(0, offsetY);
|
||||
} else {
|
||||
mTmpRect2.offsetTo(adjustedBounds.left, adjustedBounds.top);
|
||||
}
|
||||
if (tempInsetBounds == null || tempInsetBounds.isEmpty()) {
|
||||
setOverrideDisplayedBounds(null);
|
||||
setBounds(mTmpRect2);
|
||||
} else {
|
||||
setOverrideDisplayedBounds(mTmpRect2);
|
||||
setBounds(tempInsetBounds);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current overridden displayed bounds. These will be empty if the task is not
|
||||
* currently overriding where it is displayed.
|
||||
*/
|
||||
@Override
|
||||
public Rect getDisplayedBounds() {
|
||||
if (mOverrideDisplayedBounds.isEmpty()) {
|
||||
return super.getDisplayedBounds();
|
||||
} else {
|
||||
return mOverrideDisplayedBounds;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
void getAnimationFrames(Rect outFrame, Rect outInsets, Rect outStableInsets,
|
||||
Rect outSurfaceInsets) {
|
||||
@@ -3431,7 +3360,6 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
pw.println(prefix + "taskId=" + mTaskId);
|
||||
pw.println(doublePrefix + "mBounds=" + getBounds().toShortString());
|
||||
pw.println(doublePrefix + "appTokens=" + mChildren);
|
||||
pw.println(doublePrefix + "mDisplayedBounds=" + mOverrideDisplayedBounds.toShortString());
|
||||
|
||||
final String triplePrefix = doublePrefix + " ";
|
||||
final String quadruplePrefix = triplePrefix + " ";
|
||||
|
||||
@@ -2062,7 +2062,7 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
|
||||
// TODO: Remove this and use #getBounds() instead once we set an app transition animation
|
||||
// on TaskStack.
|
||||
Rect getAnimationBounds(int appStackClipMode) {
|
||||
return getDisplayedBounds();
|
||||
return getBounds();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2124,7 +2124,7 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
|
||||
// Separate position and size for use in animators.
|
||||
mTmpRect.set(getAnimationBounds(appStackClipMode));
|
||||
if (sHierarchicalAnimations) {
|
||||
getRelativeDisplayedPosition(mTmpPoint);
|
||||
getRelativePosition(mTmpPoint);
|
||||
} else {
|
||||
mTmpPoint.set(mTmpRect.left, mTmpRect.top);
|
||||
}
|
||||
@@ -2399,7 +2399,7 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
|
||||
return;
|
||||
}
|
||||
|
||||
getRelativeDisplayedPosition(mTmpPos);
|
||||
getRelativePosition(mTmpPos);
|
||||
if (mTmpPos.equals(mLastSurfacePosition)) {
|
||||
return;
|
||||
}
|
||||
@@ -2413,16 +2413,6 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
|
||||
return mLastSurfacePosition;
|
||||
}
|
||||
|
||||
/**
|
||||
* Displayed bounds specify where to display this container at. It differs from bounds during
|
||||
* certain operations (like animation or interactive dragging).
|
||||
*
|
||||
* @return the bounds to display this container at.
|
||||
*/
|
||||
Rect getDisplayedBounds() {
|
||||
return getBounds();
|
||||
}
|
||||
|
||||
/**
|
||||
* The {@code outFrame} retrieved by this method specifies where the animation will finish
|
||||
* the entrance animation, as the next frame will display the window at these coordinates. In
|
||||
@@ -2443,7 +2433,7 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
|
||||
outSurfaceInsets.setEmpty();
|
||||
}
|
||||
|
||||
void getRelativeDisplayedPosition(Point outPos) {
|
||||
void getRelativePosition(Point outPos) {
|
||||
// In addition to updateSurfacePosition, we keep other code that sets
|
||||
// position from fighting with the organizer
|
||||
if (isOrganized()) {
|
||||
@@ -2451,11 +2441,11 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
|
||||
return;
|
||||
}
|
||||
|
||||
final Rect dispBounds = getDisplayedBounds();
|
||||
final Rect dispBounds = getBounds();
|
||||
outPos.set(dispBounds.left, dispBounds.top);
|
||||
final WindowContainer parent = getParent();
|
||||
if (parent != null) {
|
||||
final Rect parentBounds = parent.getDisplayedBounds();
|
||||
final Rect parentBounds = parent.getBounds();
|
||||
outPos.offset(-parentBounds.left, -parentBounds.top);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -320,7 +320,7 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub
|
||||
final ActivityStack stack = (ActivityStack) container;
|
||||
if (stack.inPinnedWindowingMode()) {
|
||||
stack.resize(config.windowConfiguration.getBounds(),
|
||||
null /* configBounds */, PRESERVE_WINDOWS, true /* deferResume */);
|
||||
PRESERVE_WINDOWS, true /* deferResume */);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -999,18 +999,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
|
||||
frame.inset(left, top, right, bottom);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Rect getDisplayedBounds() {
|
||||
final Task task = getTask();
|
||||
if (task != null) {
|
||||
Rect bounds = task.getOverrideDisplayedBounds();
|
||||
if (!bounds.isEmpty()) {
|
||||
return bounds;
|
||||
}
|
||||
}
|
||||
return super.getDisplayedBounds();
|
||||
}
|
||||
|
||||
void computeFrame(DisplayFrames displayFrames) {
|
||||
getLayoutingWindowFrames().setDisplayCutout(displayFrames.mDisplayCutout);
|
||||
computeFrameLw();
|
||||
@@ -1065,7 +1053,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
|
||||
layoutXDiff = 0;
|
||||
layoutYDiff = 0;
|
||||
} else {
|
||||
windowFrames.mContainingFrame.set(getDisplayedBounds());
|
||||
windowFrames.mContainingFrame.set(getBounds());
|
||||
if (mActivityRecord != null && !mActivityRecord.mFrozenBounds.isEmpty()) {
|
||||
|
||||
// If the bounds are frozen, we still want to translate the window freely and only
|
||||
@@ -1223,7 +1211,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
|
||||
parentLeft = ((WindowState) parent).mWindowFrames.mFrame.left;
|
||||
parentTop = ((WindowState) parent).mWindowFrames.mFrame.top;
|
||||
} else if (parent != null) {
|
||||
final Rect parentBounds = parent.getDisplayedBounds();
|
||||
final Rect parentBounds = parent.getBounds();
|
||||
parentLeft = parentBounds.left;
|
||||
parentTop = parentBounds.top;
|
||||
}
|
||||
@@ -5290,7 +5278,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
|
||||
outPoint.offset(-parent.mWindowFrames.mFrame.left + mTmpPoint.x,
|
||||
-parent.mWindowFrames.mFrame.top + mTmpPoint.y);
|
||||
} else if (parentWindowContainer != null) {
|
||||
final Rect parentBounds = parentWindowContainer.getDisplayedBounds();
|
||||
final Rect parentBounds = parentWindowContainer.getBounds();
|
||||
outPoint.offset(-parentBounds.left, -parentBounds.top);
|
||||
}
|
||||
|
||||
|
||||
@@ -1030,7 +1030,7 @@ class WindowStateAnimator {
|
||||
mTmpPos.x = 0;
|
||||
mTmpPos.y = 0;
|
||||
if (stack != null) {
|
||||
stack.getRelativeDisplayedPosition(mTmpPos);
|
||||
stack.getRelativePosition(mTmpPos);
|
||||
}
|
||||
|
||||
xOffset = -mTmpPos.x;
|
||||
|
||||
@@ -145,9 +145,5 @@ public class TaskTests extends WindowTestsBase {
|
||||
Rect bounds = new Rect(10, 10, 100, 200);
|
||||
task.setBounds(bounds);
|
||||
assertEquals(new Point(bounds.left, bounds.top), task.getLastSurfacePosition());
|
||||
|
||||
Rect dispBounds = new Rect(20, 30, 110, 220);
|
||||
task.setOverrideDisplayedBounds(dispBounds);
|
||||
assertEquals(new Point(dispBounds.left, dispBounds.top), task.getLastSurfacePosition());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -310,27 +310,6 @@ public class WindowFrameTests extends WindowTestsBase {
|
||||
assertContentFrame(w, new Rect(resolvedTaskBounds.left, resolvedTaskBounds.top,
|
||||
resolvedTaskBounds.right - contentInsetRight,
|
||||
resolvedTaskBounds.bottom - contentInsetBottom));
|
||||
|
||||
pf.set(0, 0, logicalWidth, logicalHeight);
|
||||
// If we set displayed bounds, the insets will be computed with the main task bounds
|
||||
// but the frame will be positioned according to the displayed bounds.
|
||||
final int insetLeft = logicalWidth / 5;
|
||||
final int insetTop = logicalHeight / 5;
|
||||
final int insetRight = insetLeft + (resolvedTaskBounds.right - resolvedTaskBounds.left);
|
||||
final int insetBottom = insetTop + (resolvedTaskBounds.bottom - resolvedTaskBounds.top);
|
||||
task.setOverrideDisplayedBounds(resolvedTaskBounds);
|
||||
task.setBounds(insetLeft, insetTop, insetRight, insetBottom);
|
||||
windowFrames.setFrames(pf, pf, cf, cf, pf, cf);
|
||||
w.computeFrameLw();
|
||||
assertEquals(resolvedTaskBounds, w.getFrameLw());
|
||||
assertEquals(0, w.getRelativeFrameLw().left);
|
||||
assertEquals(0, w.getRelativeFrameLw().top);
|
||||
contentInsetRight = insetRight - cfRight;
|
||||
contentInsetBottom = insetBottom - cfBottom;
|
||||
assertContentInset(w, 0, 0, contentInsetRight, contentInsetBottom);
|
||||
assertContentFrame(w, new Rect(resolvedTaskBounds.left, resolvedTaskBounds.top,
|
||||
resolvedTaskBounds.right - contentInsetRight,
|
||||
resolvedTaskBounds.bottom - contentInsetBottom));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -459,33 +438,6 @@ public class WindowFrameTests extends WindowTestsBase {
|
||||
assertEquals(w.getWmDisplayCutout().getDisplayCutout().getSafeInsetRight(), 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
@FlakyTest(bugId = 130388666)
|
||||
public void testDisplayCutout_tempDisplayedBounds() {
|
||||
// Regular fullscreen task and window
|
||||
WindowState w = createWindow();
|
||||
final Task task = w.getTask();
|
||||
task.setBounds(new Rect(0, 0, 1000, 2000));
|
||||
task.setOverrideDisplayedBounds(new Rect(0, -500, 1000, 1500));
|
||||
w.mAttrs.gravity = Gravity.LEFT | Gravity.TOP;
|
||||
|
||||
final Rect pf = new Rect(0, -500, 1000, 1500);
|
||||
// Create a display cutout of size 50x50, aligned top-center
|
||||
final WmDisplayCutout cutout = WmDisplayCutout.computeSafeInsets(
|
||||
fromBoundingRect(500, 0, 550, 50, BOUNDS_POSITION_TOP),
|
||||
pf.width(), pf.height());
|
||||
|
||||
final WindowFrames windowFrames = w.getWindowFrames();
|
||||
windowFrames.setFrames(pf, pf, pf, pf, pf, pf);
|
||||
windowFrames.setDisplayCutout(cutout);
|
||||
w.computeFrameLw();
|
||||
|
||||
assertEquals(w.getWmDisplayCutout().getDisplayCutout().getSafeInsetTop(), 50);
|
||||
assertEquals(w.getWmDisplayCutout().getDisplayCutout().getSafeInsetBottom(), 0);
|
||||
assertEquals(w.getWmDisplayCutout().getDisplayCutout().getSafeInsetLeft(), 0);
|
||||
assertEquals(w.getWmDisplayCutout().getDisplayCutout().getSafeInsetRight(), 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFreeformContentInsets() {
|
||||
removeGlobalMinSizeRestriction();
|
||||
|
||||
Reference in New Issue
Block a user