Add display cutout to proto dump

Bug: 262390300
Test: atest FlickerTest
Change-Id: I711952bbd3bbd72ccbac2306d46aedce361610e7
This commit is contained in:
Nataniel Borges
2022-12-14 11:26:57 +00:00
parent db02059f6a
commit 112c07431f
4 changed files with 9 additions and 1 deletions

View File

@@ -23,6 +23,7 @@ import static android.view.DisplayCutoutProto.BOUND_LEFT;
import static android.view.DisplayCutoutProto.BOUND_RIGHT;
import static android.view.DisplayCutoutProto.BOUND_TOP;
import static android.view.DisplayCutoutProto.INSETS;
import static android.view.DisplayCutoutProto.WATERFALL_INSETS;
import static android.view.Surface.ROTATION_0;
import static com.android.internal.annotations.VisibleForTesting.Visibility.PRIVATE;
@@ -830,7 +831,7 @@ public final class DisplayCutout {
mBounds.getRect(BOUNDS_POSITION_TOP).dumpDebug(proto, BOUND_TOP);
mBounds.getRect(BOUNDS_POSITION_RIGHT).dumpDebug(proto, BOUND_RIGHT);
mBounds.getRect(BOUNDS_POSITION_BOTTOM).dumpDebug(proto, BOUND_BOTTOM);
mWaterfallInsets.toRect().dumpDebug(proto, INSETS);
mWaterfallInsets.toRect().dumpDebug(proto, WATERFALL_INSETS);
proto.end(token);
}

View File

@@ -18,6 +18,7 @@ package android.view;
import static android.view.DisplayInfoProto.APP_HEIGHT;
import static android.view.DisplayInfoProto.APP_WIDTH;
import static android.view.DisplayInfoProto.CUTOUT;
import static android.view.DisplayInfoProto.FLAGS;
import static android.view.DisplayInfoProto.LOGICAL_HEIGHT;
import static android.view.DisplayInfoProto.LOGICAL_WIDTH;
@@ -861,6 +862,9 @@ public final class DisplayInfo implements Parcelable {
protoOutputStream.write(APP_HEIGHT, appHeight);
protoOutputStream.write(NAME, name);
protoOutputStream.write(FLAGS, flags);
if (displayCutout != null) {
displayCutout.dumpDebug(protoOutputStream, CUTOUT);
}
protoOutputStream.end(token);
}

View File

@@ -31,4 +31,5 @@ message DisplayCutoutProto {
optional .android.graphics.RectProto bound_top = 4;
optional .android.graphics.RectProto bound_right = 5;
optional .android.graphics.RectProto bound_bottom = 6;
optional .android.graphics.RectProto waterfall_insets = 7;
}

View File

@@ -18,6 +18,7 @@ syntax = "proto2";
package android.view;
import "frameworks/base/core/proto/android/privacy.proto";
import "frameworks/base/core/proto/android/view/displaycutout.proto";
option java_multiple_files = true;
@@ -34,4 +35,5 @@ message DisplayInfoProto {
// Eg: "Built-in Screen"
optional string name = 5;
optional int32 flags = 6;
optional DisplayCutoutProto cutout = 7;
}