Merge "Generalize window bounds for layout" into sc-v2-dev am: cde7b47aa2

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15309903

Change-Id: Icbba01e2c51762e8087cf44ffae869419e209524
This commit is contained in:
Riddle Hsu
2021-07-19 03:30:42 +00:00
committed by Automerger Merge Worker
3 changed files with 4 additions and 12 deletions

View File

@@ -1686,7 +1686,7 @@ public class DisplayPolicy {
// frame set for the simulated layout for this case. // frame set for the simulated layout for this case.
computeWindowBounds(attrs, state, df, df); computeWindowBounds(attrs, state, df, df);
} else { } else {
computeWindowBounds(attrs, state, win.mToken.getBounds(), df); computeWindowBounds(attrs, state, win.getBounds(), df);
} }
if (attached == null) { if (attached == null) {
pf.set(df); pf.set(df);

View File

@@ -1443,16 +1443,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
} }
} }
// TODO: Look into whether this override is still necessary.
@Override
public Rect getBounds() {
if (mActivityRecord != null) {
return mActivityRecord.getBounds();
} else {
return 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;

View File

@@ -590,7 +590,9 @@ public class DisplayContentTests extends WindowTestsBase {
dc.setImeLayeringTarget(ws); dc.setImeLayeringTarget(ws);
// Adjust bounds so that matchesRootDisplayAreaBounds() returns false. // Adjust bounds so that matchesRootDisplayAreaBounds() returns false.
ws.mActivityRecord.getConfiguration().windowConfiguration.setBounds(new Rect(1, 1, 1, 1)); final Rect bounds = new Rect(dc.getBounds());
bounds.scale(0.5f);
ws.mActivityRecord.setBounds(bounds);
assertFalse("matchesRootDisplayAreaBounds() should return false", assertFalse("matchesRootDisplayAreaBounds() should return false",
ws.matchesDisplayAreaBounds()); ws.matchesDisplayAreaBounds());