public class Task extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
Task.TaskCallbacks |
static class |
Task.TaskKey |
Modifier and Type | Field and Description |
---|---|
int |
affiliationColor |
int |
affiliationTaskId
The affiliationTaskId is the task id of the parent task or itself if it is not affiliated
with any task.
|
String |
appInfoDescription |
Rect |
bounds
The bounds of the task, used only if it is a freeform task.
|
int |
colorBackground |
int |
colorPrimary |
String |
dismissDescription |
TaskGrouping |
group
The group will be computed separately from the initialization of the task
|
Drawable |
icon
The icon is the task description icon (if provided), which falls back to the activity icon,
which can then fall back to the application icon.
|
boolean |
isDockable |
boolean |
isLaunchTarget
The state isLaunchTarget will be set for the correct task upon launching Recents.
|
boolean |
isStackTask |
boolean |
isSystemApp |
Task.TaskKey |
key |
int |
resizeMode
Resize mode.
|
static String |
TAG |
ActivityManager.TaskDescription |
taskDescription
The task description for this task, only used to reload task icons.
|
int |
temporarySortIndexInStack
The temporary sort index in the stack, used when ordering the stack.
|
Bitmap |
thumbnail |
String |
title |
String |
titleDescription |
ComponentName |
topActivity |
boolean |
useLightOnPrimaryColor |
Constructor and Description |
---|
Task() |
Task(Task.TaskKey key,
int affiliationTaskId,
int affiliationColor,
Drawable icon,
Bitmap thumbnail,
String title,
String titleDescription,
String dismissDescription,
String appInfoDescription,
int colorPrimary,
int colorBackground,
boolean isLaunchTarget,
boolean isStackTask,
boolean isSystemApp,
boolean isDockable,
Rect bounds,
ActivityManager.TaskDescription taskDescription,
int resizeMode,
ComponentName topActivity) |
Modifier and Type | Method and Description |
---|---|
void |
addCallback(Task.TaskCallbacks cb)
Add a callback.
|
void |
copyFrom(Task o)
Copies the metadata from another task, but retains the current callbacks.
|
void |
dump(String prefix,
PrintWriter writer) |
boolean |
equals(Object o)
Indicates whether some other object is "equal to" this one.
|
ComponentName |
getTopComponent()
Returns the top activity component.
|
boolean |
isAffiliatedTask()
Returns whether this task is affiliated with another task.
|
boolean |
isFreeformTask()
Returns whether this task is on the freeform task stack.
|
void |
notifyTaskDataLoaded(Bitmap thumbnail,
Drawable applicationIcon,
ActivityManager.TaskThumbnailInfo thumbnailInfo)
Notifies the callback listeners that this task has been loaded
|
void |
notifyTaskDataUnloaded(Bitmap defaultThumbnail,
Drawable defaultApplicationIcon)
Notifies the callback listeners that this task has been unloaded
|
void |
removeCallback(Task.TaskCallbacks cb)
Remove a callback.
|
void |
setGroup(TaskGrouping group)
Set the grouping
|
void |
setStackId(int stackId)
Updates the stack id of this task.
|
String |
toString()
Returns a string representation of the object.
|
public static final String TAG
public Task.TaskKey key
public int temporarySortIndexInStack
public TaskGrouping group
public int affiliationTaskId
public int affiliationColor
public Drawable icon
public Bitmap thumbnail
public String title
public String titleDescription
public String dismissDescription
public String appInfoDescription
public int colorPrimary
public int colorBackground
public boolean useLightOnPrimaryColor
public Rect bounds
public ActivityManager.TaskDescription taskDescription
public boolean isLaunchTarget
public boolean isStackTask
public boolean isSystemApp
public boolean isDockable
public int resizeMode
ActivityInfo.resizeMode
.public ComponentName topActivity
public Task()
public Task(Task.TaskKey key, int affiliationTaskId, int affiliationColor, Drawable icon, Bitmap thumbnail, String title, String titleDescription, String dismissDescription, String appInfoDescription, int colorPrimary, int colorBackground, boolean isLaunchTarget, boolean isStackTask, boolean isSystemApp, boolean isDockable, Rect bounds, ActivityManager.TaskDescription taskDescription, int resizeMode, ComponentName topActivity)
public void copyFrom(Task o)
public void addCallback(Task.TaskCallbacks cb)
public void removeCallback(Task.TaskCallbacks cb)
public void setGroup(TaskGrouping group)
public void setStackId(int stackId)
public boolean isFreeformTask()
public void notifyTaskDataLoaded(Bitmap thumbnail, Drawable applicationIcon, ActivityManager.TaskThumbnailInfo thumbnailInfo)
public void notifyTaskDataUnloaded(Bitmap defaultThumbnail, Drawable defaultApplicationIcon)
public boolean isAffiliatedTask()
public ComponentName getTopComponent()
public boolean equals(Object o)
Object
The equals
method implements an equivalence relation
on non-null object references:
x
, x.equals(x)
should return
true
.
x
and y
, x.equals(y)
should return true
if and only if
y.equals(x)
returns true
.
x
, y
, and z
, if
x.equals(y)
returns true
and
y.equals(z)
returns true
, then
x.equals(z)
should return true
.
x
and y
, multiple invocations of
x.equals(y)
consistently return true
or consistently return false
, provided no
information used in equals
comparisons on the
objects is modified.
x
,
x.equals(null)
should return false
.
The equals
method for class Object
implements
the most discriminating possible equivalence relation on objects;
that is, for any non-null reference values x
and
y
, this method returns true
if and only
if x
and y
refer to the same object
(x == y
has the value true
).
Note that it is generally necessary to override the hashCode
method whenever this method is overridden, so as to maintain the
general contract for the hashCode
method, which states
that equal objects must have equal hash codes.
equals
in class Object
o
- the reference object with which to compare.true
if this object is the same as the obj
argument; false
otherwise.Object.hashCode()
,
HashMap
public String toString()
Object
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
public void dump(String prefix, PrintWriter writer)