Add window_frames_valid to proto

This is a step to move the window layout to the client side.

Once the window layout is moved to the client side, when something (such
as configuration) is changed, the server will send MSG_RESIZED to the
client. Before the client reports the new frame to the server, the frame
at the server side might not be up-to-date.

This gives WindowManagerState a signal to decide if it should retry.

Bug: 161810301
Test: presubmit
Change-Id: Idece0f559e7013ff389cbb7aa74d63734c95f64c
This commit is contained in:
Tiger Huang
2022-03-04 19:46:34 +08:00
parent 3e2a850fa6
commit 1153c8f352
2 changed files with 7 additions and 1 deletions

View File

@@ -53,6 +53,7 @@ message WindowManagerServiceDumpProto {
optional int32 last_orientation = 8 [(.android.typedef) = "android.content.pm.ActivityInfo.ScreenOrientation", deprecated=true];
optional int32 focused_display_id = 9;
optional bool hard_keyboard_available = 10;
optional bool window_frames_valid = 11;
}
/* represents RootWindowContainer object */

View File

@@ -141,6 +141,7 @@ import static com.android.server.wm.WindowManagerServiceDumpProto.HARD_KEYBOARD_
import static com.android.server.wm.WindowManagerServiceDumpProto.INPUT_METHOD_WINDOW;
import static com.android.server.wm.WindowManagerServiceDumpProto.POLICY;
import static com.android.server.wm.WindowManagerServiceDumpProto.ROOT_WINDOW_CONTAINER;
import static com.android.server.wm.WindowManagerServiceDumpProto.WINDOW_FRAMES_VALID;
import android.Manifest;
import android.Manifest.permission;
@@ -6437,9 +6438,13 @@ public class WindowManagerService extends IWindowManager.Stub
imeWindow.writeIdentifierToProto(proto, INPUT_METHOD_WINDOW);
}
proto.write(DISPLAY_FROZEN, mDisplayFrozen);
final DisplayContent defaultDisplayContent = getDefaultDisplayContentLocked();
proto.write(FOCUSED_DISPLAY_ID, topFocusedDisplayContent.getDisplayId());
proto.write(HARD_KEYBOARD_AVAILABLE, mHardKeyboardAvailable);
// This is always true for now since we still update the window frames at the server side.
// Once we move the window layout to the client side, this can be false when we are waiting
// for the frames.
proto.write(WINDOW_FRAMES_VALID, true);
}
private void dumpWindowsLocked(PrintWriter pw, boolean dumpAll,