summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DisplayDeskState.aidl31
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/IDesktopTaskListener.aidl41
2 files changed, 66 insertions, 6 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DisplayDeskState.aidl b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DisplayDeskState.aidl
new file mode 100644
index 000000000000..59add47fc79d
--- /dev/null
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DisplayDeskState.aidl
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2025 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.wm.shell.desktopmode;
+
+/**
+ * Defines the state of desks on a display whose ID is `displayId`, which is:
+ * - `canCreateDesks`: whether it's possible to create new desks on this display.
+ * - `activeDeskId`: the currently active desk Id, or `-1` if none is active.
+ * - `deskId`: the list of desk Ids of the available desks on this display.
+ */
+parcelable DisplayDeskState {
+ int displayId;
+ boolean canCreateDesk;
+ int activeDeskId;
+ int[] deskIds;
+}
+
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/IDesktopTaskListener.aidl b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/IDesktopTaskListener.aidl
index 6002a4dfe0d9..7ed1581cdfdb 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/IDesktopTaskListener.aidl
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/IDesktopTaskListener.aidl
@@ -16,27 +16,56 @@
package com.android.wm.shell.desktopmode;
+import com.android.wm.shell.desktopmode.DisplayDeskState;
+
/**
* Allows external processes to register a listener in WMShell to get updates about desktop task
* state.
*/
-interface IDesktopTaskListener {
+oneway interface IDesktopTaskListener {
+
+ /**
+ * Called once when the listener first gets connected to initialize it with the current state of
+ * desks in Shell.
+ */
+ void onListenerConnected(in DisplayDeskState[] displayDeskStates);
/** Desktop tasks visibility has changed. Visible if at least 1 task is visible. */
- oneway void onTasksVisibilityChanged(int displayId, int visibleTasksCount);
+ void onTasksVisibilityChanged(int displayId, int visibleTasksCount);
/** @deprecated this is no longer supported. */
- oneway void onStashedChanged(int displayId, boolean stashed);
+ void onStashedChanged(int displayId, boolean stashed);
/**
* Shows taskbar corner radius when running desktop tasks are updated if
* [hasTasksRequiringTaskbarRounding] is true.
*/
- oneway void onTaskbarCornerRoundingUpdate(boolean hasTasksRequiringTaskbarRounding);
+ void onTaskbarCornerRoundingUpdate(boolean hasTasksRequiringTaskbarRounding);
/** Entering desktop mode transition is started, send the signal with transition duration. */
- oneway void onEnterDesktopModeTransitionStarted(int transitionDuration);
+ void onEnterDesktopModeTransitionStarted(int transitionDuration);
/** Exiting desktop mode transition is started, send the signal with transition duration. */
- oneway void onExitDesktopModeTransitionStarted(int transitionDuration);
+ void onExitDesktopModeTransitionStarted(int transitionDuration);
+
+ /**
+ * Called when the conditions that allow the creation of a new desk on the display whose ID is
+ * `displayId` changes to `canCreateDesks`. It's also called when a new display is added.
+ */
+ void onCanCreateDesksChanged(int displayId, boolean canCreateDesks);
+
+ /** Called when a desk whose ID is `deskId` is added to the display whose ID is `displayId`. */
+ void onDeskAdded(int displayId, int deskId);
+
+ /**
+ * Called when a desk whose ID is `deskId` is removed from the display whose ID is `displayId`.
+ */
+ void onDeskRemoved(int displayId, int deskId);
+
+ /**
+ * Called when the active desk changes on the display whose ID is `displayId`.
+ * If `newActiveDesk` is -1, it means a desk is no longer active on the display.
+ * If `oldActiveDesk` is -1, it means a desk was not active on the display.
+ */
+ void onActiveDeskChanged(int displayId, int newActiveDesk, int oldActiveDesk);
} \ No newline at end of file