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

Commit fd6ce96d authored by Ats Jenk's avatar Ats Jenk Committed by Automerger Merge Worker
Browse files

Merge "Update DesktopMode aidl API to use display id" into udc-dev am: 05f9dae0 am: 95111868

parents 7b756408 95111868
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