Merge "Use size compat bounds for window layout" into sc-v2-dev
This commit is contained in:
@@ -1441,6 +1441,14 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Rect getBounds() {
|
||||||
|
// The window bounds are used for layout in screen coordinates. If the token has bounds for
|
||||||
|
// size compatibility mode, its configuration bounds are app based coordinates which should
|
||||||
|
// not be used for layout.
|
||||||
|
return mToken.hasSizeCompatBounds() ? mToken.getBounds() : super.getBounds();
|
||||||
|
}
|
||||||
|
|
||||||
/** Retrieves the current frame of the window that the application sees. */
|
/** Retrieves the current frame of the window that the application sees. */
|
||||||
Rect getFrame() {
|
Rect getFrame() {
|
||||||
return mWindowFrames.mFrame;
|
return mWindowFrames.mFrame;
|
||||||
|
|||||||
@@ -320,6 +320,11 @@ public class SizeCompatTests extends WindowTestsBase {
|
|||||||
assertScaled();
|
assertScaled();
|
||||||
// Activity is sandboxed due to size compat mode.
|
// Activity is sandboxed due to size compat mode.
|
||||||
assertActivityMaxBoundsSandboxed();
|
assertActivityMaxBoundsSandboxed();
|
||||||
|
|
||||||
|
final WindowState appWindow = addWindowToActivity(mActivity);
|
||||||
|
assertTrue(mActivity.hasSizeCompatBounds());
|
||||||
|
assertEquals("App window must use size compat bounds for layout in screen space",
|
||||||
|
mActivity.getBounds(), appWindow.getBounds());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user