Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 112c0743 authored by Nataniel Borges's avatar Nataniel Borges
Browse files

Add display cutout to proto dump

Bug: 262390300
Test: atest FlickerTest
Change-Id: I711952bbd3bbd72ccbac2306d46aedce361610e7
parent db02059f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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);
    }

+4 −0
Original line number Diff line number Diff line
@@ -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);
    }

+1 −0
Original line number Diff line number Diff line
@@ -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;
}
+2 −0
Original line number Diff line number Diff line
@@ -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;
}