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

Commit 2045b050 authored by Kazuki Takise's avatar Kazuki Takise
Browse files

Add protolog for presentation

Flag: com.android.window.flags.enable_presentation_for_connected_displays
Bug: 395191537
Test: adb shell wm logging enable-text WM_DEBUG_PRESENTATION
Change-Id: I641a39be1d64f2ee34b16c2333432c9bf4bced5d
parent a4936735
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -100,6 +100,8 @@ public enum WmProtoLogGroups implements IProtoLogGroup {
    WM_DEBUG_TPL(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false, Consts.TAG_WM),
    WM_DEBUG_EMBEDDED_WINDOWS(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false,
            Consts.TAG_WM),
    WM_DEBUG_PRESENTATION(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false,
            Consts.TAG_WM),
    TEST_GROUP(true, true, false, "WindowManagerProtoLogTest");

    private final boolean mEnabled;
+8 −1
Original line number Diff line number Diff line
@@ -21,6 +21,9 @@ import static com.android.window.flags.Flags.enablePresentationForConnectedDispl
import android.annotation.NonNull;
import android.util.IntArray;

import com.android.internal.protolog.ProtoLog;
import com.android.internal.protolog.WmProtoLogGroups;

/**
 * Manages presentation windows.
 */
@@ -50,7 +53,9 @@ class PresentationController {
        if (isPresenting(displayId)) {
            return;
        }
        mPresentingDisplayIds.add(displayId);
        ProtoLog.v(WmProtoLogGroups.WM_DEBUG_PRESENTATION, "Presentation added to display %d: %s",
                win.getDisplayId(), win);
        mPresentingDisplayIds.add(win.getDisplayId());
        if (enablePresentationForConnectedDisplays()) {
            // A presentation hides all activities behind on the same display.
            win.mDisplayContent.ensureActivitiesVisible(/*starting=*/ null,
@@ -64,6 +69,8 @@ class PresentationController {
        if (!isPresenting(displayId)) {
            return;
        }
        ProtoLog.v(WmProtoLogGroups.WM_DEBUG_PRESENTATION,
                "Presentation removed from display %d: %s", win.getDisplayId(), win);
        // TODO(b/393945496): Make sure that there's one presentation at most per display.
        final int displayIdIndex = mPresentingDisplayIds.indexOf(displayId);
        if (displayIdIndex != -1) {