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

Commit e08458ee authored by Ats Jenk's avatar Ats Jenk
Browse files

Update DesktopMode aidl API to use display id

Update the APIs to show desktop apps and query number of of visible
tasks to use display ids.

Bug: 278084491
Test: build WMShell
Change-Id: I14db20f6ecfa42fc8ffcfe4466537b14c106c1b3
parent 966ee1fd
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@ import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.WindowManager.TRANSIT_CHANGE;
import static android.view.WindowManager.TRANSIT_NONE;
import static android.view.WindowManager.TRANSIT_OPEN;
@@ -494,18 +493,17 @@ public class DesktopModeController implements RemoteCallable<DesktopModeControll
            mController = null;
        }

        // TODO(b/278084491): pass in display id
        public void showDesktopApps() {
        @Override
        public void showDesktopApps(int displayId) {
            executeRemoteCallWithTaskPermission(mController, "showDesktopApps",
                    controller -> controller.showDesktopApps(DEFAULT_DISPLAY));
                    controller -> controller.showDesktopApps(displayId));
        }

        // TODO(b/278084491): pass in display id
        @Override
        public int getVisibleTaskCount() throws RemoteException {
        public int getVisibleTaskCount(int displayId) throws RemoteException {
            int[] result = new int[1];
            executeRemoteCallWithTaskPermission(mController, "getVisibleTaskCount",
                    controller -> result[0] = controller.getVisibleTaskCount(DEFAULT_DISPLAY),
                    controller -> result[0] = controller.getVisibleTaskCount(displayId),
                    true /* blocking */
            );
            return result[0];
+4 −7
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@ import android.graphics.Rect
import android.graphics.Region
import android.os.IBinder
import android.os.SystemProperties
import android.view.Display.DEFAULT_DISPLAY
import android.view.SurfaceControl
import android.view.WindowManager.TRANSIT_CHANGE
import android.view.WindowManager.TRANSIT_NONE
@@ -561,21 +560,19 @@ class DesktopTasksController(
            controller = null
        }

        // TODO(b/278084491): pass in display id
        override fun showDesktopApps() {
        override fun showDesktopApps(displayId: Int) {
            ExecutorUtils.executeRemoteCallWithTaskPermission(
                controller,
                "showDesktopApps"
            ) { c -> c.showDesktopApps(DEFAULT_DISPLAY) }
            ) { c -> c.showDesktopApps(displayId) }
        }

        // TODO(b/278084491): pass in display id
        override fun getVisibleTaskCount(): Int {
        override fun getVisibleTaskCount(displayId: Int): Int {
            val result = IntArray(1)
            ExecutorUtils.executeRemoteCallWithTaskPermission(
                controller,
                "getVisibleTaskCount",
                { controller -> result[0] = controller.getVisibleTaskCount(DEFAULT_DISPLAY) },
                { controller -> result[0] = controller.getVisibleTaskCount(displayId) },
                true /* blocking */
            )
            return result[0]
+4 −4
Original line number Diff line number Diff line
@@ -21,9 +21,9 @@ package com.android.wm.shell.desktopmode;
 */
interface IDesktopMode {

    /** Show apps on the desktop */
    void showDesktopApps();
    /** Show apps on the desktop on the given display */
    void showDesktopApps(int displayId);

    /** Get count of visible desktop tasks */
    int getVisibleTaskCount();
    /** Get count of visible desktop tasks on the given display */
    int getVisibleTaskCount(int displayId);
}
 No newline at end of file