Add trim levels to writeToProto
Enables faster dumping without information that is not relevant in
certain scenarios.
Bug: 64831661
Test: adb shell dumpsys window --proto | hexdump -C
Change-Id: I10827f2dd092fb53b2d452bb12ef76a6adb50f41
diff --git a/services/core/java/com/android/server/wm/RootWindowContainer.java b/services/core/java/com/android/server/wm/RootWindowContainer.java
index fd57470..a710441 100644
--- a/services/core/java/com/android/server/wm/RootWindowContainer.java
+++ b/services/core/java/com/android/server/wm/RootWindowContainer.java
@@ -1081,19 +1081,21 @@
@CallSuper
@Override
- public void writeToProto(ProtoOutputStream proto, long fieldId) {
+ public void writeToProto(ProtoOutputStream proto, long fieldId, boolean trim) {
final long token = proto.start(fieldId);
- super.writeToProto(proto, WINDOW_CONTAINER);
+ super.writeToProto(proto, WINDOW_CONTAINER, trim);
if (mService.mDisplayReady) {
final int count = mChildren.size();
for (int i = 0; i < count; ++i) {
final DisplayContent displayContent = mChildren.get(i);
- displayContent.writeToProto(proto, DISPLAYS);
+ displayContent.writeToProto(proto, DISPLAYS, trim);
}
}
- forAllWindows((w) -> {
- w.writeIdentifierToProto(proto, WINDOWS);
- }, true);
+ if (!trim) {
+ forAllWindows((w) -> {
+ w.writeIdentifierToProto(proto, WINDOWS);
+ }, true);
+ }
proto.end(token);
}