Copy WindowState Bounds before modifying them

It is not safe to modify bounds returned by
getBounds, so it is important to copy them.

Change-Id: Ic19ed5e0326dc427fc6e38695fc5760980315599
Bug: 273045619
Test: build passes
Merged-In: I625afa17711fcd52bbb7fe9a9ba51500eb1bef5c
This commit is contained in:
Oleg Blinnikov
2023-03-21 18:27:15 +00:00
parent e05c003221
commit 25e64aedef

View File

@@ -861,7 +861,7 @@ public final class AccessibilityWindowsPopulator extends WindowInfosListener {
private static void getLetterBoxBounds(WindowState windowState, Region outRegion) {
final Rect letterboxInsets = windowState.mActivityRecord.getLetterboxInsets();
final Rect nonLetterboxRect = windowState.getBounds();
final Rect nonLetterboxRect = new Rect(windowState.getBounds());
nonLetterboxRect.inset(letterboxInsets);
outRegion.set(windowState.getBounds());