FileDocCategorySizeDatePackage
TaskRecord.javaAPI DocAndroid 1.5 API4338Wed May 06 22:42:00 BST 2009com.android.server.am

TaskRecord

public 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
Constructors Summary
TaskRecord(int _taskId, android.content.pm.ActivityInfo info, android.content.Intent _intent, boolean _clearOnBackground)

        taskId = _taskId;
        affinity = info.taskAffinity;
        clearOnBackground = _clearOnBackground;
        setIntent(_intent, info);
    
Methods Summary
voiddump(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)");
    
longgetInactiveDuration()

        return android.os.SystemClock.elapsedRealtime() - lastActiveTime;
    
voidsetIntent(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.StringtoString()

        return "Task{" + taskId + " "
                + (affinity != null ? affinity
                        : (intent != null ? intent.getComponent().flattenToShortString()
                                : affinityIntent != null ? affinityIntent.getComponent().flattenToShortString() : "??"))
                + "}";
    
voidtouchActiveTime()

        lastActiveTime = android.os.SystemClock.elapsedRealtime();