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

Commit 8be479c6 authored by Yunfan Chen's avatar Yunfan Chen
Browse files

Dump WindowState to InsetsSourceProvider Proto

This CL adds WindowState into InsetsSourceProvider proto. Such
that CTS can get the window actually providing the insets, instead of
guessing from the window types.

Besides, changed the insets source proto to let it use int typed insets
type, otherwise, it will be difficult to use when insets type names are
substring of others.

Test: build and check the generated files
Bug: 304398707
Change-Id: I900ead08c6531c454ba0300e8f9c0c9a5cf7384e
parent f6be0714
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.view;

import static android.view.InsetsSourceProto.FRAME;
import static android.view.InsetsSourceProto.TYPE;
import static android.view.InsetsSourceProto.TYPE_NUMBER;
import static android.view.InsetsSourceProto.VISIBLE;
import static android.view.InsetsSourceProto.VISIBLE_FRAME;
import static android.view.WindowInsets.Type.captionBar;
@@ -352,6 +353,7 @@ public class InsetsSource implements Parcelable {
    public void dumpDebug(ProtoOutputStream proto, long fieldId) {
        final long token = proto.start(fieldId);
        proto.write(TYPE, WindowInsets.Type.toString(mType));
        proto.write(TYPE_NUMBER, mType);
        mFrame.dumpDebug(proto, FRAME);
        if (mVisibleFrame != null) {
            mVisibleFrame.dumpDebug(proto, VISIBLE_FRAME);
+1 −0
Original line number Diff line number Diff line
@@ -593,6 +593,7 @@ message InsetsSourceProviderProto {
    optional bool seamless_rotating = 13;
    optional int64 finish_seamless_rotate_frame_number = 14;
    optional bool controllable = 15;
    optional WindowStateProto source_window_state = 16;
}

message ImeInsetsSourceProviderProto {
+1 −0
Original line number Diff line number Diff line
@@ -30,4 +30,5 @@ message InsetsSourceProto {
    optional .android.graphics.RectProto frame = 2;
    optional .android.graphics.RectProto visible_frame = 3;
    optional bool visible = 4;
    optional int32 type_number = 5;
}
 No newline at end of file
+4 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import static com.android.server.wm.InsetsSourceProviderProto.PENDING_CONTROL_TA
import static com.android.server.wm.InsetsSourceProviderProto.SEAMLESS_ROTATING;
import static com.android.server.wm.InsetsSourceProviderProto.SERVER_VISIBLE;
import static com.android.server.wm.InsetsSourceProviderProto.SOURCE;
import static com.android.server.wm.InsetsSourceProviderProto.SOURCE_WINDOW_STATE;
import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_INSETS_CONTROL;

import android.annotation.NonNull;
@@ -680,6 +681,9 @@ class InsetsSourceProvider {
        proto.write(SERVER_VISIBLE, mServerVisible);
        proto.write(SEAMLESS_ROTATING, mSeamlessRotating);
        proto.write(CONTROLLABLE, mControllable);
        if (mWindowContainer != null && mWindowContainer.asWindowState() != null) {
            mWindowContainer.asWindowState().dumpDebug(proto, SOURCE_WINDOW_STATE, logLevel);
        }
        proto.end(token);
    }