blob: be2f144c2fe89667f2b8a2bf3d4763003e5a0614 [file] [log] [blame]
Wale Ogunwale65ebd952018-04-25 15:41:44 -07001/*
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
17package android.app;
18
19import android.app.ActivityManager;
20import android.app.ApplicationErrorReport;
21import android.app.ContentProviderHolder;
22import android.app.GrantedUriPermission;
23import android.app.IApplicationThread;
24import android.app.IActivityController;
25import android.app.IAppTask;
26import android.app.IAssistDataReceiver;
27import android.app.IInstrumentationWatcher;
28import android.app.IProcessObserver;
Mark Renouf446251d2019-04-26 10:22:41 -040029import android.app.IRequestFinishCallback;
Wale Ogunwale65ebd952018-04-25 15:41:44 -070030import android.app.IServiceConnection;
31import android.app.IStopUserCallback;
Evan Rosky0037e5f2019-11-05 10:26:24 -080032import android.app.ITaskOrganizerController;
Wale Ogunwale65ebd952018-04-25 15:41:44 -070033import android.app.ITaskStackListener;
34import android.app.IUiAutomationConnection;
35import android.app.IUidObserver;
36import android.app.IUserSwitchObserver;
37import android.app.Notification;
38import android.app.PendingIntent;
39import android.app.PictureInPictureParams;
40import android.app.ProfilerInfo;
41import android.app.WaitResult;
42import android.app.assist.AssistContent;
43import android.app.assist.AssistStructure;
44import android.content.ComponentName;
45import android.content.IIntentReceiver;
46import android.content.IIntentSender;
47import android.content.Intent;
48import android.content.IntentFilter;
49import android.content.IntentSender;
50import android.content.pm.ApplicationInfo;
51import android.content.pm.ConfigurationInfo;
52import android.content.pm.IPackageDataObserver;
53import android.content.pm.ParceledListSlice;
54import android.content.pm.ProviderInfo;
55import android.content.pm.UserInfo;
56import android.content.res.Configuration;
57import android.graphics.Bitmap;
58import android.graphics.GraphicBuffer;
59import android.graphics.Point;
60import android.graphics.Rect;
61import android.net.Uri;
62import android.os.Bundle;
63import android.os.Debug;
64import android.os.IBinder;
65import android.os.IProgressListener;
66import android.os.ParcelFileDescriptor;
67import android.os.PersistableBundle;
68import android.os.StrictMode;
69import android.os.WorkSource;
70import android.service.voice.IVoiceInteractionSession;
71import android.view.IRecentsAnimationRunner;
Robert Carr8a2f9132019-11-11 15:03:15 -080072import android.view.ITaskOrganizer;
Wale Ogunwale65ebd952018-04-25 15:41:44 -070073import android.view.RemoteAnimationDefinition;
74import android.view.RemoteAnimationAdapter;
75import com.android.internal.app.IVoiceInteractor;
76import com.android.internal.os.IResultReceiver;
77import com.android.internal.policy.IKeyguardDismissCallback;
78
79import 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 */
87interface IActivityTaskManager {
Philip P. Moltmanne7421e92020-02-10 16:14:12 +000088 int startActivity(in IApplicationThread caller, in String callingPackage, in Intent intent,
89 in String resolvedType, in IBinder resultTo, in String resultWho, int requestCode,
Wale Ogunwale04d9cb52018-04-30 13:55:07 -070090 int flags, in ProfilerInfo profilerInfo, in Bundle options);
91 int startActivities(in IApplicationThread caller, in String callingPackage,
Philip P. Moltmanne7421e92020-02-10 16:14:12 +000092 in Intent[] intents, in String[] resolvedTypes, in IBinder resultTo,
93 in Bundle options, int userId);
Wale Ogunwale04d9cb52018-04-30 13:55:07 -070094 int startActivityAsUser(in IApplicationThread caller, in String callingPackage,
Philip P. Moltmanne7421e92020-02-10 16:14:12 +000095 in Intent intent, in String resolvedType, in IBinder resultTo, in String resultWho,
96 int requestCode, int flags, in ProfilerInfo profilerInfo,
97 in Bundle options, int userId);
Wale Ogunwale04d9cb52018-04-30 13:55:07 -070098 boolean startNextMatchingActivity(in IBinder callingActivity,
99 in Intent intent, in Bundle options);
100 int startActivityIntentSender(in IApplicationThread caller,
101 in IIntentSender target, in IBinder whitelistToken, in Intent fillInIntent,
102 in String resolvedType, in IBinder resultTo, in String resultWho, int requestCode,
103 int flagsMask, int flagsValues, in Bundle options);
104 WaitResult startActivityAndWait(in IApplicationThread caller, in String callingPackage,
Philip P. Moltmanne7421e92020-02-10 16:14:12 +0000105 in Intent intent, in String resolvedType, in IBinder resultTo, in String resultWho,
106 int requestCode, int flags, in ProfilerInfo profilerInfo, in Bundle options,
107 int userId);
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700108 int startActivityWithConfig(in IApplicationThread caller, in String callingPackage,
Philip P. Moltmanne7421e92020-02-10 16:14:12 +0000109 in Intent intent, in String resolvedType, in IBinder resultTo, in String resultWho,
110 int requestCode, int startFlags, in Configuration newConfig,
111 in Bundle options, int userId);
112 int startVoiceActivity(in String callingPackage, int callingPid, int callingUid,
113 in Intent intent, in String resolvedType, in IVoiceInteractionSession session,
114 in IVoiceInteractor interactor, int flags, in ProfilerInfo profilerInfo,
115 in Bundle options, int userId);
116 int startAssistantActivity(in String callingPackage, int callingPid, int callingUid,
117 in Intent intent, in String resolvedType, in Bundle options, int userId);
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700118 void startRecentsActivity(in Intent intent, in IAssistDataReceiver assistDataReceiver,
119 in IRecentsAnimationRunner recentsAnimationRunner);
120 int startActivityFromRecents(int taskId, in Bundle options);
121 int startActivityAsCaller(in IApplicationThread caller, in String callingPackage,
122 in Intent intent, in String resolvedType, in IBinder resultTo, in String resultWho,
123 int requestCode, int flags, in ProfilerInfo profilerInfo, in Bundle options,
Alison Cichowlas3e340502018-08-07 17:15:01 -0400124 IBinder permissionToken, boolean ignoreTargetSecurity, int userId);
Robert Carr8a2f9132019-11-11 15:03:15 -0800125
Andrii Kulian2eb84b22018-12-13 18:18:54 -0800126 boolean isActivityStartAllowedOnDisplay(int displayId, in Intent intent, in String resolvedType,
127 int userId);
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700128
129 void unhandledBack();
130 boolean finishActivity(in IBinder token, int code, in Intent data, int finishTask);
131 boolean finishActivityAffinity(in IBinder token);
132
133 oneway void activityIdle(in IBinder token, in Configuration config,
134 in boolean stopProfiling);
135 void activityResumed(in IBinder token);
Andrii Kulian86e70fc2019-02-12 11:04:10 +0000136 void activityTopResumedStateLost();
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700137 void activityPaused(in IBinder token);
Robert Carr6827f722018-07-10 13:21:04 -0700138 void activityStopped(in IBinder token, in Bundle state,
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700139 in PersistableBundle persistentState, in CharSequence description);
140 oneway void activityDestroyed(in IBinder token);
141 void activityRelaunched(in IBinder token);
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700142 int getFrontActivityScreenCompatMode();
143 void setFrontActivityScreenCompatMode(int mode);
144 String getCallingPackage(in IBinder token);
145 ComponentName getCallingActivity(in IBinder token);
146 void setFocusedTask(int taskId);
147 boolean removeTask(int taskId);
Winson Chunge6439102018-07-30 15:48:01 -0700148 void removeAllVisibleRecentTasks();
Wale Ogunwale65ebd952018-04-25 15:41:44 -0700149 List<ActivityManager.RunningTaskInfo> getTasks(int maxNum);
150 List<ActivityManager.RunningTaskInfo> getFilteredTasks(int maxNum, int ignoreActivityType,
151 int ignoreWindowingMode);
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700152 boolean shouldUpRecreateTask(in IBinder token, in String destAffinity);
153 boolean navigateUpTo(in IBinder token, in Intent target, int resultCode,
154 in Intent resultData);
Ricky Waiaca8a772019-04-04 16:01:06 +0100155 void moveTaskToFront(in IApplicationThread app, in String callingPackage, int task,
156 int flags, in Bundle options);
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700157 int getTaskForActivity(in IBinder token, in boolean onlyRoot);
Andrii Kulian057a6512019-07-15 16:15:51 -0700158 /** Finish all activities that were started for result from the specified activity. */
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700159 void finishSubActivity(in IBinder token, in String resultWho, int requestCode);
160 ParceledListSlice getRecentTasks(int maxNum, int flags, int userId);
161 boolean willActivityBeVisible(in IBinder token);
162 void setRequestedOrientation(in IBinder token, int requestedOrientation);
163 int getRequestedOrientation(in IBinder token);
164 boolean convertFromTranslucent(in IBinder token);
165 boolean convertToTranslucent(in IBinder token, in Bundle options);
166 void notifyActivityDrawn(in IBinder token);
167 void reportActivityFullyDrawn(in IBinder token, boolean restoredFromBundle);
Louis Chang677921f2019-12-06 16:44:24 +0800168 int getDisplayId(in IBinder activityToken);
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700169 boolean isImmersive(in IBinder token);
170 void setImmersive(in IBinder token, boolean immersive);
171 boolean isTopActivityImmersive();
172 boolean moveActivityTaskToBack(in IBinder token, boolean nonRoot);
173 ActivityManager.TaskDescription getTaskDescription(int taskId);
174 void overridePendingTransition(in IBinder token, in String packageName,
175 int enterAnim, int exitAnim);
176 int getLaunchedFromUid(in IBinder activityToken);
177 String getLaunchedFromPackage(in IBinder activityToken);
178 void reportAssistContextExtras(in IBinder token, in Bundle extras,
179 in AssistStructure structure, in AssistContent content, in Uri referrer);
180
181 void setFocusedStack(int stackId);
182 ActivityManager.StackInfo getFocusedStackInfo();
183 Rect getTaskBounds(int taskId);
184
185 void cancelRecentsAnimation(boolean restoreHomeStackPosition);
186 void startLockTaskModeByToken(in IBinder token);
187 void stopLockTaskModeByToken(in IBinder token);
Wale Ogunwale27c48ae2018-10-25 19:01:01 -0700188 void updateLockTaskPackages(int userId, in String[] packages);
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700189 boolean isInLockTaskMode();
190 int getLockTaskModeState();
191 void setTaskDescription(in IBinder token, in ActivityManager.TaskDescription values);
192 Bundle getActivityOptions(in IBinder token);
193 List<IBinder> getAppTasks(in String callingPackage);
194 void startSystemLockTaskMode(int taskId);
195 void stopSystemLockTaskMode();
196 void finishVoiceTask(in IVoiceInteractionSession session);
197 boolean isTopOfTask(in IBinder token);
198 void notifyLaunchTaskBehindComplete(in IBinder token);
199 void notifyEnterAnimationComplete(in IBinder token);
200 int addAppTask(in IBinder activityToken, in Intent intent,
201 in ActivityManager.TaskDescription description, in Bitmap thumbnail);
202 Point getAppTaskThumbnailSize();
203 boolean releaseActivityInstance(in IBinder token);
Alison Cichowlas3e340502018-08-07 17:15:01 -0400204 /**
205 * Only callable from the system. This token grants a temporary permission to call
206 * #startActivityAsCallerWithToken. The token will time out after
207 * START_AS_CALLER_TOKEN_TIMEOUT if it is not used.
208 *
209 * @param delegatorToken The Binder token referencing the system Activity that wants to delegate
210 * the #startActivityAsCaller to another app. The "caller" will be the caller of this
211 * activity's token, not the delegate's caller (which is probably the delegator itself).
212 *
213 * @return Returns a token that can be given to a "delegate" app that may call
214 * #startActivityAsCaller
215 */
216 IBinder requestStartActivityPermissionToken(in IBinder delegatorToken);
217
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700218 void releaseSomeActivities(in IApplicationThread app);
219 Bitmap getTaskDescriptionIcon(in String filename, int userId);
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700220 void registerTaskStackListener(in ITaskStackListener listener);
221 void unregisterTaskStackListener(in ITaskStackListener listener);
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700222 void setTaskResizeable(int taskId, int resizeableMode);
Yunfan Chend967af82019-01-17 18:30:18 +0900223 void toggleFreeformWindowingMode(in IBinder token);
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700224 void resizeTask(int taskId, in Rect bounds, int resizeMode);
225 void moveStackToDisplay(int stackId, int displayId);
226 void removeStack(int stackId);
227
Wale Ogunwale65ebd952018-04-25 15:41:44 -0700228 /**
229 * Sets the windowing mode for a specific task. Only works on tasks of type
230 * {@link WindowConfiguration#ACTIVITY_TYPE_STANDARD}
231 * @param taskId The id of the task to set the windowing mode for.
232 * @param windowingMode The windowing mode to set for the task.
233 * @param toTop If the task should be moved to the top once the windowing mode changes.
Winson Chung7ccc6812020-01-23 16:15:10 -0800234 * @return Whether the task was successfully put into the specified windowing mode.
Wale Ogunwale65ebd952018-04-25 15:41:44 -0700235 */
Winson Chung7ccc6812020-01-23 16:15:10 -0800236 boolean setTaskWindowingMode(int taskId, int windowingMode, boolean toTop);
Wale Ogunwale65ebd952018-04-25 15:41:44 -0700237 void moveTaskToStack(int taskId, int stackId, boolean toTop);
238 /**
Evan Roskydbe2ce52019-07-18 11:13:17 -0700239 * Resizes the input pinned stack to the given bounds with animation.
Wale Ogunwale65ebd952018-04-25 15:41:44 -0700240 *
Evan Roskydbe2ce52019-07-18 11:13:17 -0700241 * @param stackId Id of the pinned stack to resize.
Wale Ogunwale65ebd952018-04-25 15:41:44 -0700242 * @param bounds Bounds to resize the stack to or {@code null} for fullscreen.
Wale Ogunwale65ebd952018-04-25 15:41:44 -0700243 * @param animationDuration The duration of the resize animation in milliseconds or -1 if the
244 * default animation duration should be used.
245 * @throws RemoteException
246 */
Evan Roskydbe2ce52019-07-18 11:13:17 -0700247 void animateResizePinnedStack(int stackId, in Rect bounds, int animationDuration);
Wale Ogunwale65ebd952018-04-25 15:41:44 -0700248 boolean setTaskWindowingModeSplitScreenPrimary(int taskId, int createMode, boolean toTop,
249 boolean animate, in Rect initialBounds, boolean showRecents);
wilsonshih5c4cf522019-01-25 09:03:47 +0800250 /**
251 * Use the offset to adjust the stack boundary with animation.
252 *
253 * @param stackId Id of the stack to adjust.
254 * @param compareBounds Offset is only applied if the current pinned stack bounds is equal to
255 * the compareBounds.
256 * @param xOffset The horizontal offset.
257 * @param yOffset The vertical offset.
258 * @param animationDuration The duration of the resize animation in milliseconds or -1 if the
259 * default animation duration should be used.
260 * @throws RemoteException
261 */
262 void offsetPinnedStackBounds(int stackId, in Rect compareBounds, int xOffset, int yOffset,
263 int animationDuration);
Wale Ogunwale65ebd952018-04-25 15:41:44 -0700264 /**
265 * Removes stacks in the input windowing modes from the system if they are of activity type
266 * ACTIVITY_TYPE_STANDARD or ACTIVITY_TYPE_UNDEFINED
267 */
268 void removeStacksInWindowingModes(in int[] windowingModes);
269 /** Removes stack of the activity types from the system. */
270 void removeStacksWithActivityTypes(in int[] activityTypes);
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700271
272 List<ActivityManager.StackInfo> getAllStackInfos();
273 ActivityManager.StackInfo getStackInfo(int windowingMode, int activityType);
Evan Roskyfd439692019-11-06 16:12:59 -0800274 List<ActivityManager.StackInfo> getAllStackInfosOnDisplay(int displayId);
275 ActivityManager.StackInfo getStackInfoOnDisplay(int windowingMode, int activityType,
276 int displayId);
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700277
278 /**
wilsonshihe7903ea2018-09-26 16:17:59 +0800279 * Informs ActivityTaskManagerService that the keyguard is showing.
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700280 *
281 * @param showingKeyguard True if the keyguard is showing, false otherwise.
282 * @param showingAod True if AOD is showing, false otherwise.
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700283 */
wilsonshih177261f2019-02-22 12:02:18 +0800284 void setLockScreenShown(boolean showingKeyguard, boolean showingAod);
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700285 Bundle getAssistContextExtras(int requestType);
286 boolean launchAssistIntent(in Intent intent, int requestType, in String hint, int userHandle,
287 in Bundle args);
288 boolean requestAssistContextExtras(int requestType, in IAssistDataReceiver receiver,
289 in Bundle receiverExtras, in IBinder activityToken,
290 boolean focused, boolean newSessionId);
291 boolean requestAutofillData(in IAssistDataReceiver receiver, in Bundle receiverExtras,
292 in IBinder activityToken, int flags);
293 boolean isAssistDataAllowedOnCurrentActivity();
294 boolean showAssistFromActivity(in IBinder token, in Bundle args);
295 boolean isRootVoiceInteraction(in IBinder token);
296 oneway void showLockTaskEscapeMessage(in IBinder token);
297
298 /**
299 * Notify the system that the keyguard is going away.
300 *
301 * @param flags See
302 * {@link android.view.WindowManagerPolicyConstants#KEYGUARD_GOING_AWAY_FLAG_TO_SHADE}
303 * etc.
304 */
305 void keyguardGoingAway(int flags);
306 ComponentName getActivityClassForToken(in IBinder token);
307 String getPackageForToken(in IBinder token);
308
309 /**
310 * Try to place task to provided position. The final position might be different depending on
311 * current user and stacks state. The task will be moved to target stack if it's currently in
312 * different stack.
313 */
314 void positionTaskInStack(int taskId, int stackId, int position);
315 void reportSizeConfigurations(in IBinder token, in int[] horizontalSizeConfiguration,
316 in int[] verticalSizeConfigurations, in int[] smallestWidthConfigurations);
317 /**
318 * Dismisses split-screen multi-window mode.
319 * {@param toTop} If true the current primary split-screen stack will be placed or left on top.
320 */
321 void dismissSplitScreenMode(boolean toTop);
322
323 /**
324 * Dismisses PiP
325 * @param animate True if the dismissal should be animated.
326 * @param animationDuration The duration of the resize animation in milliseconds or -1 if the
327 * default animation duration should be used.
328 */
329 void dismissPip(boolean animate, int animationDuration);
330 void suppressResizeConfigChanges(boolean suppress);
331 void moveTasksToFullscreenStack(int fromStackId, boolean onTop);
332 boolean moveTopActivityToPinnedStack(int stackId, in Rect bounds);
333 boolean isInMultiWindowMode(in IBinder token);
334 boolean isInPictureInPictureMode(in IBinder token);
335 boolean enterPictureInPictureMode(in IBinder token, in PictureInPictureParams params);
336 void setPictureInPictureParams(in IBinder token, in PictureInPictureParams params);
jorgegil@google.com06bc3232019-10-31 14:51:22 -0700337 void requestPictureInPictureMode(in IBinder token);
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700338 int getMaxNumPictureInPictureActions(in IBinder token);
339 IBinder getUriPermissionOwnerForActivity(in IBinder activityToken);
340
341 /**
342 * Resizes the docked stack, and all other stacks as the result of the dock stack bounds change.
343 *
344 * @param dockedBounds The bounds for the docked stack.
345 * @param tempDockedTaskBounds The temporary bounds for the tasks in the docked stack, which
346 * might be different from the stack bounds to allow more
347 * flexibility while resizing, or {@code null} if they should be the
348 * same as the stack bounds.
349 * @param tempDockedTaskInsetBounds The temporary bounds for the tasks to calculate the insets.
350 * When resizing, we usually "freeze" the layout of a task. To
351 * achieve that, we also need to "freeze" the insets, which
352 * gets achieved by changing task bounds but not bounds used
353 * to calculate the insets in this transient state
354 * @param tempOtherTaskBounds The temporary bounds for the tasks in all other stacks, or
355 * {@code null} if they should be the same as the stack bounds.
356 * @param tempOtherTaskInsetBounds Like {@code tempDockedTaskInsetBounds}, but for the other
357 * stacks.
358 * @throws RemoteException
359 */
360 void resizeDockedStack(in Rect dockedBounds, in Rect tempDockedTaskBounds,
361 in Rect tempDockedTaskInsetBounds,
362 in Rect tempOtherTaskBounds, in Rect tempOtherTaskInsetBounds);
363
364 /**
Evan Rosky0037e5f2019-11-05 10:26:24 -0800365 * Returns an interface enabling the management of task organizers.
366 */
367 ITaskOrganizerController getTaskOrganizerController();
368
369 /**
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700370 * Sets whether we are currently in an interactive split screen resize operation where we
371 * are changing the docked stack size.
372 */
373 void setSplitScreenResizing(boolean resizing);
374 int setVrMode(in IBinder token, boolean enabled, in ComponentName packageName);
375 void startLocalVoiceInteraction(in IBinder token, in Bundle options);
376 void stopLocalVoiceInteraction(in IBinder token);
377 boolean supportsLocalVoiceInteraction();
378 void notifyPinnedStackAnimationStarted();
379 void notifyPinnedStackAnimationEnded();
380
Yunfan Chen75157d72018-07-27 14:47:21 +0900381 // Get device configuration
382 ConfigurationInfo getDeviceConfigurationInfo();
383
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700384 /**
385 * Resizes the pinned stack.
386 *
387 * @param pinnedBounds The bounds for the pinned stack.
388 * @param tempPinnedTaskBounds The temporary bounds for the tasks in the pinned stack, which
389 * might be different from the stack bounds to allow more
390 * flexibility while resizing, or {@code null} if they should be the
391 * same as the stack bounds.
392 */
393 void resizePinnedStack(in Rect pinnedBounds, in Rect tempPinnedTaskBounds);
394
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700395 void dismissKeyguard(in IBinder token, in IKeyguardDismissCallback callback,
396 in CharSequence message);
397
398 /** Cancels the window transitions for the given task. */
399 void cancelTaskWindowTransition(int taskId);
400
401 /**
402 * @param taskId the id of the task to retrieve the sAutoapshots for
403 * @param reducedResolution if set, if the snapshot needs to be loaded from disk, this will load
404 * a reduced resolution of it, which is much faster
405 * @return a graphic buffer representing a screenshot of a task
406 */
407 ActivityManager.TaskSnapshot getTaskSnapshot(int taskId, boolean reducedResolution);
408
409 /**
410 * See {@link android.app.Activity#setDisablePreviewScreenshots}
411 */
412 void setDisablePreviewScreenshots(IBinder token, boolean disable);
413
414 /**
Riddle Hsu440f88b2019-11-06 22:17:35 +0800415 * It should only be called from home activity to remove its outdated snapshot. The home
416 * snapshot is used to speed up entering home from screen off. If the content of home activity
417 * is significantly different from before taking the snapshot, then the home activity can use
418 * this method to avoid inconsistent transition.
419 */
420 void invalidateHomeTaskSnapshot(IBinder homeToken);
421
422 /**
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700423 * Return the user id of last resumed activity.
424 */
425 int getLastResumedActivityUserId();
426
427 /**
428 * Updates global configuration and applies changes to the entire system.
429 * @param values Update values for global configuration. If null is passed it will request the
430 * Window Manager to compute new config for the default display.
431 * @throws RemoteException
432 * @return Returns true if the configuration was updated.
433 */
434 boolean updateConfiguration(in Configuration values);
435 void updateLockTaskFeatures(int userId, int flags);
436
437 void setShowWhenLocked(in IBinder token, boolean showWhenLocked);
Issei Suzuki74e1eb22018-12-20 17:42:52 +0100438 void setInheritShowWhenLocked(in IBinder token, boolean setInheritShownWhenLocked);
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700439 void setTurnScreenOn(in IBinder token, boolean turnScreenOn);
440
441 /**
442 * Registers remote animations for a specific activity.
443 */
444 void registerRemoteAnimations(in IBinder token, in RemoteAnimationDefinition definition);
445
446 /**
Winson Chung10fc25d2019-12-10 14:13:56 -0800447 * Unregisters all remote animations for a specific activity.
448 */
449 void unregisterRemoteAnimations(in IBinder token);
450
451 /**
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700452 * Registers a remote animation to be run for all activity starts from a certain package during
453 * a short predefined amount of time.
454 */
455 void registerRemoteAnimationForNextActivityStart(in String packageName,
456 in RemoteAnimationAdapter adapter);
457
Evan Rosky966759f2019-01-15 10:33:58 -0800458 /**
459 * Registers remote animations for a display.
460 */
461 void registerRemoteAnimationsForDisplay(int displayId, in RemoteAnimationDefinition definition);
462
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700463 /** @see android.app.ActivityManager#alwaysShowUnsupportedCompileSdkWarning */
464 void alwaysShowUnsupportedCompileSdkWarning(in ComponentName activity);
Wale Ogunwaled0412b32018-05-08 09:25:50 -0700465
466 void setVrThread(int tid);
467 void setPersistentVrThread(int tid);
Wale Ogunwalea6191b42018-05-09 07:41:32 -0700468 void stopAppSwitches();
469 void resumeAppSwitches();
470 void setActivityController(in IActivityController watcher, boolean imAMonkey);
Wale Ogunwalef6733932018-06-27 05:14:34 -0700471 void setVoiceKeepAwake(in IVoiceInteractionSession session, boolean keepAwake);
Wale Ogunwale53783742018-09-16 10:21:51 -0700472
473 int getPackageScreenCompatMode(in String packageName);
474 void setPackageScreenCompatMode(in String packageName, int mode);
475 boolean getPackageAskScreenCompat(in String packageName);
476 void setPackageAskScreenCompat(in String packageName, boolean ask);
Garfield Tan01548632018-11-27 10:15:48 -0800477
478 /**
479 * Clears launch params for given packages.
480 */
481 void clearLaunchParamsForPackages(in List<String> packageNames);
Wale Ogunwale9e737db2018-12-17 15:42:37 -0800482
483 /**
484 * Makes the display with the given id a single task instance display. I.e the display can only
485 * contain one task.
486 */
487 void setDisplayToSingleTaskInstance(int displayId);
Riddle Hsu7b766fd2019-01-28 21:14:59 +0800488
489 /**
490 * Restarts the activity by killing its process if it is visible. If the activity is not
491 * visible, the activity will not be restarted immediately and just keep the activity record in
492 * the stack. It also resets the current override configuration so the activity will use the
493 * configuration according to the latest state.
494 *
495 * @param activityToken The token of the target activity to restart.
496 */
497 void restartActivityProcessIfVisible(in IBinder activityToken);
Mark Renouf446251d2019-04-26 10:22:41 -0400498
499 /**
500 * Reports that an Activity received a back key press when there were no additional activities
501 * on the back stack. If the Activity should be finished, the callback will be invoked. A
502 * callback is used instead of finishing the activity directly from the server such that the
503 * client may perform actions prior to finishing.
504 */
505 void onBackPressedOnTaskRoot(in IBinder activityToken, in IRequestFinishCallback callback);
Wale Ogunwale65ebd952018-04-25 15:41:44 -0700506}