• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2023 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.wm.shell.desktopmode;
18 
19 import com.android.wm.shell.desktopmode.DisplayDeskState;
20 
21 /**
22  * Allows external processes to register a listener in WMShell to get updates about desktop task
23  * state.
24  */
25 oneway interface IDesktopTaskListener {
26 
27     /**
28      * Called once when the listener first gets connected to initialize it with the current state of
29      * desks in Shell.
30      */
onListenerConnected(in DisplayDeskState[] displayDeskStates, boolean canCreateDesks)31     void onListenerConnected(in DisplayDeskState[] displayDeskStates, boolean canCreateDesks);
32 
33     /** Desktop tasks visibility has changed. Visible if at least 1 task is visible. */
onTasksVisibilityChanged(int displayId, int visibleTasksCount)34     void onTasksVisibilityChanged(int displayId, int visibleTasksCount);
35 
36     /** @deprecated this is no longer supported. */
onStashedChanged(int displayId, boolean stashed)37     void onStashedChanged(int displayId, boolean stashed);
38 
39     /**
40      * Shows taskbar corner radius when running desktop tasks are updated if
41      * [hasTasksRequiringTaskbarRounding] is true.
42      */
onTaskbarCornerRoundingUpdate(boolean hasTasksRequiringTaskbarRounding)43     void onTaskbarCornerRoundingUpdate(boolean hasTasksRequiringTaskbarRounding);
44 
45     /** Entering desktop mode transition is started, send the signal with transition duration. */
onEnterDesktopModeTransitionStarted(int transitionDuration)46     void onEnterDesktopModeTransitionStarted(int transitionDuration);
47 
48     /** Exiting desktop mode transition is started, send the signal with transition duration. */
onExitDesktopModeTransitionStarted(int transitionDuration)49     void onExitDesktopModeTransitionStarted(int transitionDuration);
50 
51     /**
52      * Called when the conditions that allow the creation of a new desk changes. This is a global
53      * state for the entire device.
54      */
onCanCreateDesksChanged(boolean canCreateDesks)55     void onCanCreateDesksChanged(boolean canCreateDesks);
56 
57     /** Called when a desk whose ID is `deskId` is added to the display whose ID is `displayId`. */
onDeskAdded(int displayId, int deskId)58     void onDeskAdded(int displayId, int deskId);
59 
60     /**
61      * Called when a desk whose ID is `deskId` is removed from the display whose ID is `displayId`.
62      */
onDeskRemoved(int displayId, int deskId)63     void onDeskRemoved(int displayId, int deskId);
64 
65     /**
66      * Called when the active desk changes on the display whose ID is `displayId`.
67      * If `newActiveDesk` is -1, it means a desk is no longer active on the display.
68      * If `oldActiveDesk` is -1, it means a desk was not active on the display.
69      */
onActiveDeskChanged(int displayId, int newActiveDesk, int oldActiveDesk)70     void onActiveDeskChanged(int displayId, int newActiveDesk, int oldActiveDesk);
71 }