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

Commit 164a1d26 authored by Pierre Barbier de Reuille's avatar Pierre Barbier de Reuille
Browse files

Correct the user of content mode flag

The flag was incorrectly used in DesktopModeStatus and not used at all
in DesktopStateImpl. They now both use the flag in
DesktopExperienceFlags.

Flag: com.android.server.display.feature.flags.enable_display_content_mode_management
Test: Manual
Bug: 405181230
Change-Id: Iba35240e595e300c07cf60019636a3713ba52e78
parent a7c400e8
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ package com.android.wm.shell.shared.desktopmode;

import static android.hardware.display.DisplayManager.DISPLAY_CATEGORY_ALL_INCLUDING_DISABLED;

import static com.android.server.display.feature.flags.Flags.enableDisplayContentModeManagement;
import static com.android.wm.shell.shared.bubbles.BubbleAnythingFlagHelper.enableBubbleToFullscreen;

import android.annotation.NonNull;
@@ -165,16 +164,13 @@ public class DesktopModeStatus {
        }

        // TODO (b/395014779): Change this to use WM API
        if ((display.getType() == Display.TYPE_EXTERNAL
                || display.getType() == Display.TYPE_OVERLAY)
                && enableDisplayContentModeManagement()) {
        if (!DesktopExperienceFlags.ENABLE_DISPLAY_CONTENT_MODE_MANAGEMENT.isTrue()) {
            return false;
        }
        final WindowManager wm = context.getSystemService(WindowManager.class);
        return wm != null && wm.isEligibleForDesktopMode(display.getDisplayId());
    }

        return false;
    }

    /**
     * Returns whether the multiple desktops feature is enabled for this device (both backend and
     * frontend implementations).
+1 −0
Original line number Diff line number Diff line
@@ -106,6 +106,7 @@ class DesktopStateImpl(context: Context) : DesktopState {
        if (!canEnterDesktopMode) return false
        if (!enforceDeviceRestrictions) return true
        if (display.type == Display.TYPE_INTERNAL) return canInternalDisplayHostDesktops
        if (!DesktopExperienceFlags.ENABLE_DISPLAY_CONTENT_MODE_MANAGEMENT.isTrue) return false
        return windowManager?.isEligibleForDesktopMode(display.displayId) ?: false
    }