diff options
Diffstat (limited to 'core/java/android/window/ClientWindowFrames.java')
| -rw-r--r-- | core/java/android/window/ClientWindowFrames.java | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/core/java/android/window/ClientWindowFrames.java b/core/java/android/window/ClientWindowFrames.java index acf9882e6658..5b915cc22ec5 100644 --- a/core/java/android/window/ClientWindowFrames.java +++ b/core/java/android/window/ClientWindowFrames.java @@ -27,47 +27,55 @@ import android.os.Parcelable; */ public class ClientWindowFrames implements Parcelable { /** The actual window bounds. */ - public final @NonNull Rect frame; + public final @NonNull Rect frame = new Rect(); /** * The container frame that is usually the same as display size. It may exclude the area of * insets if the window layout parameter has specified fit-insets-sides. */ - public final @NonNull Rect displayFrame; + public final @NonNull Rect displayFrame = new Rect(); + + /** + * The frame to be referenced while applying gravity and MATCH_PARENT. + */ + public final @NonNull Rect parentFrame = new Rect(); /** The background area while the window is resizing. */ - public final @NonNull Rect backdropFrame; + public final @NonNull Rect backdropFrame = new Rect(); + + public boolean isParentFrameClippedByDisplayCutout; public ClientWindowFrames() { - frame = new Rect(); - displayFrame = new Rect(); - backdropFrame = new Rect(); } public ClientWindowFrames(ClientWindowFrames other) { - frame = new Rect(other.frame); - displayFrame = new Rect(other.displayFrame); - backdropFrame = new Rect(other.backdropFrame); + frame.set(other.frame); + displayFrame.set(other.displayFrame); + parentFrame.set(other.parentFrame); + backdropFrame.set(other.backdropFrame); + isParentFrameClippedByDisplayCutout = other.isParentFrameClippedByDisplayCutout; } private ClientWindowFrames(Parcel in) { - frame = Rect.CREATOR.createFromParcel(in); - displayFrame = Rect.CREATOR.createFromParcel(in); - backdropFrame = Rect.CREATOR.createFromParcel(in); + readFromParcel(in); } /** Needed for AIDL out parameters. */ public void readFromParcel(Parcel in) { frame.readFromParcel(in); displayFrame.readFromParcel(in); + parentFrame.readFromParcel(in); backdropFrame.readFromParcel(in); + isParentFrameClippedByDisplayCutout = in.readBoolean(); } @Override public void writeToParcel(Parcel dest, int flags) { frame.writeToParcel(dest, flags); displayFrame.writeToParcel(dest, flags); + parentFrame.writeToParcel(dest, flags); backdropFrame.writeToParcel(dest, flags); + dest.writeBoolean(isParentFrameClippedByDisplayCutout); } @Override @@ -75,7 +83,9 @@ public class ClientWindowFrames implements Parcelable { final StringBuilder sb = new StringBuilder(32); return "ClientWindowFrames{frame=" + frame.toShortString(sb) + " display=" + displayFrame.toShortString(sb) - + " backdrop=" + backdropFrame.toShortString(sb) + "}"; + + " parentFrame=" + parentFrame.toShortString(sb) + + " backdrop=" + backdropFrame.toShortString(sb) + + " parentClippedByDisplayCutout=" + isParentFrameClippedByDisplayCutout + "}"; } @Override |
