TaskRecordpublic class TaskRecord extends Object
Fields Summary |
---|
final int | taskId | final String | affinity | final boolean | clearOnBackground | android.content.Intent | intent | android.content.Intent | affinityIntent | android.content.ComponentName | origActivity | android.content.ComponentName | realActivity | int | numActivities | long | lastActiveTime | boolean | rootWasReset |
Methods Summary |
---|
void | dump(java.io.PrintWriter pw, java.lang.String prefix)
pw.println(prefix + this);
pw.println(prefix + "clearOnBackground=" + clearOnBackground
+ " numActivities=" + numActivities
+ " rootWasReset=" + rootWasReset);
pw.println(prefix + "affinity=" + affinity);
pw.println(prefix + "intent=" + intent);
pw.println(prefix + "affinityIntent=" + affinityIntent);
pw.println(prefix + "origActivity=" + origActivity);
pw.println(prefix + "lastActiveTime=" + lastActiveTime
+" (inactive for " + (getInactiveDuration()/1000) + "s)");
| long | getInactiveDuration()
return android.os.SystemClock.elapsedRealtime() - lastActiveTime;
| void | setIntent(android.content.Intent _intent, android.content.pm.ActivityInfo info)
if (info.targetActivity == null) {
intent = _intent;
realActivity = _intent != null ? _intent.getComponent() : null;
origActivity = null;
} else {
ComponentName targetComponent = new ComponentName(
info.packageName, info.targetActivity);
if (_intent != null) {
Intent targetIntent = new Intent(_intent);
targetIntent.setComponent(targetComponent);
intent = targetIntent;
realActivity = targetComponent;
origActivity = _intent.getComponent();
} else {
intent = null;
realActivity = targetComponent;
origActivity = new ComponentName(info.packageName, info.name);
}
}
if (intent != null &&
(intent.getFlags()&Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED) != 0) {
// Once we are set to an Intent with this flag, we count this
// task as having a true root activity.
rootWasReset = true;
}
| public java.lang.String | toString()
return "Task{" + taskId + " "
+ (affinity != null ? affinity
: (intent != null ? intent.getComponent().flattenToShortString()
: affinityIntent != null ? affinityIntent.getComponent().flattenToShortString() : "??"))
+ "}";
| void | touchActiveTime()
lastActiveTime = android.os.SystemClock.elapsedRealtime();
|
|