• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.ActivityTaskManager;
21 import android.app.ApplicationErrorReport;
22 import android.app.ContentProviderHolder;
23 import android.app.GrantedUriPermission;
24 import android.app.IApplicationThread;
25 import android.app.IActivityClientController;
26 import android.app.IActivityController;
27 import android.app.IAssistDataReceiver;
28 import android.app.IInstrumentationWatcher;
29 import android.app.IProcessObserver;
30 import android.app.IScreenCaptureObserver;
31 import android.app.IServiceConnection;
32 import android.app.IStopUserCallback;
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.PictureInPictureUiState;
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.RemoteCallback;
68 import android.os.StrictMode;
69 import android.os.WorkSource;
70 import android.service.voice.IVoiceInteractionSession;
71 import android.view.IRemoteAnimationRunner;
72 import android.view.RemoteAnimationDefinition;
73 import android.view.RemoteAnimationAdapter;
74 import android.window.IWindowOrganizerController;
75 import android.window.BackAnimationAdapter;
76 import android.window.BackNavigationInfo;
77 import android.window.SplashScreenView;
78 import com.android.internal.app.IVoiceInteractor;
79 import com.android.internal.os.IResultReceiver;
80 
81 import java.util.List;
82 
83 /**
84  * System private API for talking with the activity task manager that handles how activities are
85  * managed on screen.
86  *
87  * {@hide}
88  */
89 // TODO(b/174040395): Make this interface private to ActivityTaskManager.java and have external
90 // caller go through that call instead. This would help us better separate and control the API
91 // surface exposed.
92 // TODO(b/174041603): Create a builder interface for things like startActivityXXX(...) to reduce
93 // interface duplication.
94 interface IActivityTaskManager {
startActivity(in IApplicationThread caller, in String callingPackage, in String callingFeatureId, in Intent intent, in String resolvedType, in IBinder resultTo, in String resultWho, int requestCode, int flags, in ProfilerInfo profilerInfo, in Bundle options)95     int startActivity(in IApplicationThread caller, in String callingPackage,
96             in String callingFeatureId, in Intent intent, in String resolvedType,
97             in IBinder resultTo, in String resultWho, int requestCode,
98             int flags, in ProfilerInfo profilerInfo, in Bundle options);
startActivities(in IApplicationThread caller, in String callingPackage, in String callingFeatureId, in Intent[] intents, in String[] resolvedTypes, in IBinder resultTo, in Bundle options, int userId)99     int startActivities(in IApplicationThread caller, in String callingPackage,
100             in String callingFeatureId, in Intent[] intents, in String[] resolvedTypes,
101             in IBinder resultTo, in Bundle options, int userId);
startActivityAsUser(in IApplicationThread caller, in String callingPackage, in String callingFeatureId, in Intent intent, in String resolvedType, in IBinder resultTo, in String resultWho, int requestCode, int flags, in ProfilerInfo profilerInfo, in Bundle options, int userId)102     int startActivityAsUser(in IApplicationThread caller, in String callingPackage,
103             in String callingFeatureId, in Intent intent, in String resolvedType,
104             in IBinder resultTo, in String resultWho, int requestCode, int flags,
105             in ProfilerInfo profilerInfo, in Bundle options, int userId);
startNextMatchingActivity(in IBinder callingActivity, in Intent intent, in Bundle options)106     boolean startNextMatchingActivity(in IBinder callingActivity,
107             in Intent intent, in Bundle options);
startActivityIntentSender(in IApplicationThread caller, in IIntentSender target, in IBinder whitelistToken, in Intent fillInIntent, in String resolvedType, in IBinder resultTo, in String resultWho, int requestCode, int flagsMask, int flagsValues, in Bundle options)108     int startActivityIntentSender(in IApplicationThread caller,
109             in IIntentSender target, in IBinder whitelistToken, in Intent fillInIntent,
110             in String resolvedType, in IBinder resultTo, in String resultWho, int requestCode,
111             int flagsMask, int flagsValues, in Bundle options);
startActivityAndWait(in IApplicationThread caller, in String callingPackage, in String callingFeatureId, in Intent intent, in String resolvedType, in IBinder resultTo, in String resultWho, int requestCode, int flags, in ProfilerInfo profilerInfo, in Bundle options, int userId)112     WaitResult startActivityAndWait(in IApplicationThread caller, in String callingPackage,
113             in String callingFeatureId, in Intent intent, in String resolvedType,
114             in IBinder resultTo, in String resultWho, int requestCode, int flags,
115             in ProfilerInfo profilerInfo, in Bundle options, int userId);
startActivityWithConfig(in IApplicationThread caller, in String callingPackage, in String callingFeatureId, in Intent intent, in String resolvedType, in IBinder resultTo, in String resultWho, int requestCode, int startFlags, in Configuration newConfig, in Bundle options, int userId)116     int startActivityWithConfig(in IApplicationThread caller, in String callingPackage,
117             in String callingFeatureId, in Intent intent, in String resolvedType,
118             in IBinder resultTo, in String resultWho, int requestCode, int startFlags,
119             in Configuration newConfig, in Bundle options, int userId);
startVoiceActivity(in String callingPackage, in String callingFeatureId, int callingPid, int callingUid, in Intent intent, in String resolvedType, in IVoiceInteractionSession session, in IVoiceInteractor interactor, int flags, in ProfilerInfo profilerInfo, in Bundle options, int userId)120     int startVoiceActivity(in String callingPackage, in String callingFeatureId, int callingPid,
121             int callingUid, in Intent intent, in String resolvedType,
122             in IVoiceInteractionSession session, in IVoiceInteractor interactor, int flags,
123             in ProfilerInfo profilerInfo, in Bundle options, int userId);
getVoiceInteractorPackageName(in IBinder callingVoiceInteractor)124     String getVoiceInteractorPackageName(in IBinder callingVoiceInteractor);
startAssistantActivity(in String callingPackage, in String callingFeatureId, int callingPid, int callingUid, in Intent intent, in String resolvedType, in Bundle options, int userId)125     int startAssistantActivity(in String callingPackage, in String callingFeatureId, int callingPid,
126             int callingUid, in Intent intent, in String resolvedType, in Bundle options, int userId);
127     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.MANAGE_GAME_ACTIVITY)")
startActivityFromGameSession(IApplicationThread caller, in String callingPackage, in String callingFeatureId, int callingPid, int callingUid, in Intent intent, int taskId, int userId)128     int startActivityFromGameSession(IApplicationThread caller, in String callingPackage,
129             in String callingFeatureId, int callingPid, int callingUid, in Intent intent,
130             int taskId, int userId);
startActivityFromRecents(int taskId, in Bundle options)131     int startActivityFromRecents(int taskId, in Bundle options);
startActivityAsCaller(in IApplicationThread caller, in String callingPackage, in Intent intent, in String resolvedType, in IBinder resultTo, in String resultWho, int requestCode, int flags, in ProfilerInfo profilerInfo, in Bundle options, boolean ignoreTargetSecurity, int userId)132     int startActivityAsCaller(in IApplicationThread caller, in String callingPackage,
133             in Intent intent, in String resolvedType, in IBinder resultTo, in String resultWho,
134             int requestCode, int flags, in ProfilerInfo profilerInfo, in Bundle options,
135             boolean ignoreTargetSecurity, int userId);
preloadRecentsActivity(in Intent intent)136     void preloadRecentsActivity(in Intent intent);
137 
isActivityStartAllowedOnDisplay(int displayId, in Intent intent, in String resolvedType, int userId)138     boolean isActivityStartAllowedOnDisplay(int displayId, in Intent intent, in String resolvedType,
139             int userId);
140 
unhandledBack()141     void unhandledBack();
142 
143     /** Returns an interface to control the activity related operations. */
getActivityClientController()144     IActivityClientController getActivityClientController();
145 
getFrontActivityScreenCompatMode()146     int getFrontActivityScreenCompatMode();
setFrontActivityScreenCompatMode(int mode)147     void setFrontActivityScreenCompatMode(int mode);
setFocusedTask(int taskId)148     void setFocusedTask(int taskId);
setTaskIsPerceptible(int taskId, boolean isPerceptible)149     boolean setTaskIsPerceptible(int taskId, boolean isPerceptible);
removeTask(int taskId)150     boolean removeTask(int taskId);
removeAllVisibleRecentTasks()151     void removeAllVisibleRecentTasks();
getTasks(int maxNum, boolean filterOnlyVisibleRecents, boolean keepIntentExtra, int displayId)152     List<ActivityManager.RunningTaskInfo> getTasks(int maxNum, boolean filterOnlyVisibleRecents,
153             boolean keepIntentExtra, int displayId);
moveTaskToFront(in IApplicationThread app, in String callingPackage, int task, int flags, in Bundle options)154     void moveTaskToFront(in IApplicationThread app, in String callingPackage, int task,
155             int flags, in Bundle options);
getRecentTasks(int maxNum, int flags, int userId)156     ParceledListSlice<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum, int flags,
157             int userId);
isTopActivityImmersive()158     boolean isTopActivityImmersive();
reportAssistContextExtras(in IBinder assistToken, in Bundle extras, in AssistStructure structure, in AssistContent content, in Uri referrer)159     void reportAssistContextExtras(in IBinder assistToken, in Bundle extras,
160             in AssistStructure structure, in AssistContent content, in Uri referrer);
161 
162     /**
163      * @return whether the app could be universal resizeable (assuming it's on a large screen and
164      * ignoring possible overrides)
165      */
canBeUniversalResizeable(in ApplicationInfo appInfo)166     boolean canBeUniversalResizeable(in ApplicationInfo appInfo);
167 
setFocusedRootTask(int taskId)168     void setFocusedRootTask(int taskId);
getFocusedRootTaskInfo()169     ActivityTaskManager.RootTaskInfo getFocusedRootTaskInfo();
getTaskBounds(int taskId)170     Rect getTaskBounds(int taskId);
171 
172     /** Focuses the top task on a display if it isn't already focused. Used for Recents. */
focusTopTask(int displayId)173     void focusTopTask(int displayId);
174 
175     @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.UPDATE_LOCK_TASK_PACKAGES)")
updateLockTaskPackages(int userId, in String[] packages)176     void updateLockTaskPackages(int userId, in String[] packages);
isInLockTaskMode()177     boolean isInLockTaskMode();
getLockTaskModeState()178     int getLockTaskModeState();
getAppTasks(in String callingPackage)179     List<IBinder> getAppTasks(in String callingPackage);
startSystemLockTaskMode(int taskId)180     void startSystemLockTaskMode(int taskId);
stopSystemLockTaskMode()181     void stopSystemLockTaskMode();
finishVoiceTask(in IVoiceInteractionSession session)182     void finishVoiceTask(in IVoiceInteractionSession session);
addAppTask(in IBinder activityToken, in Intent intent, in ActivityManager.TaskDescription description, in Bitmap thumbnail)183     int addAppTask(in IBinder activityToken, in Intent intent,
184             in ActivityManager.TaskDescription description, in Bitmap thumbnail);
getAppTaskThumbnailSize()185     Point getAppTaskThumbnailSize();
186 
releaseSomeActivities(in IApplicationThread app)187     oneway void releaseSomeActivities(in IApplicationThread app);
getTaskDescriptionIcon(in String filename, int userId)188     Bitmap getTaskDescriptionIcon(in String filename, int userId);
registerTaskStackListener(in ITaskStackListener listener)189     void registerTaskStackListener(in ITaskStackListener listener);
unregisterTaskStackListener(in ITaskStackListener listener)190     void unregisterTaskStackListener(in ITaskStackListener listener);
setTaskResizeable(int taskId, int resizeableMode)191     void setTaskResizeable(int taskId, int resizeableMode);
192 
193     /**
194      * Resize the task with given bounds
195      *
196      * @param taskId The id of the task to set the bounds for.
197      * @param bounds The new bounds.
198      * @param resizeMode Resize mode defined as {@code ActivityTaskManager#RESIZE_MODE_*} constants.
199      */
resizeTask(int taskId, in Rect bounds, int resizeMode)200     void resizeTask(int taskId, in Rect bounds, int resizeMode);
moveRootTaskToDisplay(int taskId, int displayId)201     void moveRootTaskToDisplay(int taskId, int displayId);
202 
moveTaskToRootTask(int taskId, int rootTaskId, boolean toTop)203     void moveTaskToRootTask(int taskId, int rootTaskId, boolean toTop);
204 
205     /**
206      * Removes root tasks in the input windowing modes from the system if they are of activity type
207      * ACTIVITY_TYPE_STANDARD or ACTIVITY_TYPE_UNDEFINED
208      */
removeRootTasksInWindowingModes(in int[] windowingModes)209     void removeRootTasksInWindowingModes(in int[] windowingModes);
210     /** Removes root tasks of the activity types from the system. */
removeRootTasksWithActivityTypes(in int[] activityTypes)211     void removeRootTasksWithActivityTypes(in int[] activityTypes);
212 
getAllRootTaskInfos()213     List<ActivityTaskManager.RootTaskInfo> getAllRootTaskInfos();
getRootTaskInfo(int windowingMode, int activityType)214     ActivityTaskManager.RootTaskInfo getRootTaskInfo(int windowingMode, int activityType);
getAllRootTaskInfosOnDisplay(int displayId)215     List<ActivityTaskManager.RootTaskInfo> getAllRootTaskInfosOnDisplay(int displayId);
getRootTaskInfoOnDisplay(int windowingMode, int activityType, int displayId)216     ActivityTaskManager.RootTaskInfo getRootTaskInfoOnDisplay(int windowingMode, int activityType, int displayId);
217 
218     /**
219      * Informs ActivityTaskManagerService that the keyguard is showing.
220      *
221      * @param showingKeyguard True if the keyguard is showing, false otherwise.
222      * @param showingAod True if AOD is showing, false otherwise.
223      */
setLockScreenShown(boolean showingKeyguard, boolean showingAod)224     void setLockScreenShown(boolean showingKeyguard, boolean showingAod);
getAssistContextExtras(int requestType)225     Bundle getAssistContextExtras(int requestType);
requestAssistContextExtras(int requestType, in IAssistDataReceiver receiver, in Bundle receiverExtras, in IBinder activityToken, boolean focused, boolean newSessionId)226     boolean requestAssistContextExtras(int requestType, in IAssistDataReceiver receiver,
227             in Bundle receiverExtras, in IBinder activityToken,
228             boolean focused, boolean newSessionId);
requestAutofillData(in IAssistDataReceiver receiver, in Bundle receiverExtras, in IBinder activityToken, int flags)229     boolean requestAutofillData(in IAssistDataReceiver receiver, in Bundle receiverExtras,
230             in IBinder activityToken, int flags);
isAssistDataAllowed()231     boolean isAssistDataAllowed();
requestAssistDataForTask(in IAssistDataReceiver receiver, int taskId, in String callingPackageName, String callingAttributionTag, boolean fetchStructure)232     boolean requestAssistDataForTask(in IAssistDataReceiver receiver, int taskId,
233             in String callingPackageName, String callingAttributionTag, boolean fetchStructure);
234 
235     /**
236      * Notify the system that the keyguard is going away.
237      *
238      * @param flags See
239      *              {@link android.view.WindowManagerPolicyConstants#KEYGUARD_GOING_AWAY_FLAG_TO_SHADE}
240      *              etc.
241      */
242      @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.CONTROL_KEYGUARD)")
keyguardGoingAway(int flags)243     void keyguardGoingAway(int flags);
244 
suppressResizeConfigChanges(boolean suppress)245     void suppressResizeConfigChanges(boolean suppress);
246 
247     /** Returns an interface enabling the management of window organizers. */
getWindowOrganizerController()248     IWindowOrganizerController getWindowOrganizerController();
249 
supportsLocalVoiceInteraction()250     boolean supportsLocalVoiceInteraction();
251 
252     // Requests the "Open in browser" education to be shown
requestOpenInBrowserEducation(IBinder appToken)253     void requestOpenInBrowserEducation(IBinder appToken);
254 
255     // Get device configuration
getDeviceConfigurationInfo()256     ConfigurationInfo getDeviceConfigurationInfo();
257 
258     /** Cancels the window transitions for the given task. */
cancelTaskWindowTransition(int taskId)259     void cancelTaskWindowTransition(int taskId);
260 
261     /**
262      * Fetches the snapshot for the task with the given id, taking a new snapshot if it is not in
263      * the task snapshot cache and it is requested.
264      *
265      * @param taskId the id of the task to retrieve the sAutoapshots for
266      * @param isLowResolution if set, if the snapshot needs to be loaded from disk, this will load
267      *                          a reduced resolution of it, which is much faster
268      * @return a graphic buffer representing a screenshot of a task
269      */
getTaskSnapshot( int taskId, boolean isLowResolution)270     android.window.TaskSnapshot getTaskSnapshot(
271             int taskId, boolean isLowResolution);
272 
273     /**
274      * Requests for a new snapshot to be taken for the task with the given id, storing it in the
275      * task snapshot cache only if requested.
276      *
277      * @param taskId the id of the task to take a snapshot of
278      * @param updateCache Whether to store the new snapshot in the system's task snapshot cache.
279      *                    If it is true, the snapshot can be either real content or app-theme mode
280      *                    depending on the attributes of app. Otherwise, the snapshot will be taken
281      *                    with real content.
282      * @return a graphic buffer representing a screenshot of a task
283      */
takeTaskSnapshot(int taskId, boolean updateCache)284     android.window.TaskSnapshot takeTaskSnapshot(int taskId, boolean updateCache);
285 
286     /**
287      * Return the user id of last resumed activity.
288      */
getLastResumedActivityUserId()289     int getLastResumedActivityUserId();
290 
291     /**
292      * Updates global configuration and applies changes to the entire system.
293      * @param values Update values for global configuration. If null is passed it will request the
294      *               Window Manager to compute new config for the default display.
295      * @throws RemoteException
296      * @return Returns true if the configuration was updated.
297      */
updateConfiguration(in Configuration values)298     boolean updateConfiguration(in Configuration values);
updateLockTaskFeatures(int userId, int flags)299     void updateLockTaskFeatures(int userId, int flags);
300 
301     /**
302      * Registers a remote animation to be run for all activity starts from a certain package during
303      * a short predefined amount of time.
304      */
registerRemoteAnimationForNextActivityStart(in String packageName, in RemoteAnimationAdapter adapter, in IBinder launchCookie)305     void registerRemoteAnimationForNextActivityStart(in String packageName,
306             in RemoteAnimationAdapter adapter, in IBinder launchCookie);
307 
308     /**
309      * Registers remote animations for a display.
310      */
registerRemoteAnimationsForDisplay(int displayId, in RemoteAnimationDefinition definition)311     void registerRemoteAnimationsForDisplay(int displayId, in RemoteAnimationDefinition definition);
312 
313     /** @see android.app.ActivityManager#alwaysShowUnsupportedCompileSdkWarning */
alwaysShowUnsupportedCompileSdkWarning(in ComponentName activity)314     void alwaysShowUnsupportedCompileSdkWarning(in ComponentName activity);
315 
setVrThread(int tid)316     void setVrThread(int tid);
setPersistentVrThread(int tid)317     void setPersistentVrThread(int tid);
stopAppSwitches()318     void stopAppSwitches();
resumeAppSwitches()319     void resumeAppSwitches();
setActivityController(in IActivityController watcher, boolean imAMonkey)320     void setActivityController(in IActivityController watcher, boolean imAMonkey);
setVoiceKeepAwake(in IVoiceInteractionSession session, boolean keepAwake)321     void setVoiceKeepAwake(in IVoiceInteractionSession session, boolean keepAwake);
322 
getPackageScreenCompatMode(in String packageName)323     int getPackageScreenCompatMode(in String packageName);
setPackageScreenCompatMode(in String packageName, int mode)324     void setPackageScreenCompatMode(in String packageName, int mode);
getPackageAskScreenCompat(in String packageName)325     boolean getPackageAskScreenCompat(in String packageName);
setPackageAskScreenCompat(in String packageName, boolean ask)326     void setPackageAskScreenCompat(in String packageName, boolean ask);
327 
328     /**
329      * Clears launch params for given packages.
330      */
clearLaunchParamsForPackages(in List<String> packageNames)331     void clearLaunchParamsForPackages(in List<String> packageNames);
332 
333     /**
334      * A splash screen view has copied.
335      */
onSplashScreenViewCopyFinished(int taskId, in @nullable SplashScreenView.SplashScreenViewParcelable material)336     void onSplashScreenViewCopyFinished(int taskId,
337             in @nullable SplashScreenView.SplashScreenViewParcelable material);
338 
339     /**
340      * When the Picture-in-picture state has changed.
341      * @param pipState the {@link PictureInPictureUiState} is sent to current pip task if there is
342      * any -or- the top most task (state like entering PiP does not require a pinned task).
343      */
onPictureInPictureUiStateChanged(in PictureInPictureUiState pipState)344     void onPictureInPictureUiStateChanged(in PictureInPictureUiState pipState);
345 
346     /**
347      * Re-attach navbar to the display during a recents transition.
348      * TODO(188595497): Remove this once navbar attachment is in shell.
349      */
detachNavigationBarFromApp(in IBinder transition)350     void detachNavigationBarFromApp(in IBinder transition);
351 
352     /**
353      * Marks a process as a delegate for the currently playing remote transition animation. This
354      * must be called from a process that is already a remote transition player or delegate. Any
355      * marked delegates are cleaned-up automatically at the end of the transition.
356      * @param caller is the IApplicationThread representing the calling process.
357      */
setRunningRemoteTransitionDelegate(in IApplicationThread caller)358     void setRunningRemoteTransitionDelegate(in IApplicationThread caller);
359 
360     /**
361      * Prepare the back navigation in the server. This setups the leashed for sysui to animate
362      * the back gesture and returns the data needed for the animation.
363      * @param navigationObserver a remote callback to nofify shell when the focused window is gone,
364                                  or an unexpected transition has happened on the navigation target.
365      * @param adaptor a remote animation to be run for the back navigation plays the animation.
366      * @return Returns the back navigation info.
367      */
startBackNavigation( in RemoteCallback navigationObserver, in BackAnimationAdapter adaptor)368     android.window.BackNavigationInfo startBackNavigation(
369             in RemoteCallback navigationObserver, in BackAnimationAdapter adaptor);
370 
371     /**
372      * Registers a callback to be invoked when the system server requests a back gesture.
373      */
registerBackGestureDelegate(in RemoteCallback monitor)374     void registerBackGestureDelegate(in RemoteCallback monitor);
375 
376     /**
377      * registers a callback to be invoked when a background activity launch is aborted.
378      *
379      * @param observer callback to be registered.
380      * @return true if the callback was successfully registered, false otherwise.
381      * @hide
382      */
registerBackgroundActivityStartCallback(in IBinder binder)383     boolean registerBackgroundActivityStartCallback(in IBinder binder);
384 
385     /**
386      * unregisters a callback to be invoked when a background activity launch is aborted.
387      *
388      * @param observer callback to be registered.
389      * @hide
390      */
unregisterBackgroundActivityStartCallback(in IBinder binder)391     void unregisterBackgroundActivityStartCallback(in IBinder binder);
392 
393     /**
394      * registers a callback to be invoked when the screen is captured.
395      *
396      * @param observer callback to be registered.
397      * @param activityToken The token for the activity to set the callback to.
398      * @hide
399      */
registerScreenCaptureObserver(IBinder activityToken, IScreenCaptureObserver observer)400     void registerScreenCaptureObserver(IBinder activityToken, IScreenCaptureObserver observer);
401 
402     /**
403      * unregisters the screen capture callback which was registered with
404      * {@link #registerScreenCaptureObserver(ScreenCaptureObserver)}.
405      *
406      * @param observer callback to be unregistered.
407      * @param activityToken The token for the activity to unset the callback from.
408      * @hide
409      */
unregisterScreenCaptureObserver(IBinder activityToken, IScreenCaptureObserver observer)410     void unregisterScreenCaptureObserver(IBinder activityToken, IScreenCaptureObserver observer);
411 }
412