public class SystemServicesProxy extends Object
Modifier and Type | Class and Description |
---|---|
static class |
SystemServicesProxy.TaskStackListener
An abstract class to track task stack changes.
|
Modifier and Type | Method and Description |
---|---|
void |
cancelThumbnailTransition(int taskId)
Cancels the current thumbnail transtion to/from Recents for the given task id.
|
void |
cancelWindowTransition(int taskId)
Cancels the current window transtion to/from Recents for the given task id.
|
void |
endProlongedAnimations() |
Drawable |
getActivityBanner(ActivityInfo info)
Returns a banner used on TV for the specified Activity.
|
ActivityInfo |
getActivityInfo(ComponentName cn)
Returns the activity info for a given component name.
|
ActivityInfo |
getActivityInfo(ComponentName cn,
int userId)
Returns the activity info for a given component name.
|
Drawable |
getActivityLogo(ActivityInfo info)
Returns a logo used on TV for the specified Activity.
|
Drawable |
getBadgedActivityIcon(ActivityInfo info,
int userId)
Returns the activity icon for the ActivityInfo for a user, badging if
necessary.
|
String |
getBadgedActivityLabel(ActivityInfo info,
int userId)
Returns the activity label, badging if necessary.
|
Drawable |
getBadgedApplicationIcon(ApplicationInfo appInfo,
int userId)
Returns the application icon for the ApplicationInfo for a user, badging if
necessary.
|
String |
getBadgedApplicationLabel(ApplicationInfo appInfo,
int userId)
Returns the application label, badging if necessary.
|
String |
getBadgedContentDescription(ActivityInfo info,
int userId,
Resources res)
Returns the content description for a given task, badging it if necessary.
|
Drawable |
getBadgedTaskDescriptionIcon(ActivityManager.TaskDescription taskDescription,
int userId,
Resources res)
Returns the task description icon, loading and badging it if it necessary.
|
int |
getCurrentUser()
Returns the current user id.
|
int |
getDeviceSmallestWidth()
Returns the smallest width/height.
|
Rect |
getDisplayRect()
Returns the current display rect in the current display orientation.
|
int |
getDockedDividerSize(Context context)
Calculates the size of the dock divider in the current orientation.
|
int |
getGlobalSetting(Context context,
String setting)
Returns a global setting.
|
String |
getHomeActivityPackageName()
Returns the package name of the home activity.
|
static SystemServicesProxy |
getInstance(Context context)
Returns the single instance of the
SystemServicesProxy . |
int |
getProcessUser()
Returns the processes user id.
|
List<ActivityManager.RecentTaskInfo> |
getRecentTasks(int numLatestTasks,
int userId,
boolean includeFrontMostExcludedTask,
ArraySet<Integer> quietProfileIds)
Returns a list of the recents tasks.
|
ActivityManager.RunningTaskInfo |
getRunningTask()
Returns the top running task.
|
void |
getStableInsets(Rect outStableInsets) |
String |
getSystemProperty(String key)
Returns a system property.
|
int |
getSystemSetting(Context context,
String setting)
Returns a system setting.
|
ThumbnailData |
getTaskThumbnail(int taskId)
Returns the top task thumbnail for the given task id
|
void |
getThumbnail(int taskId,
ThumbnailData thumbnailDataOut)
Returns a task thumbnail from the activity manager
|
Rect |
getWindowRect()
Returns the window rect for the RecentsActivity, based on the dimensions of the home stack.
|
boolean |
hasDockedTask() |
boolean |
hasFreeformWorkspaceSupport()
Returns whether this device has freeform workspaces.
|
boolean |
hasSoftNavigationBar()
Returns whether there is a soft nav bar.
|
boolean |
hasTransposedNavigationBar()
Returns whether the device has a transposed nav bar (on the right of the screen) in the
current display orientation.
|
boolean |
isBlackListedActivity(String className) |
static boolean |
isDockedStack(int stackId)
Returns whether the given stack id is the docked stack id.
|
static boolean |
isFreeformStack(int stackId)
Returns whether the given stack id is the freeform workspace stack id.
|
static boolean |
isHomeStack(int stackId)
Returns whether the given stack id is the home stack id.
|
boolean |
isInSafeMode()
Returns whether this device is in the safe mode.
|
static boolean |
isPinnedStack(int stackId)
Returns whether the given stack id is the pinned stack id.
|
boolean |
isRecentsActivityVisible()
Returns whether the recents activity is currently visible.
|
boolean |
isRecentsActivityVisible(MutableBoolean isHomeStackVisible)
Returns whether the recents activity is currently visible.
|
boolean |
isScreenPinningActive()
Returns whether the current task is in screen-pinning mode.
|
boolean |
isSystemUser(int userId)
Returns whether the provided represents the system user.
|
boolean |
isTouchExplorationEnabled()
Returns whether touch exploration is currently enabled.
|
boolean |
moveTaskToDockedStack(int taskId,
int createMode,
Rect initialBounds)
Docks an already resumed task to the side of the screen.
|
void |
moveTaskToStack(int taskId,
int stackId)
Moves a task into another stack.
|
void |
overridePendingAppTransitionMultiThumbFuture(IAppTransitionAnimationSpecsFuture future,
IRemoteCallback animStartedListener,
boolean scaleUp) |
void |
registerDockedStackListener(IDockedStackListener listener) |
void |
registerTaskStackListener(SystemServicesProxy.TaskStackListener listener)
Registers a task stack listener with the system.
|
void |
removeTask(int taskId)
Removes the task
|
void |
requestKeyboardShortcuts(Context context,
WindowManager.KeyboardShortcutsReceiver receiver,
int deviceId) |
void |
sendCloseSystemWindows(String reason)
Sends a message to close other system windows.
|
void |
setRecentsVisibility(boolean visible)
Updates the visibility of recents.
|
void |
setTvPipVisibility(boolean visible)
Updates the visibility of the picture-in-picture.
|
boolean |
startActivityFromRecents(Context context,
Task.TaskKey taskKey,
String taskName,
ActivityOptions options)
Starts an activity from recents.
|
void |
startInPlaceAnimationOnFrontMostApplication(ActivityOptions opts)
Starts an in-place animation on the front most application windows.
|
boolean |
startTaskInDockedMode(int taskId,
int createMode)
Docks a task to the side of the screen and starts it.
|
public static SystemServicesProxy getInstance(Context context)
SystemServicesProxy
.
This should only be called on the main thread.public boolean isBlackListedActivity(String className)
public List<ActivityManager.RecentTaskInfo> getRecentTasks(int numLatestTasks, int userId, boolean includeFrontMostExcludedTask, ArraySet<Integer> quietProfileIds)
includeFrontMostExcludedTask
- if set, will ensure that the front most excluded task
will be visible, otherwise no excluded tasks will be
visible.public ActivityManager.RunningTaskInfo getRunningTask()
public boolean isRecentsActivityVisible()
public boolean isRecentsActivityVisible(MutableBoolean isHomeStackVisible)
isHomeStackVisible
- if provided, will return whether the home stack is visible
regardless of the recents visibilitypublic boolean hasFreeformWorkspaceSupport()
public boolean isInSafeMode()
public boolean startTaskInDockedMode(int taskId, int createMode)
public boolean moveTaskToDockedStack(int taskId, int createMode, Rect initialBounds)
public static boolean isHomeStack(int stackId)
public static boolean isPinnedStack(int stackId)
public static boolean isDockedStack(int stackId)
public static boolean isFreeformStack(int stackId)
public boolean hasDockedTask()
public boolean hasSoftNavigationBar()
public boolean hasTransposedNavigationBar()
public void cancelWindowTransition(int taskId)
public void cancelThumbnailTransition(int taskId)
public ThumbnailData getTaskThumbnail(int taskId)
public void getThumbnail(int taskId, ThumbnailData thumbnailDataOut)
public void moveTaskToStack(int taskId, int stackId)
public void removeTask(int taskId)
public void sendCloseSystemWindows(String reason)
public ActivityInfo getActivityInfo(ComponentName cn, int userId)
cn
- The component name of the activity.userId
- The userId of the user that this is for.public ActivityInfo getActivityInfo(ComponentName cn)
cn
- The component name of the activity.public String getBadgedActivityLabel(ActivityInfo info, int userId)
public String getBadgedApplicationLabel(ApplicationInfo appInfo, int userId)
public String getBadgedContentDescription(ActivityInfo info, int userId, Resources res)
public Drawable getBadgedActivityIcon(ActivityInfo info, int userId)
public Drawable getBadgedApplicationIcon(ApplicationInfo appInfo, int userId)
public Drawable getBadgedTaskDescriptionIcon(ActivityManager.TaskDescription taskDescription, int userId, Resources res)
public Drawable getActivityBanner(ActivityInfo info)
public Drawable getActivityLogo(ActivityInfo info)
public String getHomeActivityPackageName()
public boolean isSystemUser(int userId)
public int getCurrentUser()
public int getProcessUser()
public boolean isTouchExplorationEnabled()
public boolean isScreenPinningActive()
public int getGlobalSetting(Context context, String setting)
public int getSystemSetting(Context context, String setting)
public int getDeviceSmallestWidth()
public Rect getDisplayRect()
public Rect getWindowRect()
public boolean startActivityFromRecents(Context context, Task.TaskKey taskKey, String taskName, ActivityOptions options)
public void startInPlaceAnimationOnFrontMostApplication(ActivityOptions opts)
public void registerTaskStackListener(SystemServicesProxy.TaskStackListener listener)
public void endProlongedAnimations()
public void registerDockedStackListener(IDockedStackListener listener)
public int getDockedDividerSize(Context context)
public void requestKeyboardShortcuts(Context context, WindowManager.KeyboardShortcutsReceiver receiver, int deviceId)
public void getStableInsets(Rect outStableInsets)
public void overridePendingAppTransitionMultiThumbFuture(IAppTransitionAnimationSpecsFuture future, IRemoteCallback animStartedListener, boolean scaleUp)
public void setRecentsVisibility(boolean visible)
public void setTvPipVisibility(boolean visible)