Support insets on secondary displays

Indroduced DisplayFrames object to track frames used to calculate
window insets per display vs. at a global level in PhoneWindowManager.

Bug: 64148922
Change-Id: I19f166920eba0a4f933a223a77e096bcc8dab0c1
Test: bit FrameworksServicesTests:com.android.server.wm.ScreenDecorWindowTests
Test: go/wm-smoke
This commit is contained in:
Wale Ogunwale
2017-11-14 01:01:29 +00:00
parent 7bb06e012a
commit 828ff7e3ef
14 changed files with 799 additions and 937 deletions

View File

@@ -474,6 +474,19 @@ public final class Rect implements Parcelable {
return intersect(r.left, r.top, r.right, r.bottom);
}
/**
* If the specified rectangle intersects this rectangle, set this rectangle to that
* intersection, otherwise set this rectangle to the empty rectangle.
* @see #inset(int, int, int, int) but without checking if the rects overlap.
* @hide
*/
public void intersectUnchecked(Rect other) {
left = Math.max(left, other.left);
top = Math.max(top, other.top);
right = Math.min(right, other.right);
bottom = Math.min(bottom, other.bottom);
}
/**
* If rectangles a and b intersect, return true and set this rectangle to
* that intersection, otherwise return false and do not change this