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

Commit 4921ccf5 authored by Adrian Roos's avatar Adrian Roos
Browse files

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
parent 9b874662
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -504,7 +504,7 @@ class ActivityDisplay extends ConfigurationContainer<ActivityStack> {

    public void writeToProto(ProtoOutputStream proto, long fieldId) {
        final long token = proto.start(fieldId);
        super.writeToProto(proto, CONFIGURATION_CONTAINER);
        super.writeToProto(proto, CONFIGURATION_CONTAINER, false /* trim */);
        proto.write(ID, mDisplayId);
        for (int stackNdx = mStacks.size() - 1; stackNdx >= 0; --stackNdx) {
            final ActivityStack stack = mStacks.get(stackNdx);
+1 −1
Original line number Diff line number Diff line
@@ -2812,7 +2812,7 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo

    public void writeToProto(ProtoOutputStream proto, long fieldId) {
        final long token = proto.start(fieldId);
        super.writeToProto(proto, CONFIGURATION_CONTAINER);
        super.writeToProto(proto, CONFIGURATION_CONTAINER, false /* trim */);
        writeIdentifierToProto(proto, IDENTIFIER);
        proto.write(STATE, state.toString());
        proto.write(VISIBLE, visible);
+1 −1
Original line number Diff line number Diff line
@@ -5290,7 +5290,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai

    public void writeToProto(ProtoOutputStream proto, long fieldId) {
        final long token = proto.start(fieldId);
        super.writeToProto(proto, CONFIGURATION_CONTAINER);
        super.writeToProto(proto, CONFIGURATION_CONTAINER, false /* trim */);
        proto.write(ID, mStackId);
        for (int taskNdx = mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {
            final TaskRecord task = mTaskHistory.get(taskNdx);
+1 −1
Original line number Diff line number Diff line
@@ -3799,7 +3799,7 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
    }

    public void writeToProto(ProtoOutputStream proto) {
        super.writeToProto(proto, CONFIGURATION_CONTAINER);
        super.writeToProto(proto, CONFIGURATION_CONTAINER, false /* trim */);
        for (int displayNdx = 0; displayNdx < mActivityDisplays.size(); ++displayNdx) {
            ActivityDisplay activityDisplay = mActivityDisplays.valueAt(displayNdx);
            activityDisplay.writeToProto(proto, DISPLAYS);
+1 −1
Original line number Diff line number Diff line
@@ -2253,7 +2253,7 @@ class TaskRecord extends ConfigurationContainer implements TaskWindowContainerLi

    public void writeToProto(ProtoOutputStream proto, long fieldId) {
        final long token = proto.start(fieldId);
        super.writeToProto(proto, CONFIGURATION_CONTAINER);
        super.writeToProto(proto, CONFIGURATION_CONTAINER, false /* trim */);
        proto.write(ID, taskId);
        for (int i = mActivities.size() - 1; i >= 0; i--) {
            ActivityRecord activity = mActivities.get(i);
Loading