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

Commit 029b21d6 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Correct the user of content mode flag" into main

parents ab16f182 164a1d26
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
    }