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 import com.android.wm.shell.splitscreen.ISplitSelectListener; 31 32 /** 33 * Interface that is exposed to remote callers to manipulate the splitscreen feature. 34 */ 35 interface ISplitScreen { 36 37 /** 38 * Registers a split screen listener. 39 */ 40 oneway void registerSplitScreenListener(in ISplitScreenListener listener) = 1; 41 42 /** 43 * Unregisters a split screen listener. 44 */ 45 oneway void unregisterSplitScreenListener(in ISplitScreenListener listener) = 2; 46 47 /** 48 * Registers a split select listener. 49 */ 50 oneway void registerSplitSelectListener(in ISplitSelectListener listener) = 20; 51 52 /** 53 * Unregisters a split select listener. 54 */ 55 oneway void unregisterSplitSelectListener(in ISplitSelectListener listener) = 21; 56 57 /** 58 * Removes the split-screen stages and leaving indicated task to top. Passing INVALID_TASK_ID 59 * to indicate leaving no top task after leaving split-screen. 60 */ exitSplitScreen(int toTopTaskId)61 oneway void exitSplitScreen(int toTopTaskId) = 5; 62 63 /** 64 * @param exitSplitScreenOnHide if to exit split-screen if both stages are not visible. 65 */ exitSplitScreenOnHide(boolean exitSplitScreenOnHide)66 oneway void exitSplitScreenOnHide(boolean exitSplitScreenOnHide) = 6; 67 68 /** 69 * Starts a task in a stage. 70 */ startTask(int taskId, int position, in Bundle options)71 oneway void startTask(int taskId, int position, in Bundle options) = 7; 72 73 /** 74 * Starts a shortcut in a stage. 75 */ startShortcut(String packageName, String shortcutId, int position, in Bundle options, in UserHandle user, in InstanceId instanceId)76 oneway void startShortcut(String packageName, String shortcutId, int position, 77 in Bundle options, in UserHandle user, in InstanceId instanceId) = 8; 78 79 /** 80 * Starts an activity in a stage. 81 */ startIntent(in PendingIntent intent, int userId, in Intent fillInIntent, int position, in Bundle options, in InstanceId instanceId)82 oneway void startIntent(in PendingIntent intent, int userId, in Intent fillInIntent, 83 int position, in Bundle options, in InstanceId instanceId) = 9; 84 85 /** 86 * Starts tasks simultaneously in one transition. 87 */ startTasks(int taskId1, in Bundle options1, int taskId2, in Bundle options2, int splitPosition, int snapPosition, in RemoteTransition remoteTransition, in InstanceId instanceId)88 oneway void startTasks(int taskId1, in Bundle options1, int taskId2, in Bundle options2, 89 int splitPosition, int snapPosition, in RemoteTransition remoteTransition, 90 in InstanceId instanceId) = 10; 91 92 /** 93 * Starts a pair of intent and task in one transition. 94 */ startIntentAndTask(in PendingIntent pendingIntent, int userId1, in Bundle options1, int taskId, in Bundle options2, int sidePosition, int snapPosition, in RemoteTransition remoteTransition, in InstanceId instanceId)95 oneway void startIntentAndTask(in PendingIntent pendingIntent, int userId1, in Bundle options1, 96 int taskId, in Bundle options2, int sidePosition, int snapPosition, 97 in RemoteTransition remoteTransition, in InstanceId instanceId) = 16; 98 99 /** 100 * Starts a pair of shortcut and task in one transition. 101 */ startShortcutAndTask(in ShortcutInfo shortcutInfo, in Bundle options1, int taskId, in Bundle options2, int splitPosition, int snapPosition, in RemoteTransition remoteTransition, in InstanceId instanceId)102 oneway void startShortcutAndTask(in ShortcutInfo shortcutInfo, in Bundle options1, int taskId, 103 in Bundle options2, int splitPosition, int snapPosition, 104 in RemoteTransition remoteTransition, in InstanceId instanceId) = 17; 105 106 /** 107 * Start a pair of intents in one transition. 108 */ startIntents(in PendingIntent pendingIntent1, int userId1, in ShortcutInfo shortcutInfo1, in Bundle options1, in PendingIntent pendingIntent2, int userId2, in ShortcutInfo shortcutInfo2, in Bundle options2, int splitPosition, int snapPosition, in RemoteTransition remoteTransition, in InstanceId instanceId)109 oneway void startIntents(in PendingIntent pendingIntent1, int userId1, 110 in ShortcutInfo shortcutInfo1, in Bundle options1, in PendingIntent pendingIntent2, 111 int userId2, in ShortcutInfo shortcutInfo2, in Bundle options2, int splitPosition, 112 int snapPosition, in RemoteTransition remoteTransition, in InstanceId instanceId) = 19; 113 114 /** 115 * Reverse the split. 116 */ switchSplitPosition()117 oneway void switchSplitPosition() = 22; 118 } 119 // Last id = 22