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

Commit 2d73c0bc authored by Massimo Carli's avatar Massimo Carli
Browse files

[5/n] Add Debug support

Add the option to enable debug messages for a
specific component.

The default CompatUILogger implementation uses ProtoLog and
can be enabled/disabled using protolog commands.

Flag: com.android.window.flags.app_compat_ui_framework
Fixes: 323883854
Test: m

Change-Id: Iad7f0fb3c0783c1a43334408c53cdee1ef399579
parent eca09375
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -16,6 +16,9 @@

package com.android.wm.shell.compatui.api

import com.android.internal.protolog.ProtoLog
import com.android.wm.shell.protolog.ShellProtoLogGroup

/**
 * Defines the predicates to invoke for understanding if a component can be created or destroyed.
 */
@@ -39,6 +42,7 @@ class CompatUILifecyclePredicates(
 * Describes each compat ui component to the framework.
 */
class CompatUISpec(
    val log: (String) -> Unit = { str -> ProtoLog.v(ShellProtoLogGroup.WM_SHELL_COMPAT_UI, str) },
    // Unique name for the component. It's used for debug and for generating the
    // unique component identifier in the system.
    val name: String,
+3 −0
Original line number Diff line number Diff line
@@ -61,6 +61,8 @@ public enum ShellProtoLogGroup implements IProtoLogGroup {
            Consts.TAG_WM_SHELL),
    WM_SHELL_BUBBLES(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false,
            "Bubbles"),
    WM_SHELL_COMPAT_UI(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false,
            Consts.TAG_WM_COMPAT_UI),
    TEST_GROUP(true, true, false, "WindowManagerShellProtoLogTest");

    private final boolean mEnabled;
@@ -128,6 +130,7 @@ public enum ShellProtoLogGroup implements IProtoLogGroup {
        private static final String TAG_WM_STARTING_WINDOW = "ShellStartingWindow";
        private static final String TAG_WM_SPLIT_SCREEN = "ShellSplitScreen";
        private static final String TAG_WM_DESKTOP_MODE = "ShellDesktopMode";
        private static final String TAG_WM_COMPAT_UI = "CompatUi";

        private static final boolean ENABLE_DEBUG = true;
        private static final boolean ENABLE_LOG_TO_PROTO_DEBUG = true;