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

Commit 8a316ddb authored by Ahmed Fakhry's avatar Ahmed Fakhry
Browse files

Add DesktopModeStatus.enableMultipleDesktops()

This convenience method will be used in launhcer to check that the
device supports multiple desktops and both backend and frontend flags
are enabled.

Bug: 388527943
Test: m
Flag: com.android.window.flags.enable_multiple_desktops_frontend
Change-Id: I374efcb272f5540b28fd333539f7f4df22852a92
parent 4b10d202
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -232,6 +232,16 @@ public class DesktopModeStatus {
        return DesktopModeFlags.ENABLE_DESKTOP_WINDOWING_MODE.isTrue();
    }

    /**
     * Returns whether the multiple desktops feature is enabled for this device (both backend and
     * frontend implementations).
     */
    public static boolean enableMultipleDesktops(@NonNull Context context) {
        return Flags.enableMultipleDesktopsBackend()
                && Flags.enableMultipleDesktopsFrontend()
                && canEnterDesktopMode(context);
    }

    /**
     * @return {@code true} if this device is requesting to show the app handle despite non
     * necessarily enabling desktop mode