@Implements(value=android.app.ActivityManager.class) public class ShadowActivityManager extends java.lang.Object
Constructor and Description |
---|
ShadowActivityManager() |
Modifier and Type | Method and Description |
---|---|
protected java.util.List<android.app.ActivityManager.AppTask> |
getAppTasks()
For tests, returns the list of
ActivityManager.AppTask set using setAppTasks(List) . |
java.lang.String |
getBackgroundPackage() |
protected android.content.pm.ConfigurationInfo |
getDeviceConfigurationInfo() |
protected int |
getLockTaskModeState() |
protected int |
getMemoryClass() |
protected void |
getMemoryInfo(android.app.ActivityManager.MemoryInfo outInfo) |
protected static void |
getMyMemoryState(android.app.ActivityManager.RunningAppProcessInfo inState)
Returns information seeded by
setProcesses(java.util.List<android.app.ActivityManager.RunningAppProcessInfo>) . |
protected java.util.List<android.app.ActivityManager.RunningAppProcessInfo> |
getRunningAppProcesses() |
protected java.util.List<android.app.ActivityManager.RunningServiceInfo> |
getRunningServices(int maxNum) |
protected java.util.List<android.app.ActivityManager.RunningTaskInfo> |
getRunningTasks(int maxNum) |
protected static android.app.IActivityManager |
getService() |
protected boolean |
isInLockTaskMode() |
protected boolean |
isLowRamDevice() |
protected static boolean |
isUserAMonkey() |
protected void |
killBackgroundProcesses(java.lang.String packageName) |
static void |
reset() |
void |
setAppTasks(java.util.List<android.app.ActivityManager.AppTask> appTasks)
Sets the values to be returned by
getAppTasks() . |
void |
setIsLowRamDevice(boolean isLowRamDevice)
Override the return value of isLowRamDevice().
|
void |
setLockTaskModeState(int lockTaskModeState)
Sets lock task mode state to be reported by
ActivityManager.getLockTaskModeState() , but has no effect otherwise. |
void |
setMemoryClass(int memoryClass) |
void |
setMemoryInfo(android.app.ActivityManager.MemoryInfo memoryInfo) |
void |
setProcesses(java.util.List<android.app.ActivityManager.RunningAppProcessInfo> processes) |
void |
setServices(java.util.List<android.app.ActivityManager.RunningServiceInfo> services) |
void |
setTasks(java.util.List<android.app.ActivityManager.RunningTaskInfo> tasks) |
@Implementation protected int getMemoryClass()
@Implementation protected static boolean isUserAMonkey()
@Implementation protected java.util.List<android.app.ActivityManager.RunningTaskInfo> getRunningTasks(int maxNum)
@Implementation(minSdk=21) protected java.util.List<android.app.ActivityManager.AppTask> getAppTasks()
For tests, returns the list of ActivityManager.AppTask
set using setAppTasks(List)
. Returns empty list if nothing is set.
setAppTasks(List)
@Implementation protected java.util.List<android.app.ActivityManager.RunningServiceInfo> getRunningServices(int maxNum)
@Implementation protected java.util.List<android.app.ActivityManager.RunningAppProcessInfo> getRunningAppProcesses()
@Implementation protected static void getMyMemoryState(android.app.ActivityManager.RunningAppProcessInfo inState)
Returns information seeded by setProcesses(java.util.List<android.app.ActivityManager.RunningAppProcessInfo>)
.
@Implementation protected void killBackgroundProcesses(java.lang.String packageName)
@Implementation protected void getMemoryInfo(android.app.ActivityManager.MemoryInfo outInfo)
@Implementation protected android.content.pm.ConfigurationInfo getDeviceConfigurationInfo()
public void setTasks(java.util.List<android.app.ActivityManager.RunningTaskInfo> tasks)
tasks
- List of running tasks.public void setAppTasks(java.util.List<android.app.ActivityManager.AppTask> appTasks)
Sets the values to be returned by getAppTasks()
.
tasks
- List of app tasks.getAppTasks()
public void setServices(java.util.List<android.app.ActivityManager.RunningServiceInfo> services)
services
- List of running services.public void setProcesses(java.util.List<android.app.ActivityManager.RunningAppProcessInfo> processes)
processes
- List of running processes.public java.lang.String getBackgroundPackage()
public void setMemoryClass(int memoryClass)
memoryClass
- Set the application’s memory class.public void setMemoryInfo(android.app.ActivityManager.MemoryInfo memoryInfo)
memoryInfo
- Set the application’s memory info.@Implementation(minSdk=26) protected static android.app.IActivityManager getService()
@Implementation(minSdk=19) protected boolean isLowRamDevice()
public void setIsLowRamDevice(boolean isLowRamDevice)
Override the return value of isLowRamDevice().
@Implementation(minSdk=23) protected int getLockTaskModeState()
@Implementation(minSdk=21) protected boolean isInLockTaskMode()
public void setLockTaskModeState(int lockTaskModeState)
Sets lock task mode state to be reported by ActivityManager.getLockTaskModeState()
, but has no effect otherwise.
@Resetter public static void reset()