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

Commit 8b984a26 authored by Gustav Sennton's avatar Gustav Sennton
Browse files

Print max-task-limit flags in DesktopTasksController dumpsys.

- Add dumpsys for DesktopModeStatus, and trigger that from
DesktopTasksController.
- Add max-task-limit feature info to the DesktopModeStatus dump

The DesktopTasksController dumpsys state is added to the Android Bug
Tool under the view:

Bug >
APP SERVICES SERVICE >
com.android.systemui/.dump.SystemUIAuxiliaryDumpService >
com.android.systemui.wmshell.WMShell

Flag: com.android.window.flags.enable_desktop_windowing_mode
Bug: 355611890
Test: generated bugreport, checked with ABT
Change-Id: I8fa427aa12e722776ef89106edfe4a8ac06ff149
parent 67c73c52
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -24,6 +24,8 @@ import com.android.internal.R;
import com.android.internal.annotations.VisibleForTesting;
import com.android.window.flags.Flags;

import java.io.PrintWriter;

/**
 * Constants for desktop mode feature
 */
@@ -203,4 +205,19 @@ public class DesktopModeStatus {
    private static boolean isDeviceEligibleForDesktopMode(@NonNull Context context) {
        return !enforceDeviceRestrictions() || isDesktopModeSupported(context);
    }

    /** Dumps DesktopModeStatus flags and configs. */
    public static void dump(PrintWriter pw, String prefix, Context context) {
        String innerPrefix = prefix + "  ";
        pw.print(prefix); pw.println(TAG);
        pw.print(innerPrefix); pw.print("maxTaskLimit="); pw.println(getMaxTaskLimit(context));

        pw.print(innerPrefix); pw.print("maxTaskLimit config override=");
        pw.println(context.getResources().getInteger(
                R.integer.config_maxDesktopWindowingActiveTasks));

        SystemProperties.Handle maxTaskLimitHandle = SystemProperties.find(MAX_TASK_LIMIT_SYS_PROP);
        pw.print(innerPrefix); pw.print("maxTaskLimit sysprop=");
        pw.println(maxTaskLimitHandle == null ? "null" : maxTaskLimitHandle.getInt(/* def= */ -1));
    }
}
+1 −0
Original line number Diff line number Diff line
@@ -1513,6 +1513,7 @@ class DesktopTasksController(
    private fun dump(pw: PrintWriter, prefix: String) {
        val innerPrefix = "$prefix  "
        pw.println("${prefix}DesktopTasksController")
        DesktopModeStatus.dump(pw, innerPrefix, context)
        taskRepository.dump(pw, innerPrefix)
    }