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

Commit 898ff924 authored by Ahmed Fakhry's avatar Ahmed Fakhry
Browse files

Add IDesktopMode multiple desktops APIs

Add two new APIs for multiple desktops:
- `createDesk()`.
- `activateDesk()`.
Currently these APIs are not hooked up yet. This will be done in
follow-up CLs.

Also removes the unused `getVisibleTaskCount()` API.

Bug: 390715986
Test: m
Flag: com.android.window.flags.enable_multiple_desktops_frontend
Change-Id: If5b28c54c0f09caa36fc70913bbcbd2b1faf1686
parent a4e305b1
Loading
Loading
Loading
Loading
+8 −11
Original line number Diff line number Diff line
@@ -2967,6 +2967,14 @@ class DesktopTasksController(
            controller = null
        }

        override fun createDesk(displayId: Int) {
            // TODO: b/362720497 - Implement this API.
        }

        override fun activateDesk(deskId: Int, remoteTransition: RemoteTransition?) {
            // TODO: b/362720497 - Implement this API.
        }

        override fun showDesktopApps(displayId: Int, remoteTransition: RemoteTransition?) {
            executeRemoteCallWithTaskPermission(controller, "showDesktopApps") { c ->
                c.showDesktopApps(displayId, remoteTransition)
@@ -2994,17 +3002,6 @@ class DesktopTasksController(
            )
        }

        override fun getVisibleTaskCount(displayId: Int): Int {
            val result = IntArray(1)
            executeRemoteCallWithTaskPermission(
                controller,
                "visibleTaskCount",
                { controller -> result[0] = controller.visibleTaskCount(displayId) },
                /* blocking= */ true,
            )
            return result[0]
        }

        override fun onDesktopSplitSelectAnimComplete(taskInfo: RunningTaskInfo) {
            executeRemoteCallWithTaskPermission(controller, "onDesktopSplitSelectAnimComplete") { c
                ->
+5 −3
Original line number Diff line number Diff line
@@ -28,6 +28,11 @@ import com.android.wm.shell.shared.desktopmode.DesktopTaskToFrontReason;
 * Interface that is exposed to remote callers to manipulate desktop mode features.
 */
interface IDesktopMode {
    /** If possible, creates a new desk on the display whose ID is `displayId`. */
    oneway void createDesk(int displayId);

    /** Activates the desk whose ID is `deskId` on whatever display it currently exists on. */
    oneway void activateDesk(int deskId, in RemoteTransition remoteTransition);

    /** Show apps on the desktop on the given display */
    void showDesktopApps(int displayId, in RemoteTransition remoteTransition);
@@ -47,9 +52,6 @@ interface IDesktopMode {
    oneway void showDesktopApp(int taskId, in @nullable RemoteTransition remoteTransition,
            in DesktopTaskToFrontReason toFrontReason);

    /** Get count of visible desktop tasks on the given display */
    int getVisibleTaskCount(int displayId);

    /** Perform cleanup transactions after the animation to split select is complete */
    oneway void onDesktopSplitSelectAnimComplete(in RunningTaskInfo taskInfo);