blob: 180507cd7e9c91ecaf3a8019e4005917f1bcf9aa [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. Moltmannee295092020-02-10 08:46:26 -080088 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 Ogunwale04d9cb52018-04-30 13:55:07 -070091 int flags, in ProfilerInfo profilerInfo, in Bundle options);
92 int startActivities(in IApplicationThread caller, in String callingPackage,
Philip P. Moltmannee295092020-02-10 08:46:26 -080093 in String callingFeatureId, in Intent[] intents, in String[] resolvedTypes,
94 in IBinder resultTo, in Bundle options, int userId);
Wale Ogunwale04d9cb52018-04-30 13:55:07 -070095 int startActivityAsUser(in IApplicationThread caller, in String callingPackage,
Philip P. Moltmannee295092020-02-10 08:46:26 -080096 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 Ogunwale04d9cb52018-04-30 13:55:07 -070099 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. Moltmannee295092020-02-10 08:46:26 -0800106 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 Ogunwale04d9cb52018-04-30 13:55:07 -0700109 int startActivityWithConfig(in IApplicationThread caller, in String callingPackage,
Philip P. Moltmannee295092020-02-10 08:46:26 -0800110 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 Ogunwale04d9cb52018-04-30 13:55:07 -0700119 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 Cichowlas3e340502018-08-07 17:15:01 -0400125 IBinder permissionToken, boolean ignoreTargetSecurity, int userId);
Robert Carr8a2f9132019-11-11 15:03:15 -0800126
Andrii Kulian2eb84b22018-12-13 18:18:54 -0800127 boolean isActivityStartAllowedOnDisplay(int displayId, in Intent intent, in String resolvedType,
128 int userId);
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700129
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 Kulian86e70fc2019-02-12 11:04:10 +0000137 void activityTopResumedStateLost();
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700138 void activityPaused(in IBinder token);
Robert Carr6827f722018-07-10 13:21:04 -0700139 void activityStopped(in IBinder token, in Bundle state,
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700140 in PersistableBundle persistentState, in CharSequence description);
141 oneway void activityDestroyed(in IBinder token);
142 void activityRelaunched(in IBinder token);
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700143 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 Chunge6439102018-07-30 15:48:01 -0700149 void removeAllVisibleRecentTasks();
Wale Ogunwale65ebd952018-04-25 15:41:44 -0700150 List<ActivityManager.RunningTaskInfo> getTasks(int maxNum);
151 List<ActivityManager.RunningTaskInfo> getFilteredTasks(int maxNum, int ignoreActivityType,
152 int ignoreWindowingMode);
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700153 boolean shouldUpRecreateTask(in IBinder token, in String destAffinity);
154 boolean navigateUpTo(in IBinder token, in Intent target, int resultCode,
155 in Intent resultData);
Ricky Waiaca8a772019-04-04 16:01:06 +0100156 void moveTaskToFront(in IApplicationThread app, in String callingPackage, int task,
157 int flags, in Bundle options);
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700158 int getTaskForActivity(in IBinder token, in boolean onlyRoot);
Andrii Kulian057a6512019-07-15 16:15:51 -0700159 /** Finish all activities that were started for result from the specified activity. */
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700160 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 Chang677921f2019-12-06 16:44:24 +0800169 int getDisplayId(in IBinder activityToken);
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700170 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 Ogunwale27c48ae2018-10-25 19:01:01 -0700189 void updateLockTaskPackages(int userId, in String[] packages);
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700190 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 Cichowlas3e340502018-08-07 17:15:01 -0400205 /**
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 Ogunwale04d9cb52018-04-30 13:55:07 -0700219 void releaseSomeActivities(in IApplicationThread app);
220 Bitmap getTaskDescriptionIcon(in String filename, int userId);
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700221 void registerTaskStackListener(in ITaskStackListener listener);
222 void unregisterTaskStackListener(in ITaskStackListener listener);
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700223 void setTaskResizeable(int taskId, int resizeableMode);
Yunfan Chend967af82019-01-17 18:30:18 +0900224 void toggleFreeformWindowingMode(in IBinder token);
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700225 void resizeTask(int taskId, in Rect bounds, int resizeMode);
226 void moveStackToDisplay(int stackId, int displayId);
227 void removeStack(int stackId);
228
Wale Ogunwale65ebd952018-04-25 15:41:44 -0700229 /**
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 Chung7ccc6812020-01-23 16:15:10 -0800235 * @return Whether the task was successfully put into the specified windowing mode.
Wale Ogunwale65ebd952018-04-25 15:41:44 -0700236 */
Winson Chung7ccc6812020-01-23 16:15:10 -0800237 boolean setTaskWindowingMode(int taskId, int windowingMode, boolean toTop);
Wale Ogunwale65ebd952018-04-25 15:41:44 -0700238 void moveTaskToStack(int taskId, int stackId, boolean toTop);
239 /**
Evan Roskydbe2ce52019-07-18 11:13:17 -0700240 * Resizes the input pinned stack to the given bounds with animation.
Wale Ogunwale65ebd952018-04-25 15:41:44 -0700241 *
Evan Roskydbe2ce52019-07-18 11:13:17 -0700242 * @param stackId Id of the pinned stack to resize.
Wale Ogunwale65ebd952018-04-25 15:41:44 -0700243 * @param bounds Bounds to resize the stack to or {@code null} for fullscreen.
Wale Ogunwale65ebd952018-04-25 15:41:44 -0700244 * @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 Roskydbe2ce52019-07-18 11:13:17 -0700248 void animateResizePinnedStack(int stackId, in Rect bounds, int animationDuration);
Wale Ogunwale65ebd952018-04-25 15:41:44 -0700249 boolean setTaskWindowingModeSplitScreenPrimary(int taskId, int createMode, boolean toTop,
250 boolean animate, in Rect initialBounds, boolean showRecents);
wilsonshih5c4cf522019-01-25 09:03:47 +0800251 /**
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 Ogunwale65ebd952018-04-25 15:41:44 -0700265 /**
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 Ogunwale04d9cb52018-04-30 13:55:07 -0700272
273 List<ActivityManager.StackInfo> getAllStackInfos();
274 ActivityManager.StackInfo getStackInfo(int windowingMode, int activityType);
Evan Roskyfd439692019-11-06 16:12:59 -0800275 List<ActivityManager.StackInfo> getAllStackInfosOnDisplay(int displayId);
276 ActivityManager.StackInfo getStackInfoOnDisplay(int windowingMode, int activityType,
277 int displayId);
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700278
279 /**
wilsonshihe7903ea2018-09-26 16:17:59 +0800280 * Informs ActivityTaskManagerService that the keyguard is showing.
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700281 *
282 * @param showingKeyguard True if the keyguard is showing, false otherwise.
283 * @param showingAod True if AOD is showing, false otherwise.
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700284 */
wilsonshih177261f2019-02-22 12:02:18 +0800285 void setLockScreenShown(boolean showingKeyguard, boolean showingAod);
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700286 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.com06bc3232019-10-31 14:51:22 -0700338 void requestPictureInPictureMode(in IBinder token);
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700339 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 Rosky0037e5f2019-11-05 10:26:24 -0800366 * Returns an interface enabling the management of task organizers.
367 */
368 ITaskOrganizerController getTaskOrganizerController();
369
370 /**
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700371 * 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 Chen75157d72018-07-27 14:47:21 +0900382 // Get device configuration
383 ConfigurationInfo getDeviceConfigurationInfo();
384
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700385 /**
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 Ogunwale04d9cb52018-04-30 13:55:07 -0700396 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 Hsu440f88b2019-11-06 22:17:35 +0800416 * 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 Ogunwale04d9cb52018-04-30 13:55:07 -0700424 * 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 Suzuki74e1eb22018-12-20 17:42:52 +0100439 void setInheritShowWhenLocked(in IBinder token, boolean setInheritShownWhenLocked);
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700440 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 Chung10fc25d2019-12-10 14:13:56 -0800448 * Unregisters all remote animations for a specific activity.
449 */
450 void unregisterRemoteAnimations(in IBinder token);
451
452 /**
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700453 * 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 Rosky966759f2019-01-15 10:33:58 -0800459 /**
460 * Registers remote animations for a display.
461 */
462 void registerRemoteAnimationsForDisplay(int displayId, in RemoteAnimationDefinition definition);
463
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700464 /** @see android.app.ActivityManager#alwaysShowUnsupportedCompileSdkWarning */
465 void alwaysShowUnsupportedCompileSdkWarning(in ComponentName activity);
Wale Ogunwaled0412b32018-05-08 09:25:50 -0700466
467 void setVrThread(int tid);
468 void setPersistentVrThread(int tid);
Wale Ogunwalea6191b42018-05-09 07:41:32 -0700469 void stopAppSwitches();
470 void resumeAppSwitches();
471 void setActivityController(in IActivityController watcher, boolean imAMonkey);
Wale Ogunwalef6733932018-06-27 05:14:34 -0700472 void setVoiceKeepAwake(in IVoiceInteractionSession session, boolean keepAwake);
Wale Ogunwale53783742018-09-16 10:21:51 -0700473
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 Tan01548632018-11-27 10:15:48 -0800478
479 /**
480 * Clears launch params for given packages.
481 */
482 void clearLaunchParamsForPackages(in List<String> packageNames);
Wale Ogunwale9e737db2018-12-17 15:42:37 -0800483
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 Hsu7b766fd2019-01-28 21:14:59 +0800489
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 Renouf446251d2019-04-26 10:22:41 -0400499
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 Ogunwale65ebd952018-04-25 15:41:44 -0700507}