From ec1a69e87cb52a27583bcbce2df56788d93812be Mon Sep 17 00:00:00 2001 From: Tiger Huang Date: Wed, 23 Dec 2020 19:37:02 +0800 Subject: Send display cutout to client via insetsChanged Since the display cutout is a type of insets and the display cutout can be obtained from WindowInsets, it makes sense that InsetsState has the display cutout instance. In this way, we can send the display cutout to client via W#insetsChanged instead of W#resized. This can be a step to remove the class of ClientWindowFrames, and can also be a step to make client compute its window frame locally. Fix: 175858810 Bug: 161810301 Test: atest WindowAddRemovePerfTest ImeInsetsSourceConsumerTest InsetsControllerTest InsetsStateTest ViewRootImplTest WindowInsetsControllerTests ActivityRecordTests DisplayPolicyLayoutTests LaunchParamsControllerTests TaskSnapshotSurfaceTest WindowMetricsActivityTests WindowMetricsWindowContextTests WindowMetricsTest WindowFrameTests WindowStateTests WmDisplayCutoutTest Change-Id: I9a930b1d2f7df3cea2b29629b767a4a5f31bca17 --- core/java/android/window/ClientWindowFrames.java | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'core/java/android/window/ClientWindowFrames.java') diff --git a/core/java/android/window/ClientWindowFrames.java b/core/java/android/window/ClientWindowFrames.java index 5d7025b57f91..e22a5eb9fe7b 100644 --- a/core/java/android/window/ClientWindowFrames.java +++ b/core/java/android/window/ClientWindowFrames.java @@ -20,7 +20,6 @@ import android.annotation.NonNull; import android.graphics.Rect; import android.os.Parcel; import android.os.Parcelable; -import android.view.DisplayCutout; /** * The window frame container class used by client side for layout. @@ -39,28 +38,22 @@ public class ClientWindowFrames implements Parcelable { /** The background area while the window is resizing. */ public final @NonNull Rect backdropFrame; - /** The area cut from the display. */ - public final @NonNull DisplayCutout.ParcelableWrapper displayCutout; - public ClientWindowFrames() { frame = new Rect(); displayFrame = new Rect(); backdropFrame = new Rect(); - displayCutout = new DisplayCutout.ParcelableWrapper(); } public ClientWindowFrames(ClientWindowFrames other) { frame = new Rect(other.frame); displayFrame = new Rect(other.displayFrame); backdropFrame = new Rect(other.backdropFrame); - displayCutout = new DisplayCutout.ParcelableWrapper(other.displayCutout.get()); } private ClientWindowFrames(Parcel in) { frame = Rect.CREATOR.createFromParcel(in); displayFrame = Rect.CREATOR.createFromParcel(in); backdropFrame = Rect.CREATOR.createFromParcel(in); - displayCutout = DisplayCutout.ParcelableWrapper.CREATOR.createFromParcel(in); } /** Needed for AIDL out parameters. */ @@ -68,7 +61,6 @@ public class ClientWindowFrames implements Parcelable { frame.set(Rect.CREATOR.createFromParcel(in)); displayFrame.set(Rect.CREATOR.createFromParcel(in)); backdropFrame.set(Rect.CREATOR.createFromParcel(in)); - displayCutout.set(DisplayCutout.ParcelableWrapper.CREATOR.createFromParcel(in)); } @Override @@ -76,7 +68,6 @@ public class ClientWindowFrames implements Parcelable { frame.writeToParcel(dest, flags); displayFrame.writeToParcel(dest, flags); backdropFrame.writeToParcel(dest, flags); - displayCutout.writeToParcel(dest, flags); } @Override @@ -84,8 +75,7 @@ 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) - + " cutout=" + displayCutout + "}"; + + " backdrop=" + backdropFrame.toShortString(sb) + "}"; } @Override -- cgit v1.2.3