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:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user