diff options
| author | Adrian Roos <roosa@google.com> | 2018-01-03 18:43:27 +0100 |
|---|---|---|
| committer | Adrian Roos <roosa@google.com> | 2018-01-11 15:43:05 +0100 |
| commit | 1cf585059cf44d817f28b072b5f64e6ef616b59c (patch) | |
| tree | bd304e46b3a2b70c4217428ad6ae72330a083fb9 /core/java/android/view/DisplayInfo.java | |
| parent | 72232a95d20410762df3e57cbb709c12d66e7a25 (diff) | |
Dispatch DisplayCutout from DisplayAdapter
Adds a config resource to configure the main display's cutout and
dispatches it from the LocalDisplayAdapter.
WindowManager's DisplayContent then transforms it to match the current
rotation.
Also fixes an issue in EmulatedDisplayCutout where the Path was never
reset and changes the color to black. Also fixes the RoundedCorners
overlay such that it can layout within the cutout area.
Test: atest CoordinateTransformsTest DisplayContentTests
Bug: 65689439
Change-Id: If39c8ea3cb55c761517f270dcca292682c0918ad
Diffstat (limited to 'core/java/android/view/DisplayInfo.java')
| -rw-r--r-- | core/java/android/view/DisplayInfo.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/core/java/android/view/DisplayInfo.java b/core/java/android/view/DisplayInfo.java index b813ddb63859..37e9815c93c5 100644 --- a/core/java/android/view/DisplayInfo.java +++ b/core/java/android/view/DisplayInfo.java @@ -149,6 +149,13 @@ public final class DisplayInfo implements Parcelable { public int overscanBottom; /** + * The {@link DisplayCutout} if present, otherwise {@code null}. + * + * @hide + */ + public DisplayCutout displayCutout; + + /** * The rotation of the display relative to its natural orientation. * May be one of {@link android.view.Surface#ROTATION_0}, * {@link android.view.Surface#ROTATION_90}, {@link android.view.Surface#ROTATION_180}, @@ -301,6 +308,7 @@ public final class DisplayInfo implements Parcelable { && overscanTop == other.overscanTop && overscanRight == other.overscanRight && overscanBottom == other.overscanBottom + && Objects.equal(displayCutout, other.displayCutout) && rotation == other.rotation && modeId == other.modeId && defaultModeId == other.defaultModeId @@ -342,6 +350,7 @@ public final class DisplayInfo implements Parcelable { overscanTop = other.overscanTop; overscanRight = other.overscanRight; overscanBottom = other.overscanBottom; + displayCutout = other.displayCutout; rotation = other.rotation; modeId = other.modeId; defaultModeId = other.defaultModeId; @@ -379,6 +388,7 @@ public final class DisplayInfo implements Parcelable { overscanTop = source.readInt(); overscanRight = source.readInt(); overscanBottom = source.readInt(); + displayCutout = DisplayCutout.ParcelableWrapper.readCutoutFromParcel(source); rotation = source.readInt(); modeId = source.readInt(); defaultModeId = source.readInt(); @@ -425,6 +435,7 @@ public final class DisplayInfo implements Parcelable { dest.writeInt(overscanTop); dest.writeInt(overscanRight); dest.writeInt(overscanBottom); + DisplayCutout.ParcelableWrapper.writeCutoutToParcel(displayCutout, dest, flags); dest.writeInt(rotation); dest.writeInt(modeId); dest.writeInt(defaultModeId); |
