Created WindowFrames class and moved data from PWM and WS
Moved frame data from PWM and WS into the WindowFrames class. Created a
WindowFrames object in both PWM and WS and converted usages of window
frame info to get data from the WindowFrames instance.
Data between PWM and WS is still separate and copied over when
requested.
Bug: 111359087
Test: go/wm-smoke
Change-Id: I95aa9f2f22557e96ad09f08b7fe6d6a2562399c4
diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java
index 2da77a1..71f34c9 100644
--- a/services/core/java/com/android/server/wm/Task.java
+++ b/services/core/java/com/android/server/wm/Task.java
@@ -409,7 +409,7 @@
* @param out Rect containing the max visible bounds.
* @return true if the task has some visible app windows; false otherwise.
*/
- boolean getMaxVisibleBounds(Rect out) {
+ private boolean getMaxVisibleBounds(Rect out) {
boolean foundTop = false;
for (int i = mChildren.size() - 1; i >= 0; i--) {
final AppWindowToken token = mChildren.get(i);
@@ -422,22 +422,11 @@
continue;
}
if (!foundTop) {
- out.set(win.mVisibleFrame);
foundTop = true;
- continue;
+ out.setEmpty();
}
- if (win.mVisibleFrame.left < out.left) {
- out.left = win.mVisibleFrame.left;
- }
- if (win.mVisibleFrame.top < out.top) {
- out.top = win.mVisibleFrame.top;
- }
- if (win.mVisibleFrame.right > out.right) {
- out.right = win.mVisibleFrame.right;
- }
- if (win.mVisibleFrame.bottom > out.bottom) {
- out.bottom = win.mVisibleFrame.bottom;
- }
+
+ win.getMaxVisibleBounds(out);
}
return foundTop;
}