• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 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.splitscreen;
18 
19 import android.app.PendingIntent;
20 import android.content.Intent;
21 import android.content.pm.ShortcutInfo;
22 import android.os.Bundle;
23 import android.os.UserHandle;
24 import com.android.internal.logging.InstanceId;
25 import android.view.RemoteAnimationAdapter;
26 import android.view.RemoteAnimationTarget;
27 import android.window.RemoteTransition;
28 
29 import com.android.wm.shell.splitscreen.ISplitScreenListener;
30 
31 /**
32  * Interface that is exposed to remote callers to manipulate the splitscreen feature.
33  */
34 interface ISplitScreen {
35 
36     /**
37      * Registers a split screen listener.
38      */
39     oneway void registerSplitScreenListener(in ISplitScreenListener listener) = 1;
40 
41     /**
42      * Unregisters a split screen listener.
43      */
44     oneway void unregisterSplitScreenListener(in ISplitScreenListener listener) = 2;
45 
46     /**
47      * Removes a task from the side stage.
48      */
removeFromSideStage(int taskId)49     oneway void removeFromSideStage(int taskId) = 4;
50 
51     /**
52      * Removes the split-screen stages and leaving indicated task to top. Passing INVALID_TASK_ID
53      * to indicate leaving no top task after leaving split-screen.
54      */
exitSplitScreen(int toTopTaskId)55     oneway void exitSplitScreen(int toTopTaskId) = 5;
56 
57     /**
58      * @param exitSplitScreenOnHide if to exit split-screen if both stages are not visible.
59      */
exitSplitScreenOnHide(boolean exitSplitScreenOnHide)60     oneway void exitSplitScreenOnHide(boolean exitSplitScreenOnHide) = 6;
61 
62     /**
63      * Starts a task in a stage.
64      */
startTask(int taskId, int position, in Bundle options)65     oneway void startTask(int taskId, int position, in Bundle options) = 7;
66 
67     /**
68      * Starts a shortcut in a stage.
69      */
startShortcut(String packageName, String shortcutId, int position, in Bundle options, in UserHandle user, in InstanceId instanceId)70     oneway void startShortcut(String packageName, String shortcutId, int position,
71             in Bundle options, in UserHandle user, in InstanceId instanceId) = 8;
72 
73     /**
74      * Starts an activity in a stage.
75      */
startIntent(in PendingIntent intent, in Intent fillInIntent, int position, in Bundle options, in InstanceId instanceId)76     oneway void startIntent(in PendingIntent intent, in Intent fillInIntent, int position,
77             in Bundle options, in InstanceId instanceId) = 9;
78 
79     /**
80      * Starts tasks simultaneously in one transition.
81      */
startTasks(int taskId1, in Bundle options1, int taskId2, in Bundle options2, int splitPosition, float splitRatio, in RemoteTransition remoteTransition, in InstanceId instanceId)82     oneway void startTasks(int taskId1, in Bundle options1, int taskId2, in Bundle options2,
83             int splitPosition, float splitRatio, in RemoteTransition remoteTransition,
84             in InstanceId instanceId) = 10;
85 
86     /**
87      * Starts a pair of intent and task in one transition.
88      */
startIntentAndTask(in PendingIntent pendingIntent, in Bundle options1, int taskId, in Bundle options2, int sidePosition, float splitRatio, in RemoteTransition remoteTransition, in InstanceId instanceId)89     oneway void startIntentAndTask(in PendingIntent pendingIntent, in Bundle options1, int taskId,
90             in Bundle options2, int sidePosition, float splitRatio,
91             in RemoteTransition remoteTransition, in InstanceId instanceId) = 16;
92 
93     /**
94      * Starts a pair of shortcut and task in one transition.
95      */
startShortcutAndTask(in ShortcutInfo shortcutInfo, in Bundle options1, int taskId, in Bundle options2, int splitPosition, float splitRatio, in RemoteTransition remoteTransition, in InstanceId instanceId)96     oneway void startShortcutAndTask(in ShortcutInfo shortcutInfo, in Bundle options1, int taskId,
97             in Bundle options2, int splitPosition, float splitRatio,
98             in RemoteTransition remoteTransition, in InstanceId instanceId) = 17;
99 
100     /**
101      * Version of startTasks using legacy transition system.
102      */
startTasksWithLegacyTransition(int taskId1, in Bundle options1, int taskId2, in Bundle options2, int splitPosition, float splitRatio, in RemoteAnimationAdapter adapter, in InstanceId instanceId)103     oneway void startTasksWithLegacyTransition(int taskId1, in Bundle options1, int taskId2,
104             in Bundle options2, int splitPosition, float splitRatio,
105             in RemoteAnimationAdapter adapter, in InstanceId instanceId) = 11;
106 
107     /**
108      * Starts a pair of intent and task using legacy transition system.
109      */
startIntentAndTaskWithLegacyTransition(in PendingIntent pendingIntent, in Bundle options1, int taskId, in Bundle options2, int splitPosition, float splitRatio, in RemoteAnimationAdapter adapter, in InstanceId instanceId)110     oneway void startIntentAndTaskWithLegacyTransition(in PendingIntent pendingIntent,
111             in Bundle options1, int taskId, in Bundle options2, int splitPosition, float splitRatio,
112             in RemoteAnimationAdapter adapter, in InstanceId instanceId) = 12;
113 
114     /**
115      * Starts a pair of shortcut and task using legacy transition system.
116      */
startShortcutAndTaskWithLegacyTransition(in ShortcutInfo shortcutInfo, in Bundle options1, int taskId, in Bundle options2, int splitPosition, float splitRatio, in RemoteAnimationAdapter adapter, in InstanceId instanceId)117     oneway void startShortcutAndTaskWithLegacyTransition(in ShortcutInfo shortcutInfo,
118             in Bundle options1, int taskId, in Bundle options2, int splitPosition, float splitRatio,
119             in RemoteAnimationAdapter adapter, in InstanceId instanceId) = 15;
120 
121     /**
122      * Start a pair of intents using legacy transition system.
123      */
startIntentsWithLegacyTransition(in PendingIntent pendingIntent1, in ShortcutInfo shortcutInfo1, in Bundle options1, in PendingIntent pendingIntent2, in ShortcutInfo shortcutInfo2, in Bundle options2, int splitPosition, float splitRatio, in RemoteAnimationAdapter adapter, in InstanceId instanceId)124     oneway void startIntentsWithLegacyTransition(in PendingIntent pendingIntent1,
125             in ShortcutInfo shortcutInfo1, in Bundle options1, in PendingIntent pendingIntent2,
126             in ShortcutInfo shortcutInfo2, in Bundle options2, int splitPosition, float splitRatio,
127             in RemoteAnimationAdapter adapter, in InstanceId instanceId) = 18;
128 
129     /**
130      * Start a pair of intents in one transition.
131      */
startIntents(in PendingIntent pendingIntent1, in Bundle options1, in PendingIntent pendingIntent2, in Bundle options2, int splitPosition, float splitRatio, in RemoteTransition remoteTransition, in InstanceId instanceId)132     oneway void startIntents(in PendingIntent pendingIntent1, in Bundle options1,
133             in PendingIntent pendingIntent2, in Bundle options2, int splitPosition,
134             float splitRatio, in RemoteTransition remoteTransition, in InstanceId instanceId) = 19;
135 
136     /**
137      * Blocking call that notifies and gets additional split-screen targets when entering
138      * recents (for example: the dividerBar).
139      * @param appTargets apps that will be re-parented to display area
140      */
141     RemoteAnimationTarget[] onGoingToRecentsLegacy(in RemoteAnimationTarget[] appTargets) = 13;
142 
143     /**
144      * Blocking call that notifies and gets additional split-screen targets when entering
145      * recents (for example: the dividerBar). Different than the method above in that this one
146      * does not expect split to currently be running.
147      */
148     RemoteAnimationTarget[] onStartingSplitLegacy(in RemoteAnimationTarget[] appTargets) = 14;
149 }
150 // Last id = 19