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

Commit 00e6e684 authored by Kean Mariotti's avatar Kean Mariotti
Browse files

Fix WM dump perfetto slice

Move perfetto slice within WindowManagerService#dumpDebugLocked().

The slice was previously traced within WindowTracing and other entry
points (e.g. WindowManagerService#doDump()) were not triggering it.

Flag: EXEMPT minor fix
Bug: 369592408
Test: presubmit
Change-Id: I9019dc64392f9c4aa3e592ea07bda5b1297f8717
parent 6d79476a
Loading
Loading
Loading
Loading
+30 −24
Original line number Diff line number Diff line
@@ -6810,11 +6810,14 @@ public class WindowManagerService extends IWindowManager.Stub
     * @param logLevel  Determines the amount of data to be written to the Protobuf.
     */
    void dumpDebugLocked(ProtoOutputStream proto, @WindowTracingLogLevel int logLevel) {
        Trace.traceBegin(Trace.TRACE_TAG_WINDOW_MANAGER, "dumpDebugLocked");
        try {
            mPolicy.dumpDebug(proto, POLICY);
            mRoot.dumpDebug(proto, ROOT_WINDOW_CONTAINER, logLevel);
            final DisplayContent topFocusedDisplayContent = mRoot.getTopFocusedDisplayContent();
            if (topFocusedDisplayContent.mCurrentFocus != null) {
            topFocusedDisplayContent.mCurrentFocus.writeIdentifierToProto(proto, FOCUSED_WINDOW);
                topFocusedDisplayContent.mCurrentFocus
                        .writeIdentifierToProto(proto, FOCUSED_WINDOW);
            }
            if (topFocusedDisplayContent.mFocusedApp != null) {
                topFocusedDisplayContent.mFocusedApp.writeNameToProto(proto, FOCUSED_APP);
@@ -6827,13 +6830,16 @@ public class WindowManagerService extends IWindowManager.Stub
            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.
            // 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);

            // Write the BackNavigationController's state into the protocol buffer
            mAtmService.mBackNavigationController.dumpDebug(proto, BACK_NAVIGATION);
        } finally {
            Trace.traceEnd(Trace.TRACE_TAG_WINDOW_MANAGER);
        }
    }

    private void dumpWindowsLocked(PrintWriter pw, boolean dumpAll,
+1 −6
Original line number Diff line number Diff line
@@ -167,12 +167,7 @@ abstract class WindowTracing {

            long token = os.start(WINDOW_MANAGER_SERVICE);
            synchronized (mGlobalLock) {
                Trace.traceBegin(Trace.TRACE_TAG_WINDOW_MANAGER, "dumpDebugLocked");
                try {
                mService.dumpDebugLocked(os, logLevel);
                } finally {
                    Trace.traceEnd(Trace.TRACE_TAG_WINDOW_MANAGER);
                }
            }
            os.end(token);
        } catch (Exception e) {