@Implements(value=android.app.ActivityManager.AppTask.class, minSdk=21) public class ShadowAppTask extends Object
| Constructor | Description |
|---|---|
ShadowAppTask() |
| Modifier and Type | Method | Description |
|---|---|---|
protected void |
finishAndRemoveTask() |
For tests, marks the task as finished.
|
protected ActivityManager.RecentTaskInfo |
getTaskInfo() |
For tests, returns the
ActivityManager.RecentTaskInfo set using setTaskInfo(RecentTaskInfo). |
boolean |
hasMovedToFront() |
Returns true if task has been moved to the front.
|
boolean |
isExcludedFromRecents() |
Returns true if task has been excluded from recents.
|
boolean |
isFinishedAndRemoved() |
Returns true if
finishAndRemoveTask() has been called before. |
protected void |
moveToFront() |
For tests, marks the task as moved to the front.
|
static ActivityManager.AppTask |
newInstance() |
|
protected void |
setExcludeFromRecents(boolean exclude) |
For tests, marks the task as excluded from recents.
|
void |
setTaskInfo(ActivityManager.RecentTaskInfo recentTaskInfo) |
Sets the recentTaskInfo for the task.
|
protected void |
startActivity(Context context,
Intent intent,
Bundle options) |
Starts the activity using given context.
|
public static ActivityManager.AppTask newInstance()
@Implementation protected void finishAndRemoveTask()
isFinishedAndRemoved()@Implementation protected ActivityManager.RecentTaskInfo getTaskInfo()
ActivityManager.RecentTaskInfo set using setTaskInfo(RecentTaskInfo).
If nothing is set, it returns null.setTaskInfo(RecentTaskInfo)@Implementation protected void moveToFront()
hasMovedToFront()@Implementation protected void startActivity(Context context, Intent intent, Bundle options)
ShadowContextWrapper.getNextStartedActivity()context - Context with which the activity will be start.intent - Intent of the activity to be started.options - Extras passed to the activity.@Implementation protected void setExcludeFromRecents(boolean exclude)
isExcludedFromRecents().exclude - Whether to exclude from recents.public boolean isFinishedAndRemoved()
finishAndRemoveTask() has been called before.public void setTaskInfo(ActivityManager.RecentTaskInfo recentTaskInfo)
getTaskInfo() returns the task info set using
this method.public boolean hasMovedToFront()
moveToFront()public boolean isExcludedFromRecents()
setExcludeFromRecents(boolean)