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

Commit 53f5bb34 authored by Eric Lin's avatar Eric Lin
Browse files

Improve TaskListener logging for clarity.

The log output for listener migration in
ShellTaskOrganizer#updateTaskListenerIfNeeded() was difficult to
interpret. Specifically, the toString() implementation of
StageTaskListener did not include the class name, making it hard to
identify the listener type from the logs alone.

This change improves the toString() implementations for
StageTaskListener and FullscreenTaskListener to enhance log readability.
StageTaskListener now includes its class name and formats its state as
key-value pairs. FullscreenTaskListener is simplified to return its
class name.

For example, the log output is improved from: "Migrating from listener
mId: SIDE ... to FullscreenTaskListener:TASK_LISTENER_TYPE_FULLSCREEN"
to the more descriptive: "Migrating from listener
StageTaskListener(mId=MAIN, ...) to FullscreenTaskListener". This makes
debugging listener migrations significantly clearer.

Bug: 387193964
Flag: EXEMPT DEBUG
Test: adb shell cmd protolog_configuration logcat enable WM_SHELL_TRANSITIONS
Test: Put app A and B into split then launch app A into fullscreen
Change-Id: I164f7b395a45f36474f3c2f099c31b0e73b94428
parent 608bfda6
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -17,7 +17,6 @@
package com.android.wm.shell.fullscreen;
package com.android.wm.shell.fullscreen;


import static com.android.wm.shell.ShellTaskOrganizer.TASK_LISTENER_TYPE_FULLSCREEN;
import static com.android.wm.shell.ShellTaskOrganizer.TASK_LISTENER_TYPE_FULLSCREEN;
import static com.android.wm.shell.ShellTaskOrganizer.taskListenerTypeToString;


import android.app.ActivityManager;
import android.app.ActivityManager;
import android.app.ActivityManager.RunningTaskInfo;
import android.app.ActivityManager.RunningTaskInfo;
@@ -177,6 +176,6 @@ public class FullscreenTaskListener implements ShellTaskOrganizer.TaskListener {


    @Override
    @Override
    public String toString() {
    public String toString() {
        return TAG + ":" + taskListenerTypeToString(TASK_LISTENER_TYPE_FULLSCREEN);
        return TAG;
    }
    }
}
}
+7 −6
Original line number Original line Diff line number Diff line
@@ -17,7 +17,6 @@
package com.android.wm.shell.splitscreen;
package com.android.wm.shell.splitscreen;


import static android.app.ActivityTaskManager.INVALID_TASK_ID;
import static android.app.ActivityTaskManager.INVALID_TASK_ID;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW;
import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW;
import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
import static android.content.res.Configuration.SCREEN_HEIGHT_DP_UNDEFINED;
import static android.content.res.Configuration.SCREEN_HEIGHT_DP_UNDEFINED;
@@ -583,11 +582,13 @@ public class StageTaskListener implements ShellTaskOrganizer.TaskListener {


    @Override
    @Override
    public String toString() {
    public String toString() {
        return "mId: " + stageTypeToString(mId)
        return TAG + "("
                + " mVisible: " + mVisible
                + "mId=" + stageTypeToString(mId) + ", "
                + " mActive: " + mIsActive
                + "mVisible=" + mVisible + ", "
                + " mHasRootTask: " + mHasRootTask
                + "mActive=" + mIsActive + ", "
                + " childSize: " + mChildrenTaskInfo.size();
                + "mHasRootTask=" + mHasRootTask + ", "
                + "childSize=" + mChildrenTaskInfo.size()
                + ")";
    }
    }


    @Override
    @Override