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.os.Bundle; 22 import android.os.UserHandle; 23 import android.window.IRemoteTransition; 24 25 import com.android.wm.shell.splitscreen.ISplitScreenListener; 26 27 /** 28 * Interface that is exposed to remote callers to manipulate the splitscreen feature. 29 */ 30 interface ISplitScreen { 31 32 /** 33 * Registers a split screen listener. 34 */ 35 oneway void registerSplitScreenListener(in ISplitScreenListener listener) = 1; 36 37 /** 38 * Unregisters a split screen listener. 39 */ 40 oneway void unregisterSplitScreenListener(in ISplitScreenListener listener) = 2; 41 42 /** 43 * Hides the side-stage if it is currently visible. 44 */ setSideStageVisibility(boolean visible)45 oneway void setSideStageVisibility(boolean visible) = 3; 46 47 /** 48 * Removes a task from the side stage. 49 */ removeFromSideStage(int taskId)50 oneway void removeFromSideStage(int taskId) = 4; 51 52 /** 53 * Removes the split-screen stages. 54 */ exitSplitScreen()55 oneway void exitSplitScreen() = 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 stage, int position, in Bundle options)65 oneway void startTask(int taskId, int stage, int position, in Bundle options) = 7; 66 67 /** 68 * Starts a shortcut in a stage. 69 */ startShortcut(String packageName, String shortcutId, int stage, int position, in Bundle options, in UserHandle user)70 oneway void startShortcut(String packageName, String shortcutId, int stage, int position, 71 in Bundle options, in UserHandle user) = 8; 72 73 /** 74 * Starts an activity in a stage. 75 */ startIntent(in PendingIntent intent, in Intent fillInIntent, int stage, int position, in Bundle options)76 oneway void startIntent(in PendingIntent intent, in Intent fillInIntent, int stage, 77 int position, in Bundle options) = 9; 78 79 /** 80 * Starts tasks simultaneously in one transition. The first task in the list will be in the 81 * main-stage and on the left/top. 82 */ startTasks(int mainTaskId, in Bundle mainOptions, int sideTaskId, in Bundle sideOptions, int sidePosition, in IRemoteTransition remoteTransition)83 oneway void startTasks(int mainTaskId, in Bundle mainOptions, int sideTaskId, 84 in Bundle sideOptions, int sidePosition, in IRemoteTransition remoteTransition) = 10; 85 } 86