1 /*
2  * Copyright (C) 2022 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 android.app.ActivityManager.RunningTaskInfo;
20 import android.window.RemoteTransition;
21 import com.android.wm.shell.common.desktopmode.DesktopModeTransitionSource;
22 import com.android.wm.shell.desktopmode.IDesktopTaskListener;
23 
24 /**
25  * Interface that is exposed to remote callers to manipulate desktop mode features.
26  */
27 interface IDesktopMode {
28 
29     /** Show apps on the desktop on the given display */
showDesktopApps(int displayId, in RemoteTransition remoteTransition)30     void showDesktopApps(int displayId, in RemoteTransition remoteTransition);
31 
32     /** @deprecated use {@link #showDesktopApps} instead. */
stashDesktopApps(int displayId)33     void stashDesktopApps(int displayId);
34 
35     /** @deprecated this is no longer supported. */
hideStashedDesktopApps(int displayId)36     void hideStashedDesktopApps(int displayId);
37 
38     /** Bring task with the given id to front */
showDesktopApp(int taskId)39     oneway void showDesktopApp(int taskId);
40 
41     /** Get count of visible desktop tasks on the given display */
getVisibleTaskCount(int displayId)42     int getVisibleTaskCount(int displayId);
43 
44     /** Perform cleanup transactions after the animation to split select is complete */
onDesktopSplitSelectAnimComplete(in RunningTaskInfo taskInfo)45     oneway void onDesktopSplitSelectAnimComplete(in RunningTaskInfo taskInfo);
46 
47     /** Set listener that will receive callbacks about updates to desktop tasks */
setTaskListener(IDesktopTaskListener listener)48     oneway void setTaskListener(IDesktopTaskListener listener);
49 
50     /** Move a task with given `taskId` to desktop */
moveToDesktop(int taskId, in DesktopModeTransitionSource transitionSource)51     void moveToDesktop(int taskId, in DesktopModeTransitionSource transitionSource);
52 }