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

Commit 24c382dc authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add new multi-desks APIs in `IDesktopTaskListener`" into main

parents 58affa14 daa1919f
Loading
Loading
Loading
Loading
+31 −0
Original line number Diff line number Diff line
/*
 * 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;
}
+35 −6
Original line number Diff line number Diff line
@@ -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