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

Commit aaf54cb6 authored by Toshiki Kikuchi's avatar Toshiki Kikuchi
Browse files

Add more verbose logs for desktop-first factors

This CL adds more verbose logs for desktop-first decision factors, which
should make analyzing reports easier.

Note that this CL doesn't contain any functional change.

Fix: 406611707
Flag: com.android.window.flags.enable_display_windowing_mode_switching
Flag: com.android.window.flags.form_factor_based_desktop_first_switch
Test: build and logcat
Change-Id: I45d0f91d70f2067312510a66474ffb6fbc4485d9
parent 5ce57237
Loading
Loading
Loading
Loading
+24 −3
Original line number Diff line number Diff line
@@ -149,12 +149,33 @@ class DesktopDisplayModeController(
    // Do not directly use this method to check the state of desktop-first mode. Check the display
    // windowing mode instead.
    private fun canDesktopFirstModeBeEnabledOnDefaultDisplay(): Boolean {
        if (isDefaultDisplayDesktopEligible()) {
            if (isExtendedDisplayEnabled() && hasExternalDisplay()) {
        val isDefaultDisplayDesktopEligible = isDefaultDisplayDesktopEligible()
        logV(
            "canDesktopFirstModeBeEnabledOnDefaultDisplay: isDefaultDisplayDesktopEligible=%s",
            isDefaultDisplayDesktopEligible,
        )
        if (isDefaultDisplayDesktopEligible) {
            val isExtendedDisplayEnabled = isExtendedDisplayEnabled()
            val hasExternalDisplay = hasExternalDisplay()
            logV(
                "canDesktopFirstModeBeEnabledOnDefaultDisplay: isExtendedDisplayEnabled=%s" +
                    " hasExternalDisplay=%s",
                isExtendedDisplayEnabled,
                hasExternalDisplay,
            )
            if (isExtendedDisplayEnabled && hasExternalDisplay) {
                return true
            }
            if (DesktopExperienceFlags.FORM_FACTOR_BASED_DESKTOP_FIRST_SWITCH.isTrue) {
                if (hasAnyTouchpadDevice() && hasAnyPhysicalKeyboardDevice()) {
                val hasAnyTouchpadDevice = hasAnyTouchpadDevice()
                val hasAnyPhysicalKeyboardDevice = hasAnyPhysicalKeyboardDevice()
                logV(
                    "canDesktopFirstModeBeEnabledOnDefaultDisplay: hasAnyTouchpadDevice=%s" +
                        " hasAnyPhysicalKeyboardDevice=%s",
                    hasAnyTouchpadDevice,
                    hasAnyPhysicalKeyboardDevice,
                )
                if (hasAnyTouchpadDevice && hasAnyPhysicalKeyboardDevice) {
                    return true
                }
            }