Fix propagation of display overscan information.
Fix several problems in the way that the overscan was plumbed in
which could result in information not being delivered to applications.
There was also a violation of certain invariants regarding the
immutability of returned DisplayInfo objects.
Bug: 10213771
Change-Id: I21184a14305e44278b5e81353bf95d511e8517fb
diff --git a/services/java/com/android/server/display/LogicalDisplay.java b/services/java/com/android/server/display/LogicalDisplay.java
index b9839c2..7e357c0 100644
--- a/services/java/com/android/server/display/LogicalDisplay.java
+++ b/services/java/com/android/server/display/LogicalDisplay.java
@@ -128,32 +128,24 @@
*
* @param info The logical display information, may be null.
*/
- public void setDisplayInfoOverrideFromWindowManagerLocked(DisplayInfo info) {
+ public boolean setDisplayInfoOverrideFromWindowManagerLocked(DisplayInfo info) {
if (info != null) {
if (mOverrideDisplayInfo == null) {
mOverrideDisplayInfo = new DisplayInfo(info);
mInfo = null;
- } else if (!mOverrideDisplayInfo.equals(info)) {
+ return true;
+ }
+ if (!mOverrideDisplayInfo.equals(info)) {
mOverrideDisplayInfo.copyFrom(info);
mInfo = null;
+ return true;
}
} else if (mOverrideDisplayInfo != null) {
mOverrideDisplayInfo = null;
mInfo = null;
+ return true;
}
- }
-
- public void setOverscan(int left, int top, int right, int bottom) {
- mInfo.overscanLeft = left;
- mInfo.overscanTop = top;
- mInfo.overscanRight = right;
- mInfo.overscanBottom = bottom;
- if (mOverrideDisplayInfo != null) {
- mOverrideDisplayInfo.overscanLeft = left;
- mOverrideDisplayInfo.overscanTop = top;
- mOverrideDisplayInfo.overscanRight = right;
- mOverrideDisplayInfo.overscanBottom = bottom;
- }
+ return false;
}
/**