Wale Ogunwale | 65ebd95 | 2018-04-25 15:41:44 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 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 android.app; |
| 18 | |
| 19 | import android.app.ActivityManager; |
| 20 | import android.app.ApplicationErrorReport; |
| 21 | import android.app.ContentProviderHolder; |
| 22 | import android.app.GrantedUriPermission; |
| 23 | import android.app.IApplicationThread; |
| 24 | import android.app.IActivityController; |
| 25 | import android.app.IAppTask; |
| 26 | import android.app.IAssistDataReceiver; |
| 27 | import android.app.IInstrumentationWatcher; |
| 28 | import android.app.IProcessObserver; |
Mark Renouf | 446251d | 2019-04-26 10:22:41 -0400 | [diff] [blame] | 29 | import android.app.IRequestFinishCallback; |
Wale Ogunwale | 65ebd95 | 2018-04-25 15:41:44 -0700 | [diff] [blame] | 30 | import android.app.IServiceConnection; |
| 31 | import android.app.IStopUserCallback; |
Evan Rosky | 0037e5f | 2019-11-05 10:26:24 -0800 | [diff] [blame] | 32 | import android.app.ITaskOrganizerController; |
Wale Ogunwale | 65ebd95 | 2018-04-25 15:41:44 -0700 | [diff] [blame] | 33 | import android.app.ITaskStackListener; |
| 34 | import android.app.IUiAutomationConnection; |
| 35 | import android.app.IUidObserver; |
| 36 | import android.app.IUserSwitchObserver; |
| 37 | import android.app.Notification; |
| 38 | import android.app.PendingIntent; |
| 39 | import android.app.PictureInPictureParams; |
| 40 | import android.app.ProfilerInfo; |
| 41 | import android.app.WaitResult; |
| 42 | import android.app.assist.AssistContent; |
| 43 | import android.app.assist.AssistStructure; |
| 44 | import android.content.ComponentName; |
| 45 | import android.content.IIntentReceiver; |
| 46 | import android.content.IIntentSender; |
| 47 | import android.content.Intent; |
| 48 | import android.content.IntentFilter; |
| 49 | import android.content.IntentSender; |
| 50 | import android.content.pm.ApplicationInfo; |
| 51 | import android.content.pm.ConfigurationInfo; |
| 52 | import android.content.pm.IPackageDataObserver; |
| 53 | import android.content.pm.ParceledListSlice; |
| 54 | import android.content.pm.ProviderInfo; |
| 55 | import android.content.pm.UserInfo; |
| 56 | import android.content.res.Configuration; |
| 57 | import android.graphics.Bitmap; |
| 58 | import android.graphics.GraphicBuffer; |
| 59 | import android.graphics.Point; |
| 60 | import android.graphics.Rect; |
| 61 | import android.net.Uri; |
| 62 | import android.os.Bundle; |
| 63 | import android.os.Debug; |
| 64 | import android.os.IBinder; |
| 65 | import android.os.IProgressListener; |
| 66 | import android.os.ParcelFileDescriptor; |
| 67 | import android.os.PersistableBundle; |
| 68 | import android.os.StrictMode; |
| 69 | import android.os.WorkSource; |
| 70 | import android.service.voice.IVoiceInteractionSession; |
| 71 | import android.view.IRecentsAnimationRunner; |
Robert Carr | 8a2f913 | 2019-11-11 15:03:15 -0800 | [diff] [blame] | 72 | import android.view.ITaskOrganizer; |
Wale Ogunwale | 65ebd95 | 2018-04-25 15:41:44 -0700 | [diff] [blame] | 73 | import android.view.RemoteAnimationDefinition; |
| 74 | import android.view.RemoteAnimationAdapter; |
| 75 | import com.android.internal.app.IVoiceInteractor; |
| 76 | import com.android.internal.os.IResultReceiver; |
| 77 | import com.android.internal.policy.IKeyguardDismissCallback; |
| 78 | |
| 79 | import java.util.List; |
| 80 | |
| 81 | /** |
| 82 | * System private API for talking with the activity task manager that handles how activities are |
| 83 | * managed on screen. |
| 84 | * |
| 85 | * {@hide} |
| 86 | */ |
| 87 | interface IActivityTaskManager { |
Philip P. Moltmann | ee29509 | 2020-02-10 08:46:26 -0800 | [diff] [blame^] | 88 | int startActivity(in IApplicationThread caller, in String callingPackage, |
| 89 | in String callingFeatureId, in Intent intent, in String resolvedType, |
| 90 | in IBinder resultTo, in String resultWho, int requestCode, |
Wale Ogunwale | 04d9cb5 | 2018-04-30 13:55:07 -0700 | [diff] [blame] | 91 | int flags, in ProfilerInfo profilerInfo, in Bundle options); |
| 92 | int startActivities(in IApplicationThread caller, in String callingPackage, |
Philip P. Moltmann | ee29509 | 2020-02-10 08:46:26 -0800 | [diff] [blame^] | 93 | in String callingFeatureId, in Intent[] intents, in String[] resolvedTypes, |
| 94 | in IBinder resultTo, in Bundle options, int userId); |
Wale Ogunwale | 04d9cb5 | 2018-04-30 13:55:07 -0700 | [diff] [blame] | 95 | int startActivityAsUser(in IApplicationThread caller, in String callingPackage, |
Philip P. Moltmann | ee29509 | 2020-02-10 08:46:26 -0800 | [diff] [blame^] | 96 | in String callingFeatureId, in Intent intent, in String resolvedType, |
| 97 | in IBinder resultTo, in String resultWho, int requestCode, int flags, |
| 98 | in ProfilerInfo profilerInfo, in Bundle options, int userId); |
Wale Ogunwale | 04d9cb5 | 2018-04-30 13:55:07 -0700 | [diff] [blame] | 99 | boolean startNextMatchingActivity(in IBinder callingActivity, |
| 100 | in Intent intent, in Bundle options); |
| 101 | int startActivityIntentSender(in IApplicationThread caller, |
| 102 | in IIntentSender target, in IBinder whitelistToken, in Intent fillInIntent, |
| 103 | in String resolvedType, in IBinder resultTo, in String resultWho, int requestCode, |
| 104 | int flagsMask, int flagsValues, in Bundle options); |
| 105 | WaitResult startActivityAndWait(in IApplicationThread caller, in String callingPackage, |
Philip P. Moltmann | ee29509 | 2020-02-10 08:46:26 -0800 | [diff] [blame^] | 106 | in String callingFeatureId, in Intent intent, in String resolvedType, |
| 107 | in IBinder resultTo, in String resultWho, int requestCode, int flags, |
| 108 | in ProfilerInfo profilerInfo, in Bundle options, int userId); |
Wale Ogunwale | 04d9cb5 | 2018-04-30 13:55:07 -0700 | [diff] [blame] | 109 | int startActivityWithConfig(in IApplicationThread caller, in String callingPackage, |
Philip P. Moltmann | ee29509 | 2020-02-10 08:46:26 -0800 | [diff] [blame^] | 110 | in String callingFeatureId, in Intent intent, in String resolvedType, |
| 111 | in IBinder resultTo, in String resultWho, int requestCode, int startFlags, |
| 112 | in Configuration newConfig, in Bundle options, int userId); |
| 113 | int startVoiceActivity(in String callingPackage, in String callingFeatureId, int callingPid, |
| 114 | int callingUid, in Intent intent, in String resolvedType, |
| 115 | in IVoiceInteractionSession session, in IVoiceInteractor interactor, int flags, |
| 116 | in ProfilerInfo profilerInfo, in Bundle options, int userId); |
| 117 | int startAssistantActivity(in String callingPackage, in String callingFeatureId, int callingPid, |
| 118 | int callingUid, in Intent intent, in String resolvedType, in Bundle options, int userId); |
Wale Ogunwale | 04d9cb5 | 2018-04-30 13:55:07 -0700 | [diff] [blame] | 119 | void startRecentsActivity(in Intent intent, in IAssistDataReceiver assistDataReceiver, |
| 120 | in IRecentsAnimationRunner recentsAnimationRunner); |
| 121 | int startActivityFromRecents(int taskId, in Bundle options); |
| 122 | int startActivityAsCaller(in IApplicationThread caller, in String callingPackage, |
| 123 | in Intent intent, in String resolvedType, in IBinder resultTo, in String resultWho, |
| 124 | int requestCode, int flags, in ProfilerInfo profilerInfo, in Bundle options, |
Alison Cichowlas | 3e34050 | 2018-08-07 17:15:01 -0400 | [diff] [blame] | 125 | IBinder permissionToken, boolean ignoreTargetSecurity, int userId); |
Robert Carr | 8a2f913 | 2019-11-11 15:03:15 -0800 | [diff] [blame] | 126 | |
Andrii Kulian | 2eb84b2 | 2018-12-13 18:18:54 -0800 | [diff] [blame] | 127 | boolean isActivityStartAllowedOnDisplay(int displayId, in Intent intent, in String resolvedType, |
| 128 | int userId); |
Wale Ogunwale | 04d9cb5 | 2018-04-30 13:55:07 -0700 | [diff] [blame] | 129 | |
| 130 | void unhandledBack(); |
| 131 | boolean finishActivity(in IBinder token, int code, in Intent data, int finishTask); |
| 132 | boolean finishActivityAffinity(in IBinder token); |
| 133 | |
| 134 | oneway void activityIdle(in IBinder token, in Configuration config, |
| 135 | in boolean stopProfiling); |
| 136 | void activityResumed(in IBinder token); |
Andrii Kulian | 86e70fc | 2019-02-12 11:04:10 +0000 | [diff] [blame] | 137 | void activityTopResumedStateLost(); |
Wale Ogunwale | 04d9cb5 | 2018-04-30 13:55:07 -0700 | [diff] [blame] | 138 | void activityPaused(in IBinder token); |
Robert Carr | 6827f72 | 2018-07-10 13:21:04 -0700 | [diff] [blame] | 139 | void activityStopped(in IBinder token, in Bundle state, |
Wale Ogunwale | 04d9cb5 | 2018-04-30 13:55:07 -0700 | [diff] [blame] | 140 | in PersistableBundle persistentState, in CharSequence description); |
| 141 | oneway void activityDestroyed(in IBinder token); |
| 142 | void activityRelaunched(in IBinder token); |
Wale Ogunwale | 04d9cb5 | 2018-04-30 13:55:07 -0700 | [diff] [blame] | 143 | int getFrontActivityScreenCompatMode(); |
| 144 | void setFrontActivityScreenCompatMode(int mode); |
| 145 | String getCallingPackage(in IBinder token); |
| 146 | ComponentName getCallingActivity(in IBinder token); |
| 147 | void setFocusedTask(int taskId); |
| 148 | boolean removeTask(int taskId); |
Winson Chung | e643910 | 2018-07-30 15:48:01 -0700 | [diff] [blame] | 149 | void removeAllVisibleRecentTasks(); |
Wale Ogunwale | 65ebd95 | 2018-04-25 15:41:44 -0700 | [diff] [blame] | 150 | List<ActivityManager.RunningTaskInfo> getTasks(int maxNum); |
| 151 | List<ActivityManager.RunningTaskInfo> getFilteredTasks(int maxNum, int ignoreActivityType, |
| 152 | int ignoreWindowingMode); |
Wale Ogunwale | 04d9cb5 | 2018-04-30 13:55:07 -0700 | [diff] [blame] | 153 | boolean shouldUpRecreateTask(in IBinder token, in String destAffinity); |
| 154 | boolean navigateUpTo(in IBinder token, in Intent target, int resultCode, |
| 155 | in Intent resultData); |
Ricky Wai | aca8a77 | 2019-04-04 16:01:06 +0100 | [diff] [blame] | 156 | void moveTaskToFront(in IApplicationThread app, in String callingPackage, int task, |
| 157 | int flags, in Bundle options); |
Wale Ogunwale | 04d9cb5 | 2018-04-30 13:55:07 -0700 | [diff] [blame] | 158 | int getTaskForActivity(in IBinder token, in boolean onlyRoot); |
Andrii Kulian | 057a651 | 2019-07-15 16:15:51 -0700 | [diff] [blame] | 159 | /** Finish all activities that were started for result from the specified activity. */ |
Wale Ogunwale | 04d9cb5 | 2018-04-30 13:55:07 -0700 | [diff] [blame] | 160 | void finishSubActivity(in IBinder token, in String resultWho, int requestCode); |
| 161 | ParceledListSlice getRecentTasks(int maxNum, int flags, int userId); |
| 162 | boolean willActivityBeVisible(in IBinder token); |
| 163 | void setRequestedOrientation(in IBinder token, int requestedOrientation); |
| 164 | int getRequestedOrientation(in IBinder token); |
| 165 | boolean convertFromTranslucent(in IBinder token); |
| 166 | boolean convertToTranslucent(in IBinder token, in Bundle options); |
| 167 | void notifyActivityDrawn(in IBinder token); |
| 168 | void reportActivityFullyDrawn(in IBinder token, boolean restoredFromBundle); |
Louis Chang | 677921f | 2019-12-06 16:44:24 +0800 | [diff] [blame] | 169 | int getDisplayId(in IBinder activityToken); |
Wale Ogunwale | 04d9cb5 | 2018-04-30 13:55:07 -0700 | [diff] [blame] | 170 | boolean isImmersive(in IBinder token); |
| 171 | void setImmersive(in IBinder token, boolean immersive); |
| 172 | boolean isTopActivityImmersive(); |
| 173 | boolean moveActivityTaskToBack(in IBinder token, boolean nonRoot); |
| 174 | ActivityManager.TaskDescription getTaskDescription(int taskId); |
| 175 | void overridePendingTransition(in IBinder token, in String packageName, |
| 176 | int enterAnim, int exitAnim); |
| 177 | int getLaunchedFromUid(in IBinder activityToken); |
| 178 | String getLaunchedFromPackage(in IBinder activityToken); |
| 179 | void reportAssistContextExtras(in IBinder token, in Bundle extras, |
| 180 | in AssistStructure structure, in AssistContent content, in Uri referrer); |
| 181 | |
| 182 | void setFocusedStack(int stackId); |
| 183 | ActivityManager.StackInfo getFocusedStackInfo(); |
| 184 | Rect getTaskBounds(int taskId); |
| 185 | |
| 186 | void cancelRecentsAnimation(boolean restoreHomeStackPosition); |
| 187 | void startLockTaskModeByToken(in IBinder token); |
| 188 | void stopLockTaskModeByToken(in IBinder token); |
Wale Ogunwale | 27c48ae | 2018-10-25 19:01:01 -0700 | [diff] [blame] | 189 | void updateLockTaskPackages(int userId, in String[] packages); |
Wale Ogunwale | 04d9cb5 | 2018-04-30 13:55:07 -0700 | [diff] [blame] | 190 | boolean isInLockTaskMode(); |
| 191 | int getLockTaskModeState(); |
| 192 | void setTaskDescription(in IBinder token, in ActivityManager.TaskDescription values); |
| 193 | Bundle getActivityOptions(in IBinder token); |
| 194 | List<IBinder> getAppTasks(in String callingPackage); |
| 195 | void startSystemLockTaskMode(int taskId); |
| 196 | void stopSystemLockTaskMode(); |
| 197 | void finishVoiceTask(in IVoiceInteractionSession session); |
| 198 | boolean isTopOfTask(in IBinder token); |
| 199 | void notifyLaunchTaskBehindComplete(in IBinder token); |
| 200 | void notifyEnterAnimationComplete(in IBinder token); |
| 201 | int addAppTask(in IBinder activityToken, in Intent intent, |
| 202 | in ActivityManager.TaskDescription description, in Bitmap thumbnail); |
| 203 | Point getAppTaskThumbnailSize(); |
| 204 | boolean releaseActivityInstance(in IBinder token); |
Alison Cichowlas | 3e34050 | 2018-08-07 17:15:01 -0400 | [diff] [blame] | 205 | /** |
| 206 | * Only callable from the system. This token grants a temporary permission to call |
| 207 | * #startActivityAsCallerWithToken. The token will time out after |
| 208 | * START_AS_CALLER_TOKEN_TIMEOUT if it is not used. |
| 209 | * |
| 210 | * @param delegatorToken The Binder token referencing the system Activity that wants to delegate |
| 211 | * the #startActivityAsCaller to another app. The "caller" will be the caller of this |
| 212 | * activity's token, not the delegate's caller (which is probably the delegator itself). |
| 213 | * |
| 214 | * @return Returns a token that can be given to a "delegate" app that may call |
| 215 | * #startActivityAsCaller |
| 216 | */ |
| 217 | IBinder requestStartActivityPermissionToken(in IBinder delegatorToken); |
| 218 | |
Wale Ogunwale | 04d9cb5 | 2018-04-30 13:55:07 -0700 | [diff] [blame] | 219 | void releaseSomeActivities(in IApplicationThread app); |
| 220 | Bitmap getTaskDescriptionIcon(in String filename, int userId); |
Wale Ogunwale | 04d9cb5 | 2018-04-30 13:55:07 -0700 | [diff] [blame] | 221 | void registerTaskStackListener(in ITaskStackListener listener); |
| 222 | void unregisterTaskStackListener(in ITaskStackListener listener); |
Wale Ogunwale | 04d9cb5 | 2018-04-30 13:55:07 -0700 | [diff] [blame] | 223 | void setTaskResizeable(int taskId, int resizeableMode); |
Yunfan Chen | d967af8 | 2019-01-17 18:30:18 +0900 | [diff] [blame] | 224 | void toggleFreeformWindowingMode(in IBinder token); |
Wale Ogunwale | 04d9cb5 | 2018-04-30 13:55:07 -0700 | [diff] [blame] | 225 | void resizeTask(int taskId, in Rect bounds, int resizeMode); |
| 226 | void moveStackToDisplay(int stackId, int displayId); |
| 227 | void removeStack(int stackId); |
| 228 | |
Wale Ogunwale | 65ebd95 | 2018-04-25 15:41:44 -0700 | [diff] [blame] | 229 | /** |
| 230 | * Sets the windowing mode for a specific task. Only works on tasks of type |
| 231 | * {@link WindowConfiguration#ACTIVITY_TYPE_STANDARD} |
| 232 | * @param taskId The id of the task to set the windowing mode for. |
| 233 | * @param windowingMode The windowing mode to set for the task. |
| 234 | * @param toTop If the task should be moved to the top once the windowing mode changes. |
Winson Chung | 7ccc681 | 2020-01-23 16:15:10 -0800 | [diff] [blame] | 235 | * @return Whether the task was successfully put into the specified windowing mode. |
Wale Ogunwale | 65ebd95 | 2018-04-25 15:41:44 -0700 | [diff] [blame] | 236 | */ |
Winson Chung | 7ccc681 | 2020-01-23 16:15:10 -0800 | [diff] [blame] | 237 | boolean setTaskWindowingMode(int taskId, int windowingMode, boolean toTop); |
Wale Ogunwale | 65ebd95 | 2018-04-25 15:41:44 -0700 | [diff] [blame] | 238 | void moveTaskToStack(int taskId, int stackId, boolean toTop); |
| 239 | /** |
Evan Rosky | dbe2ce5 | 2019-07-18 11:13:17 -0700 | [diff] [blame] | 240 | * Resizes the input pinned stack to the given bounds with animation. |
Wale Ogunwale | 65ebd95 | 2018-04-25 15:41:44 -0700 | [diff] [blame] | 241 | * |
Evan Rosky | dbe2ce5 | 2019-07-18 11:13:17 -0700 | [diff] [blame] | 242 | * @param stackId Id of the pinned stack to resize. |
Wale Ogunwale | 65ebd95 | 2018-04-25 15:41:44 -0700 | [diff] [blame] | 243 | * @param bounds Bounds to resize the stack to or {@code null} for fullscreen. |
Wale Ogunwale | 65ebd95 | 2018-04-25 15:41:44 -0700 | [diff] [blame] | 244 | * @param animationDuration The duration of the resize animation in milliseconds or -1 if the |
| 245 | * default animation duration should be used. |
| 246 | * @throws RemoteException |
| 247 | */ |
Evan Rosky | dbe2ce5 | 2019-07-18 11:13:17 -0700 | [diff] [blame] | 248 | void animateResizePinnedStack(int stackId, in Rect bounds, int animationDuration); |
Wale Ogunwale | 65ebd95 | 2018-04-25 15:41:44 -0700 | [diff] [blame] | 249 | boolean setTaskWindowingModeSplitScreenPrimary(int taskId, int createMode, boolean toTop, |
| 250 | boolean animate, in Rect initialBounds, boolean showRecents); |
wilsonshih | 5c4cf52 | 2019-01-25 09:03:47 +0800 | [diff] [blame] | 251 | /** |
| 252 | * Use the offset to adjust the stack boundary with animation. |
| 253 | * |
| 254 | * @param stackId Id of the stack to adjust. |
| 255 | * @param compareBounds Offset is only applied if the current pinned stack bounds is equal to |
| 256 | * the compareBounds. |
| 257 | * @param xOffset The horizontal offset. |
| 258 | * @param yOffset The vertical offset. |
| 259 | * @param animationDuration The duration of the resize animation in milliseconds or -1 if the |
| 260 | * default animation duration should be used. |
| 261 | * @throws RemoteException |
| 262 | */ |
| 263 | void offsetPinnedStackBounds(int stackId, in Rect compareBounds, int xOffset, int yOffset, |
| 264 | int animationDuration); |
Wale Ogunwale | 65ebd95 | 2018-04-25 15:41:44 -0700 | [diff] [blame] | 265 | /** |
| 266 | * Removes stacks in the input windowing modes from the system if they are of activity type |
| 267 | * ACTIVITY_TYPE_STANDARD or ACTIVITY_TYPE_UNDEFINED |
| 268 | */ |
| 269 | void removeStacksInWindowingModes(in int[] windowingModes); |
| 270 | /** Removes stack of the activity types from the system. */ |
| 271 | void removeStacksWithActivityTypes(in int[] activityTypes); |
Wale Ogunwale | 04d9cb5 | 2018-04-30 13:55:07 -0700 | [diff] [blame] | 272 | |
| 273 | List<ActivityManager.StackInfo> getAllStackInfos(); |
| 274 | ActivityManager.StackInfo getStackInfo(int windowingMode, int activityType); |
Evan Rosky | fd43969 | 2019-11-06 16:12:59 -0800 | [diff] [blame] | 275 | List<ActivityManager.StackInfo> getAllStackInfosOnDisplay(int displayId); |
| 276 | ActivityManager.StackInfo getStackInfoOnDisplay(int windowingMode, int activityType, |
| 277 | int displayId); |
Wale Ogunwale | 04d9cb5 | 2018-04-30 13:55:07 -0700 | [diff] [blame] | 278 | |
| 279 | /** |
wilsonshih | e7903ea | 2018-09-26 16:17:59 +0800 | [diff] [blame] | 280 | * Informs ActivityTaskManagerService that the keyguard is showing. |
Wale Ogunwale | 04d9cb5 | 2018-04-30 13:55:07 -0700 | [diff] [blame] | 281 | * |
| 282 | * @param showingKeyguard True if the keyguard is showing, false otherwise. |
| 283 | * @param showingAod True if AOD is showing, false otherwise. |
Wale Ogunwale | 04d9cb5 | 2018-04-30 13:55:07 -0700 | [diff] [blame] | 284 | */ |
wilsonshih | 177261f | 2019-02-22 12:02:18 +0800 | [diff] [blame] | 285 | void setLockScreenShown(boolean showingKeyguard, boolean showingAod); |
Wale Ogunwale | 04d9cb5 | 2018-04-30 13:55:07 -0700 | [diff] [blame] | 286 | Bundle getAssistContextExtras(int requestType); |
| 287 | boolean launchAssistIntent(in Intent intent, int requestType, in String hint, int userHandle, |
| 288 | in Bundle args); |
| 289 | boolean requestAssistContextExtras(int requestType, in IAssistDataReceiver receiver, |
| 290 | in Bundle receiverExtras, in IBinder activityToken, |
| 291 | boolean focused, boolean newSessionId); |
| 292 | boolean requestAutofillData(in IAssistDataReceiver receiver, in Bundle receiverExtras, |
| 293 | in IBinder activityToken, int flags); |
| 294 | boolean isAssistDataAllowedOnCurrentActivity(); |
| 295 | boolean showAssistFromActivity(in IBinder token, in Bundle args); |
| 296 | boolean isRootVoiceInteraction(in IBinder token); |
| 297 | oneway void showLockTaskEscapeMessage(in IBinder token); |
| 298 | |
| 299 | /** |
| 300 | * Notify the system that the keyguard is going away. |
| 301 | * |
| 302 | * @param flags See |
| 303 | * {@link android.view.WindowManagerPolicyConstants#KEYGUARD_GOING_AWAY_FLAG_TO_SHADE} |
| 304 | * etc. |
| 305 | */ |
| 306 | void keyguardGoingAway(int flags); |
| 307 | ComponentName getActivityClassForToken(in IBinder token); |
| 308 | String getPackageForToken(in IBinder token); |
| 309 | |
| 310 | /** |
| 311 | * Try to place task to provided position. The final position might be different depending on |
| 312 | * current user and stacks state. The task will be moved to target stack if it's currently in |
| 313 | * different stack. |
| 314 | */ |
| 315 | void positionTaskInStack(int taskId, int stackId, int position); |
| 316 | void reportSizeConfigurations(in IBinder token, in int[] horizontalSizeConfiguration, |
| 317 | in int[] verticalSizeConfigurations, in int[] smallestWidthConfigurations); |
| 318 | /** |
| 319 | * Dismisses split-screen multi-window mode. |
| 320 | * {@param toTop} If true the current primary split-screen stack will be placed or left on top. |
| 321 | */ |
| 322 | void dismissSplitScreenMode(boolean toTop); |
| 323 | |
| 324 | /** |
| 325 | * Dismisses PiP |
| 326 | * @param animate True if the dismissal should be animated. |
| 327 | * @param animationDuration The duration of the resize animation in milliseconds or -1 if the |
| 328 | * default animation duration should be used. |
| 329 | */ |
| 330 | void dismissPip(boolean animate, int animationDuration); |
| 331 | void suppressResizeConfigChanges(boolean suppress); |
| 332 | void moveTasksToFullscreenStack(int fromStackId, boolean onTop); |
| 333 | boolean moveTopActivityToPinnedStack(int stackId, in Rect bounds); |
| 334 | boolean isInMultiWindowMode(in IBinder token); |
| 335 | boolean isInPictureInPictureMode(in IBinder token); |
| 336 | boolean enterPictureInPictureMode(in IBinder token, in PictureInPictureParams params); |
| 337 | void setPictureInPictureParams(in IBinder token, in PictureInPictureParams params); |
jorgegil@google.com | 06bc323 | 2019-10-31 14:51:22 -0700 | [diff] [blame] | 338 | void requestPictureInPictureMode(in IBinder token); |
Wale Ogunwale | 04d9cb5 | 2018-04-30 13:55:07 -0700 | [diff] [blame] | 339 | int getMaxNumPictureInPictureActions(in IBinder token); |
| 340 | IBinder getUriPermissionOwnerForActivity(in IBinder activityToken); |
| 341 | |
| 342 | /** |
| 343 | * Resizes the docked stack, and all other stacks as the result of the dock stack bounds change. |
| 344 | * |
| 345 | * @param dockedBounds The bounds for the docked stack. |
| 346 | * @param tempDockedTaskBounds The temporary bounds for the tasks in the docked stack, which |
| 347 | * might be different from the stack bounds to allow more |
| 348 | * flexibility while resizing, or {@code null} if they should be the |
| 349 | * same as the stack bounds. |
| 350 | * @param tempDockedTaskInsetBounds The temporary bounds for the tasks to calculate the insets. |
| 351 | * When resizing, we usually "freeze" the layout of a task. To |
| 352 | * achieve that, we also need to "freeze" the insets, which |
| 353 | * gets achieved by changing task bounds but not bounds used |
| 354 | * to calculate the insets in this transient state |
| 355 | * @param tempOtherTaskBounds The temporary bounds for the tasks in all other stacks, or |
| 356 | * {@code null} if they should be the same as the stack bounds. |
| 357 | * @param tempOtherTaskInsetBounds Like {@code tempDockedTaskInsetBounds}, but for the other |
| 358 | * stacks. |
| 359 | * @throws RemoteException |
| 360 | */ |
| 361 | void resizeDockedStack(in Rect dockedBounds, in Rect tempDockedTaskBounds, |
| 362 | in Rect tempDockedTaskInsetBounds, |
| 363 | in Rect tempOtherTaskBounds, in Rect tempOtherTaskInsetBounds); |
| 364 | |
| 365 | /** |
Evan Rosky | 0037e5f | 2019-11-05 10:26:24 -0800 | [diff] [blame] | 366 | * Returns an interface enabling the management of task organizers. |
| 367 | */ |
| 368 | ITaskOrganizerController getTaskOrganizerController(); |
| 369 | |
| 370 | /** |
Wale Ogunwale | 04d9cb5 | 2018-04-30 13:55:07 -0700 | [diff] [blame] | 371 | * Sets whether we are currently in an interactive split screen resize operation where we |
| 372 | * are changing the docked stack size. |
| 373 | */ |
| 374 | void setSplitScreenResizing(boolean resizing); |
| 375 | int setVrMode(in IBinder token, boolean enabled, in ComponentName packageName); |
| 376 | void startLocalVoiceInteraction(in IBinder token, in Bundle options); |
| 377 | void stopLocalVoiceInteraction(in IBinder token); |
| 378 | boolean supportsLocalVoiceInteraction(); |
| 379 | void notifyPinnedStackAnimationStarted(); |
| 380 | void notifyPinnedStackAnimationEnded(); |
| 381 | |
Yunfan Chen | 75157d7 | 2018-07-27 14:47:21 +0900 | [diff] [blame] | 382 | // Get device configuration |
| 383 | ConfigurationInfo getDeviceConfigurationInfo(); |
| 384 | |
Wale Ogunwale | 04d9cb5 | 2018-04-30 13:55:07 -0700 | [diff] [blame] | 385 | /** |
| 386 | * Resizes the pinned stack. |
| 387 | * |
| 388 | * @param pinnedBounds The bounds for the pinned stack. |
| 389 | * @param tempPinnedTaskBounds The temporary bounds for the tasks in the pinned stack, which |
| 390 | * might be different from the stack bounds to allow more |
| 391 | * flexibility while resizing, or {@code null} if they should be the |
| 392 | * same as the stack bounds. |
| 393 | */ |
| 394 | void resizePinnedStack(in Rect pinnedBounds, in Rect tempPinnedTaskBounds); |
| 395 | |
Wale Ogunwale | 04d9cb5 | 2018-04-30 13:55:07 -0700 | [diff] [blame] | 396 | void dismissKeyguard(in IBinder token, in IKeyguardDismissCallback callback, |
| 397 | in CharSequence message); |
| 398 | |
| 399 | /** Cancels the window transitions for the given task. */ |
| 400 | void cancelTaskWindowTransition(int taskId); |
| 401 | |
| 402 | /** |
| 403 | * @param taskId the id of the task to retrieve the sAutoapshots for |
| 404 | * @param reducedResolution if set, if the snapshot needs to be loaded from disk, this will load |
| 405 | * a reduced resolution of it, which is much faster |
| 406 | * @return a graphic buffer representing a screenshot of a task |
| 407 | */ |
| 408 | ActivityManager.TaskSnapshot getTaskSnapshot(int taskId, boolean reducedResolution); |
| 409 | |
| 410 | /** |
| 411 | * See {@link android.app.Activity#setDisablePreviewScreenshots} |
| 412 | */ |
| 413 | void setDisablePreviewScreenshots(IBinder token, boolean disable); |
| 414 | |
| 415 | /** |
Riddle Hsu | 440f88b | 2019-11-06 22:17:35 +0800 | [diff] [blame] | 416 | * It should only be called from home activity to remove its outdated snapshot. The home |
| 417 | * snapshot is used to speed up entering home from screen off. If the content of home activity |
| 418 | * is significantly different from before taking the snapshot, then the home activity can use |
| 419 | * this method to avoid inconsistent transition. |
| 420 | */ |
| 421 | void invalidateHomeTaskSnapshot(IBinder homeToken); |
| 422 | |
| 423 | /** |
Wale Ogunwale | 04d9cb5 | 2018-04-30 13:55:07 -0700 | [diff] [blame] | 424 | * Return the user id of last resumed activity. |
| 425 | */ |
| 426 | int getLastResumedActivityUserId(); |
| 427 | |
| 428 | /** |
| 429 | * Updates global configuration and applies changes to the entire system. |
| 430 | * @param values Update values for global configuration. If null is passed it will request the |
| 431 | * Window Manager to compute new config for the default display. |
| 432 | * @throws RemoteException |
| 433 | * @return Returns true if the configuration was updated. |
| 434 | */ |
| 435 | boolean updateConfiguration(in Configuration values); |
| 436 | void updateLockTaskFeatures(int userId, int flags); |
| 437 | |
| 438 | void setShowWhenLocked(in IBinder token, boolean showWhenLocked); |
Issei Suzuki | 74e1eb2 | 2018-12-20 17:42:52 +0100 | [diff] [blame] | 439 | void setInheritShowWhenLocked(in IBinder token, boolean setInheritShownWhenLocked); |
Wale Ogunwale | 04d9cb5 | 2018-04-30 13:55:07 -0700 | [diff] [blame] | 440 | void setTurnScreenOn(in IBinder token, boolean turnScreenOn); |
| 441 | |
| 442 | /** |
| 443 | * Registers remote animations for a specific activity. |
| 444 | */ |
| 445 | void registerRemoteAnimations(in IBinder token, in RemoteAnimationDefinition definition); |
| 446 | |
| 447 | /** |
Winson Chung | 10fc25d | 2019-12-10 14:13:56 -0800 | [diff] [blame] | 448 | * Unregisters all remote animations for a specific activity. |
| 449 | */ |
| 450 | void unregisterRemoteAnimations(in IBinder token); |
| 451 | |
| 452 | /** |
Wale Ogunwale | 04d9cb5 | 2018-04-30 13:55:07 -0700 | [diff] [blame] | 453 | * Registers a remote animation to be run for all activity starts from a certain package during |
| 454 | * a short predefined amount of time. |
| 455 | */ |
| 456 | void registerRemoteAnimationForNextActivityStart(in String packageName, |
| 457 | in RemoteAnimationAdapter adapter); |
| 458 | |
Evan Rosky | 966759f | 2019-01-15 10:33:58 -0800 | [diff] [blame] | 459 | /** |
| 460 | * Registers remote animations for a display. |
| 461 | */ |
| 462 | void registerRemoteAnimationsForDisplay(int displayId, in RemoteAnimationDefinition definition); |
| 463 | |
Wale Ogunwale | 04d9cb5 | 2018-04-30 13:55:07 -0700 | [diff] [blame] | 464 | /** @see android.app.ActivityManager#alwaysShowUnsupportedCompileSdkWarning */ |
| 465 | void alwaysShowUnsupportedCompileSdkWarning(in ComponentName activity); |
Wale Ogunwale | d0412b3 | 2018-05-08 09:25:50 -0700 | [diff] [blame] | 466 | |
| 467 | void setVrThread(int tid); |
| 468 | void setPersistentVrThread(int tid); |
Wale Ogunwale | a6191b4 | 2018-05-09 07:41:32 -0700 | [diff] [blame] | 469 | void stopAppSwitches(); |
| 470 | void resumeAppSwitches(); |
| 471 | void setActivityController(in IActivityController watcher, boolean imAMonkey); |
Wale Ogunwale | f673393 | 2018-06-27 05:14:34 -0700 | [diff] [blame] | 472 | void setVoiceKeepAwake(in IVoiceInteractionSession session, boolean keepAwake); |
Wale Ogunwale | 5378374 | 2018-09-16 10:21:51 -0700 | [diff] [blame] | 473 | |
| 474 | int getPackageScreenCompatMode(in String packageName); |
| 475 | void setPackageScreenCompatMode(in String packageName, int mode); |
| 476 | boolean getPackageAskScreenCompat(in String packageName); |
| 477 | void setPackageAskScreenCompat(in String packageName, boolean ask); |
Garfield Tan | 0154863 | 2018-11-27 10:15:48 -0800 | [diff] [blame] | 478 | |
| 479 | /** |
| 480 | * Clears launch params for given packages. |
| 481 | */ |
| 482 | void clearLaunchParamsForPackages(in List<String> packageNames); |
Wale Ogunwale | 9e737db | 2018-12-17 15:42:37 -0800 | [diff] [blame] | 483 | |
| 484 | /** |
| 485 | * Makes the display with the given id a single task instance display. I.e the display can only |
| 486 | * contain one task. |
| 487 | */ |
| 488 | void setDisplayToSingleTaskInstance(int displayId); |
Riddle Hsu | 7b766fd | 2019-01-28 21:14:59 +0800 | [diff] [blame] | 489 | |
| 490 | /** |
| 491 | * Restarts the activity by killing its process if it is visible. If the activity is not |
| 492 | * visible, the activity will not be restarted immediately and just keep the activity record in |
| 493 | * the stack. It also resets the current override configuration so the activity will use the |
| 494 | * configuration according to the latest state. |
| 495 | * |
| 496 | * @param activityToken The token of the target activity to restart. |
| 497 | */ |
| 498 | void restartActivityProcessIfVisible(in IBinder activityToken); |
Mark Renouf | 446251d | 2019-04-26 10:22:41 -0400 | [diff] [blame] | 499 | |
| 500 | /** |
| 501 | * Reports that an Activity received a back key press when there were no additional activities |
| 502 | * on the back stack. If the Activity should be finished, the callback will be invoked. A |
| 503 | * callback is used instead of finishing the activity directly from the server such that the |
| 504 | * client may perform actions prior to finishing. |
| 505 | */ |
| 506 | void onBackPressedOnTaskRoot(in IBinder activityToken, in IRequestFinishCallback callback); |
Wale Ogunwale | 65ebd95 | 2018-04-25 15:41:44 -0700 | [diff] [blame] | 507 | } |