Methods Summary |
---|
static void | activityResumedLocked(android.os.IBinder token)
final ActivityRecord r = ActivityRecord.forToken(token);
if (DEBUG_SAVED_STATE) Slog.i(TAG, "Resumed activity; dropping state of: " + r);
r.icicle = null;
r.haveState = false;
|
private static java.lang.String | activityTypeToString(int type)
switch (type) {
case APPLICATION_ACTIVITY_TYPE: return "APPLICATION_ACTIVITY_TYPE";
case HOME_ACTIVITY_TYPE: return "HOME_ACTIVITY_TYPE";
case RECENTS_ACTIVITY_TYPE: return "RECENTS_ACTIVITY_TYPE";
default: return Integer.toString(type);
}
|
void | addNewIntentLocked(com.android.internal.content.ReferrerIntent intent)
if (newIntents == null) {
newIntents = new ArrayList<>();
}
newIntents.add(intent);
|
void | addResultLocked(com.android.server.am.ActivityRecord from, java.lang.String resultWho, int requestCode, int resultCode, android.content.Intent resultData)
ActivityResult r = new ActivityResult(from, resultWho,
requestCode, resultCode, resultData);
if (results == null) {
results = new ArrayList<ResultInfo>();
}
results.add(r);
|
void | applyOptionsLocked()
if (pendingOptions != null
&& pendingOptions.getAnimationType() != ActivityOptions.ANIM_SCENE_TRANSITION) {
final int animationType = pendingOptions.getAnimationType();
switch (animationType) {
case ActivityOptions.ANIM_CUSTOM:
service.mWindowManager.overridePendingAppTransition(
pendingOptions.getPackageName(),
pendingOptions.getCustomEnterResId(),
pendingOptions.getCustomExitResId(),
pendingOptions.getOnAnimationStartListener());
break;
case ActivityOptions.ANIM_SCALE_UP:
service.mWindowManager.overridePendingAppTransitionScaleUp(
pendingOptions.getStartX(), pendingOptions.getStartY(),
pendingOptions.getWidth(), pendingOptions.getHeight());
if (intent.getSourceBounds() == null) {
intent.setSourceBounds(new Rect(pendingOptions.getStartX(),
pendingOptions.getStartY(),
pendingOptions.getStartX()+pendingOptions.getWidth(),
pendingOptions.getStartY()+pendingOptions.getHeight()));
}
break;
case ActivityOptions.ANIM_THUMBNAIL_SCALE_UP:
case ActivityOptions.ANIM_THUMBNAIL_SCALE_DOWN:
boolean scaleUp = (animationType == ActivityOptions.ANIM_THUMBNAIL_SCALE_UP);
service.mWindowManager.overridePendingAppTransitionThumb(
pendingOptions.getThumbnail(),
pendingOptions.getStartX(), pendingOptions.getStartY(),
pendingOptions.getOnAnimationStartListener(),
scaleUp);
if (intent.getSourceBounds() == null) {
intent.setSourceBounds(new Rect(pendingOptions.getStartX(),
pendingOptions.getStartY(),
pendingOptions.getStartX()
+ pendingOptions.getThumbnail().getWidth(),
pendingOptions.getStartY()
+ pendingOptions.getThumbnail().getHeight()));
}
break;
case ActivityOptions.ANIM_THUMBNAIL_ASPECT_SCALE_UP:
case ActivityOptions.ANIM_THUMBNAIL_ASPECT_SCALE_DOWN:
service.mWindowManager.overridePendingAppTransitionAspectScaledThumb(
pendingOptions.getThumbnail(),
pendingOptions.getStartX(), pendingOptions.getStartY(),
pendingOptions.getWidth(), pendingOptions.getHeight(),
pendingOptions.getOnAnimationStartListener(),
(animationType == ActivityOptions.ANIM_THUMBNAIL_ASPECT_SCALE_UP));
if (intent.getSourceBounds() == null) {
intent.setSourceBounds(new Rect(pendingOptions.getStartX(),
pendingOptions.getStartY(),
pendingOptions.getStartX() + pendingOptions.getWidth(),
pendingOptions.getStartY() + pendingOptions.getHeight()));
}
break;
default:
Slog.e(TAG, "applyOptionsLocked: Unknown animationType=" + animationType);
break;
}
pendingOptions = null;
}
|
boolean | changeWindowTranslucency(boolean toOpaque)
if (fullscreen == toOpaque) {
return false;
}
// Keep track of the number of fullscreen activities in this task.
task.numFullscreen += toOpaque ? +1 : -1;
fullscreen = toOpaque;
return true;
|
void | clearOptionsLocked()
if (pendingOptions != null) {
pendingOptions.abort();
pendingOptions = null;
}
|
boolean | continueLaunchTickingLocked()
if (launchTickTime != 0) {
final ActivityStack stack = task.stack;
Message msg = stack.mHandler.obtainMessage(ActivityStack.LAUNCH_TICK_MSG, this);
stack.mHandler.removeMessages(ActivityStack.LAUNCH_TICK_MSG);
stack.mHandler.sendMessageDelayed(msg, ActivityStack.LAUNCH_TICK);
return true;
}
return false;
|
private static java.lang.String | createImageFilename(long createTime, int taskId)
return String.valueOf(taskId) + ACTIVITY_ICON_SUFFIX + createTime +
TaskPersister.IMAGE_EXTENSION;
|
final void | deliverNewIntentLocked(int callingUid, android.content.Intent intent, java.lang.String referrer)Deliver a new Intent to an existing activity, so that its onNewIntent()
method will be called at the proper time.
// The activity now gets access to the data associated with this Intent.
service.grantUriPermissionFromIntentLocked(callingUid, packageName,
intent, getUriPermissionsLocked(), userId);
// We want to immediately deliver the intent to the activity if
// it is currently the top resumed activity... however, if the
// device is sleeping, then all activities are stopped, so in that
// case we will deliver it if this is the current top activity on its
// stack.
final ReferrerIntent rintent = new ReferrerIntent(intent, referrer);
boolean unsent = true;
if ((state == ActivityState.RESUMED || (service.isSleeping()
&& task.stack.topRunningActivityLocked(null) == this))
&& app != null && app.thread != null) {
try {
ArrayList<ReferrerIntent> ar = new ArrayList<>(1);
ar.add(rintent);
app.thread.scheduleNewIntent(ar, appToken);
unsent = false;
} catch (RemoteException e) {
Slog.w(ActivityManagerService.TAG,
"Exception thrown sending new intent to " + this, e);
} catch (NullPointerException e) {
Slog.w(ActivityManagerService.TAG,
"Exception thrown sending new intent to " + this, e);
}
}
if (unsent) {
addNewIntentLocked(rintent);
}
|
void | dump(java.io.PrintWriter pw, java.lang.String prefix) // this activity is actively being launched with
// ActivityOptions.setLaunchTaskBehind, will be cleared once launch is completed.
final long now = SystemClock.uptimeMillis();
pw.print(prefix); pw.print("packageName="); pw.print(packageName);
pw.print(" processName="); pw.println(processName);
pw.print(prefix); pw.print("launchedFromUid="); pw.print(launchedFromUid);
pw.print(" launchedFromPackage="); pw.print(launchedFromPackage);
pw.print(" userId="); pw.println(userId);
pw.print(prefix); pw.print("app="); pw.println(app);
pw.print(prefix); pw.println(intent.toInsecureStringWithClip());
pw.print(prefix); pw.print("frontOfTask="); pw.print(frontOfTask);
pw.print(" task="); pw.println(task);
pw.print(prefix); pw.print("taskAffinity="); pw.println(taskAffinity);
pw.print(prefix); pw.print("realActivity=");
pw.println(realActivity.flattenToShortString());
if (appInfo != null) {
pw.print(prefix); pw.print("baseDir="); pw.println(appInfo.sourceDir);
if (!Objects.equals(appInfo.sourceDir, appInfo.publicSourceDir)) {
pw.print(prefix); pw.print("resDir="); pw.println(appInfo.publicSourceDir);
}
pw.print(prefix); pw.print("dataDir="); pw.println(appInfo.dataDir);
}
pw.print(prefix); pw.print("stateNotNeeded="); pw.print(stateNotNeeded);
pw.print(" componentSpecified="); pw.print(componentSpecified);
pw.print(" mActivityType="); pw.println(mActivityType);
pw.print(prefix); pw.print("compat="); pw.print(compat);
pw.print(" labelRes=0x"); pw.print(Integer.toHexString(labelRes));
pw.print(" icon=0x"); pw.print(Integer.toHexString(icon));
pw.print(" theme=0x"); pw.println(Integer.toHexString(theme));
pw.print(prefix); pw.print("config="); pw.println(configuration);
if (resultTo != null || resultWho != null) {
pw.print(prefix); pw.print("resultTo="); pw.print(resultTo);
pw.print(" resultWho="); pw.print(resultWho);
pw.print(" resultCode="); pw.println(requestCode);
}
if (taskDescription != null) {
final String iconFilename = taskDescription.getIconFilename();
if (iconFilename != null || taskDescription.getLabel() != null ||
taskDescription.getPrimaryColor() != 0) {
pw.print(prefix); pw.print("taskDescription:");
pw.print(" iconFilename="); pw.print(taskDescription.getIconFilename());
pw.print(" label=\""); pw.print(taskDescription.getLabel());
pw.print("\"");
pw.print(" color=");
pw.println(Integer.toHexString(taskDescription.getPrimaryColor()));
}
if (iconFilename == null && taskDescription.getIcon() != null) {
pw.print(prefix); pw.println("taskDescription contains Bitmap");
}
}
if (results != null) {
pw.print(prefix); pw.print("results="); pw.println(results);
}
if (pendingResults != null && pendingResults.size() > 0) {
pw.print(prefix); pw.println("Pending Results:");
for (WeakReference<PendingIntentRecord> wpir : pendingResults) {
PendingIntentRecord pir = wpir != null ? wpir.get() : null;
pw.print(prefix); pw.print(" - ");
if (pir == null) {
pw.println("null");
} else {
pw.println(pir);
pir.dump(pw, prefix + " ");
}
}
}
if (newIntents != null && newIntents.size() > 0) {
pw.print(prefix); pw.println("Pending New Intents:");
for (int i=0; i<newIntents.size(); i++) {
Intent intent = newIntents.get(i);
pw.print(prefix); pw.print(" - ");
if (intent == null) {
pw.println("null");
} else {
pw.println(intent.toShortString(false, true, false, true));
}
}
}
if (pendingOptions != null) {
pw.print(prefix); pw.print("pendingOptions="); pw.println(pendingOptions);
}
if (uriPermissions != null) {
uriPermissions.dump(pw, prefix);
}
pw.print(prefix); pw.print("launchFailed="); pw.print(launchFailed);
pw.print(" launchCount="); pw.print(launchCount);
pw.print(" lastLaunchTime=");
if (lastLaunchTime == 0) pw.print("0");
else TimeUtils.formatDuration(lastLaunchTime, now, pw);
pw.println();
pw.print(prefix); pw.print("haveState="); pw.print(haveState);
pw.print(" icicle="); pw.println(icicle);
pw.print(prefix); pw.print("state="); pw.print(state);
pw.print(" stopped="); pw.print(stopped);
pw.print(" delayedResume="); pw.print(delayedResume);
pw.print(" finishing="); pw.println(finishing);
pw.print(prefix); pw.print("keysPaused="); pw.print(keysPaused);
pw.print(" inHistory="); pw.print(inHistory);
pw.print(" visible="); pw.print(visible);
pw.print(" sleeping="); pw.print(sleeping);
pw.print(" idle="); pw.println(idle);
pw.print(prefix); pw.print("fullscreen="); pw.print(fullscreen);
pw.print(" noDisplay="); pw.print(noDisplay);
pw.print(" immersive="); pw.print(immersive);
pw.print(" launchMode="); pw.println(launchMode);
pw.print(prefix); pw.print("frozenBeforeDestroy="); pw.print(frozenBeforeDestroy);
pw.print(" forceNewConfig="); pw.println(forceNewConfig);
pw.print(prefix); pw.print("mActivityType=");
pw.println(activityTypeToString(mActivityType));
if (displayStartTime != 0 || startTime != 0) {
pw.print(prefix); pw.print("displayStartTime=");
if (displayStartTime == 0) pw.print("0");
else TimeUtils.formatDuration(displayStartTime, now, pw);
pw.print(" startTime=");
if (startTime == 0) pw.print("0");
else TimeUtils.formatDuration(startTime, now, pw);
pw.println();
}
if (lastVisibleTime != 0 || waitingVisible || nowVisible) {
pw.print(prefix); pw.print("waitingVisible="); pw.print(waitingVisible);
pw.print(" nowVisible="); pw.print(nowVisible);
pw.print(" lastVisibleTime=");
if (lastVisibleTime == 0) pw.print("0");
else TimeUtils.formatDuration(lastVisibleTime, now, pw);
pw.println();
}
if (configDestroy || configChangeFlags != 0) {
pw.print(prefix); pw.print("configDestroy="); pw.print(configDestroy);
pw.print(" configChangeFlags=");
pw.println(Integer.toHexString(configChangeFlags));
}
if (connections != null) {
pw.print(prefix); pw.print("connections="); pw.println(connections);
}
|
void | finishLaunchTickingLocked()
launchTickTime = 0;
task.stack.mHandler.removeMessages(ActivityStack.LAUNCH_TICK_MSG);
|
static com.android.server.am.ActivityRecord | forToken(android.os.IBinder token)
try {
return token != null ? ((Token)token).weakActivity.get() : null;
} catch (ClassCastException e) {
Slog.w(ActivityManagerService.TAG, "Bad activity token: " + token, e);
return null;
}
|
public long | getKeyDispatchingTimeout()Returns the key dispatching timeout for this application token.
synchronized(service) {
ActivityRecord r = getWaitingHistoryRecordLocked();
return ActivityManagerService.getInputDispatchingTimeoutLocked(r);
}
|
android.app.ActivityOptions | getOptionsForTargetActivityLocked()
return pendingOptions != null ? pendingOptions.forTargetActivity() : null;
|
static ActivityStack | getStackLocked(android.os.IBinder token)
final ActivityRecord r = ActivityRecord.isInStackLocked(token);
if (r != null) {
return r.task.stack;
}
return null;
|
static int | getTaskForActivityLocked(android.os.IBinder token, boolean onlyRoot)
final ActivityRecord r = ActivityRecord.forToken(token);
if (r == null) {
return INVALID_TASK_ID;
}
final TaskRecord task = r.task;
final int activityNdx = task.mActivities.indexOf(r);
if (activityNdx < 0 || (onlyRoot && activityNdx > task.findEffectiveRootIndex())) {
return INVALID_TASK_ID;
}
return task.taskId;
|
UriPermissionOwner | getUriPermissionsLocked()
if (uriPermissions == null) {
uriPermissions = new UriPermissionOwner(service, this);
}
return uriPermissions;
|
private com.android.server.am.ActivityRecord | getWaitingHistoryRecordLocked()
// First find the real culprit... if we are waiting
// for another app to start, then we have paused dispatching
// for this activity.
ActivityRecord r = this;
if (r.waitingVisible) {
final ActivityStack stack = mStackSupervisor.getFocusedStack();
// Hmmm, who might we be waiting for?
r = stack.mResumedActivity;
if (r == null) {
r = stack.mPausingActivity;
}
// Both of those null? Fall back to 'this' again
if (r == null) {
r = this;
}
}
return r;
|
boolean | isApplicationActivity()
return mActivityType == APPLICATION_ACTIVITY_TYPE;
|
final boolean | isDestroyable()
if (finishing || app == null || state == ActivityState.DESTROYING
|| state == ActivityState.DESTROYED) {
// This would be redundant.
return false;
}
if (task == null || task.stack == null || this == task.stack.mResumedActivity
|| this == task.stack.mPausingActivity || !haveState || !stopped) {
// We're not ready for this kind of thing.
return false;
}
if (visible) {
// The user would notice this!
return false;
}
return true;
|
boolean | isHomeActivity()
return mActivityType == HOME_ACTIVITY_TYPE;
|
boolean | isInHistory()
return inHistory;
|
static com.android.server.am.ActivityRecord | isInStackLocked(android.os.IBinder token)
final ActivityRecord r = ActivityRecord.forToken(token);
if (r != null) {
return r.task.stack.isInStackLocked(token);
}
return null;
|
public boolean | isInterestingToUserLocked()This method will return true if the activity is either visible, is becoming visible, is
currently pausing, or is resumed.
return visible || nowVisible || state == ActivityState.PAUSING ||
state == ActivityState.RESUMED;
|
boolean | isNotResolverActivity()
return !ResolverActivity.class.getName().equals(realActivity.getClassName());
|
boolean | isPersistable()
return (info.persistableMode == ActivityInfo.PERSIST_ROOT_ONLY ||
info.persistableMode == ActivityInfo.PERSIST_ACROSS_REBOOTS) &&
(intent == null ||
(intent.getFlags() & Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) == 0);
|
boolean | isRecentsActivity()
return mActivityType == RECENTS_ACTIVITY_TYPE;
|
public boolean | keyDispatchingTimedOut(java.lang.String reason)
ActivityRecord r;
ProcessRecord anrApp;
synchronized(service) {
r = getWaitingHistoryRecordLocked();
anrApp = r != null ? r.app : null;
}
return service.inputDispatchingTimedOut(anrApp, r, this, false, reason);
|
void | makeFinishing()
if (!finishing) {
if (this == task.stack.getVisibleBehindActivity()) {
// A finishing activity should not remain as visible in the background
mStackSupervisor.requestVisibleBehindLocked(this, false);
}
finishing = true;
if (stopped) {
clearOptionsLocked();
}
}
|
public boolean | mayFreezeScreenLocked(ProcessRecord app)
// Only freeze the screen if this activity is currently attached to
// an application, and that application is not blocked or unresponding.
// In any other case, we can't count on getting the screen unfrozen,
// so it is best to leave as-is.
return app != null && !app.crashing && !app.notResponding;
|
void | pauseKeyDispatchingLocked()
if (!keysPaused) {
keysPaused = true;
service.mWindowManager.pauseKeyDispatching(appToken);
}
|
void | putInHistory()
if (!inHistory) {
inHistory = true;
}
|
void | removeResultsLocked(com.android.server.am.ActivityRecord from, java.lang.String resultWho, int requestCode)
if (results != null) {
for (int i=results.size()-1; i>=0; i--) {
ActivityResult r = (ActivityResult)results.get(i);
if (r.mFrom != from) continue;
if (r.mResultWho == null) {
if (resultWho != null) continue;
} else {
if (!r.mResultWho.equals(resultWho)) continue;
}
if (r.mRequestCode != requestCode) continue;
results.remove(i);
}
}
|
void | removeUriPermissionsLocked()
if (uriPermissions != null) {
uriPermissions.removeUriPermissionsLocked();
uriPermissions = null;
}
|
public void | reportFullyDrawnLocked()
final long curTime = SystemClock.uptimeMillis();
if (displayStartTime != 0) {
reportLaunchTimeLocked(curTime);
}
if (fullyDrawnStartTime != 0) {
final ActivityStack stack = task.stack;
final long thisTime = curTime - fullyDrawnStartTime;
final long totalTime = stack.mFullyDrawnStartTime != 0
? (curTime - stack.mFullyDrawnStartTime) : thisTime;
if (ActivityManagerService.SHOW_ACTIVITY_START_TIME) {
Trace.asyncTraceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER, "drawing", 0);
EventLog.writeEvent(EventLogTags.AM_ACTIVITY_FULLY_DRAWN_TIME,
userId, System.identityHashCode(this), shortComponentName,
thisTime, totalTime);
StringBuilder sb = service.mStringBuilder;
sb.setLength(0);
sb.append("Fully drawn ");
sb.append(shortComponentName);
sb.append(": ");
TimeUtils.formatDuration(thisTime, sb);
if (thisTime != totalTime) {
sb.append(" (total ");
TimeUtils.formatDuration(totalTime, sb);
sb.append(")");
}
Log.i(ActivityManagerService.TAG, sb.toString());
}
if (totalTime > 0) {
//service.mUsageStatsService.noteFullyDrawnTime(realActivity, (int) totalTime);
}
fullyDrawnStartTime = 0;
stack.mFullyDrawnStartTime = 0;
}
|
private void | reportLaunchTimeLocked(long curTime)
final ActivityStack stack = task.stack;
final long thisTime = curTime - displayStartTime;
final long totalTime = stack.mLaunchStartTime != 0
? (curTime - stack.mLaunchStartTime) : thisTime;
if (ActivityManagerService.SHOW_ACTIVITY_START_TIME) {
Trace.asyncTraceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER, "launching", 0);
EventLog.writeEvent(EventLogTags.AM_ACTIVITY_LAUNCH_TIME,
userId, System.identityHashCode(this), shortComponentName,
thisTime, totalTime);
StringBuilder sb = service.mStringBuilder;
sb.setLength(0);
sb.append("Displayed ");
sb.append(shortComponentName);
sb.append(": ");
TimeUtils.formatDuration(thisTime, sb);
if (thisTime != totalTime) {
sb.append(" (total ");
TimeUtils.formatDuration(totalTime, sb);
sb.append(")");
}
Log.i(ActivityManagerService.TAG, sb.toString());
}
mStackSupervisor.reportActivityLaunchedLocked(false, this, thisTime, totalTime);
if (totalTime > 0) {
//service.mUsageStatsService.noteLaunchTime(realActivity, (int)totalTime);
}
displayStartTime = 0;
stack.mLaunchStartTime = 0;
|
static com.android.server.am.ActivityRecord | restoreFromXml(org.xmlpull.v1.XmlPullParser in, ActivityStackSupervisor stackSupervisor)
Intent intent = null;
PersistableBundle persistentState = null;
int launchedFromUid = 0;
String launchedFromPackage = null;
String resolvedType = null;
boolean componentSpecified = false;
int userId = 0;
long createTime = -1;
final int outerDepth = in.getDepth();
TaskDescription taskDescription = new TaskDescription();
for (int attrNdx = in.getAttributeCount() - 1; attrNdx >= 0; --attrNdx) {
final String attrName = in.getAttributeName(attrNdx);
final String attrValue = in.getAttributeValue(attrNdx);
if (DEBUG_PERSISTER || DEBUG_RESTORER) Slog.d(TaskPersister.TAG,
"ActivityRecord: attribute name=" + attrName + " value=" + attrValue);
if (ATTR_ID.equals(attrName)) {
createTime = Long.valueOf(attrValue);
} else if (ATTR_LAUNCHEDFROMUID.equals(attrName)) {
launchedFromUid = Integer.valueOf(attrValue);
} else if (ATTR_LAUNCHEDFROMPACKAGE.equals(attrName)) {
launchedFromPackage = attrValue;
} else if (ATTR_RESOLVEDTYPE.equals(attrName)) {
resolvedType = attrValue;
} else if (ATTR_COMPONENTSPECIFIED.equals(attrName)) {
componentSpecified = Boolean.valueOf(attrValue);
} else if (ATTR_USERID.equals(attrName)) {
userId = Integer.valueOf(attrValue);
} else if (attrName.startsWith(TaskDescription.ATTR_TASKDESCRIPTION_PREFIX)) {
taskDescription.restoreFromXml(attrName, attrValue);
} else {
Log.d(TAG, "Unknown ActivityRecord attribute=" + attrName);
}
}
int event;
while (((event = in.next()) != XmlPullParser.END_DOCUMENT) &&
(event != XmlPullParser.END_TAG || in.getDepth() < outerDepth)) {
if (event == XmlPullParser.START_TAG) {
final String name = in.getName();
if (DEBUG_PERSISTER || DEBUG_RESTORER)
Slog.d(TaskPersister.TAG, "ActivityRecord: START_TAG name=" + name);
if (TAG_INTENT.equals(name)) {
intent = Intent.restoreFromXml(in);
if (DEBUG_PERSISTER || DEBUG_RESTORER)
Slog.d(TaskPersister.TAG, "ActivityRecord: intent=" + intent);
} else if (TAG_PERSISTABLEBUNDLE.equals(name)) {
persistentState = PersistableBundle.restoreFromXml(in);
if (DEBUG_PERSISTER || DEBUG_RESTORER) Slog.d(TaskPersister.TAG,
"ActivityRecord: persistentState=" + persistentState);
} else {
Slog.w(TAG, "restoreActivity: unexpected name=" + name);
XmlUtils.skipCurrentTag(in);
}
}
}
if (intent == null) {
throw new XmlPullParserException("restoreActivity error intent=" + intent);
}
final ActivityManagerService service = stackSupervisor.mService;
final ActivityInfo aInfo = stackSupervisor.resolveActivity(intent, resolvedType, 0, null,
userId);
if (aInfo == null) {
throw new XmlPullParserException("restoreActivity resolver error. Intent=" + intent +
" resolvedType=" + resolvedType);
}
final ActivityRecord r = new ActivityRecord(service, /*caller*/null, launchedFromUid,
launchedFromPackage, intent, resolvedType, aInfo, service.getConfiguration(),
null, null, 0, componentSpecified, stackSupervisor, null, null);
r.persistentState = persistentState;
r.taskDescription = taskDescription;
r.createTime = createTime;
return r;
|
void | resumeKeyDispatchingLocked()
if (keysPaused) {
keysPaused = false;
service.mWindowManager.resumeKeyDispatching(appToken);
}
|
void | saveToXml(org.xmlpull.v1.XmlSerializer out)
out.attribute(null, ATTR_ID, String.valueOf(createTime));
out.attribute(null, ATTR_LAUNCHEDFROMUID, String.valueOf(launchedFromUid));
if (launchedFromPackage != null) {
out.attribute(null, ATTR_LAUNCHEDFROMPACKAGE, launchedFromPackage);
}
if (resolvedType != null) {
out.attribute(null, ATTR_RESOLVEDTYPE, resolvedType);
}
out.attribute(null, ATTR_COMPONENTSPECIFIED, String.valueOf(componentSpecified));
out.attribute(null, ATTR_USERID, String.valueOf(userId));
if (taskDescription != null) {
taskDescription.saveToXml(out);
}
out.startTag(null, TAG_INTENT);
intent.saveToXml(out);
out.endTag(null, TAG_INTENT);
if (isPersistable() && persistentState != null) {
out.startTag(null, TAG_PERSISTABLEBUNDLE);
persistentState.saveToXml(out);
out.endTag(null, TAG_PERSISTABLEBUNDLE);
}
|
public void | setSleeping(boolean _sleeping)
if (sleeping == _sleeping) {
return;
}
if (app != null && app.thread != null) {
try {
app.thread.scheduleSleeping(appToken, _sleeping);
if (_sleeping && !mStackSupervisor.mGoingToSleepActivities.contains(this)) {
mStackSupervisor.mGoingToSleepActivities.add(this);
}
sleeping = _sleeping;
} catch (RemoteException e) {
Slog.w(TAG, "Exception thrown when sleeping: " + intent.getComponent(), e);
}
}
|
void | setTask(TaskRecord newTask, TaskRecord taskToAffiliateWith)
if (task != null && task.removeActivity(this)) {
if (task != newTask) {
task.stack.removeTask(task, "setTask");
} else {
Slog.d(TAG, "!!! REMOVE THIS LOG !!! setTask: nearly removed stack=" +
(newTask == null ? null : newTask.stack));
}
}
task = newTask;
setTaskToAffiliateWith(taskToAffiliateWith);
|
void | setTaskDescription(android.app.ActivityManager.TaskDescription _taskDescription)
Bitmap icon;
if (_taskDescription.getIconFilename() == null &&
(icon = _taskDescription.getIcon()) != null) {
final String iconFilename = createImageFilename(createTime, task.taskId);
mStackSupervisor.mService.mTaskPersister.saveImage(icon, iconFilename);
_taskDescription.setIconFilename(iconFilename);
}
taskDescription = _taskDescription;
|
void | setTaskToAffiliateWith(TaskRecord taskToAffiliateWith)
if (taskToAffiliateWith != null &&
launchMode != ActivityInfo.LAUNCH_SINGLE_INSTANCE &&
launchMode != ActivityInfo.LAUNCH_SINGLE_TASK) {
task.setTaskToAffiliateWith(taskToAffiliateWith);
}
|
public void | startFreezingScreenLocked(ProcessRecord app, int configChanges)
if (mayFreezeScreenLocked(app)) {
service.mWindowManager.startAppFreezingScreen(appToken, configChanges);
}
|
void | startLaunchTickingLocked()
if (ActivityManagerService.IS_USER_BUILD) {
return;
}
if (launchTickTime == 0) {
launchTickTime = SystemClock.uptimeMillis();
continueLaunchTickingLocked();
}
|
public void | stopFreezingScreenLocked(boolean force)
if (force || frozenBeforeDestroy) {
frozenBeforeDestroy = false;
service.mWindowManager.stopAppFreezingScreen(appToken, force);
}
|
void | takeFromHistory()
if (inHistory) {
inHistory = false;
if (task != null && !finishing) {
task = null;
}
clearOptionsLocked();
}
|
android.app.ActivityOptions | takeOptionsLocked()
ActivityOptions opts = pendingOptions;
pendingOptions = null;
return opts;
|
public java.lang.String | toString()
if (stringName != null) {
return stringName + " t" + (task == null ? INVALID_TASK_ID : task.taskId) +
(finishing ? " f}" : "}");
}
StringBuilder sb = new StringBuilder(128);
sb.append("ActivityRecord{");
sb.append(Integer.toHexString(System.identityHashCode(this)));
sb.append(" u");
sb.append(userId);
sb.append(' ");
sb.append(intent.getComponent().flattenToShortString());
stringName = sb.toString();
return toString();
|
void | updateOptionsLocked(android.os.Bundle options)
if (options != null) {
if (pendingOptions != null) {
pendingOptions.abort();
}
pendingOptions = new ActivityOptions(options);
}
|
void | updateOptionsLocked(android.app.ActivityOptions options)
if (options != null) {
if (pendingOptions != null) {
pendingOptions.abort();
}
pendingOptions = options;
}
|
void | updateThumbnailLocked(android.graphics.Bitmap newThumbnail, java.lang.CharSequence description)
if (newThumbnail != null) {
if (ActivityManagerService.DEBUG_THUMBNAILS) Slog.i(ActivityManagerService.TAG,
"Setting thumbnail of " + this + " to " + newThumbnail);
boolean thumbnailUpdated = task.setLastThumbnail(newThumbnail);
if (thumbnailUpdated && isPersistable()) {
mStackSupervisor.mService.notifyTaskPersisterLocked(task, false);
}
}
task.lastDescription = description;
|
public void | windowsDrawn()
synchronized(service) {
if (displayStartTime != 0) {
reportLaunchTimeLocked(SystemClock.uptimeMillis());
}
mStackSupervisor.sendWaitingVisibleReportLocked(this);
startTime = 0;
finishLaunchTickingLocked();
if (task != null) {
task.hasBeenVisible = true;
}
}
|
public void | windowsGone()
if (ActivityManagerService.DEBUG_SWITCH) Log.v(
ActivityManagerService.TAG, "windowsGone(): " + this);
nowVisible = false;
|
public void | windowsVisible()
synchronized(service) {
mStackSupervisor.reportActivityVisibleLocked(this);
if (ActivityManagerService.DEBUG_SWITCH) Log.v(
ActivityManagerService.TAG, "windowsVisible(): " + this);
if (!nowVisible) {
nowVisible = true;
lastVisibleTime = SystemClock.uptimeMillis();
if (!idle) {
// Instead of doing the full stop routine here, let's just
// hide any activities we now can, and let them stop when
// the normal idle happens.
mStackSupervisor.processStoppingActivitiesLocked(false);
} else {
// If this activity was already idle, then we now need to
// make sure we perform the full stop of any activities
// that are waiting to do so. This is because we won't
// do that while they are still waiting for this one to
// become visible.
final int N = mStackSupervisor.mWaitingVisibleActivities.size();
if (N > 0) {
for (int i=0; i<N; i++) {
ActivityRecord r = mStackSupervisor.mWaitingVisibleActivities.get(i);
r.waitingVisible = false;
if (ActivityManagerService.DEBUG_SWITCH) Log.v(
ActivityManagerService.TAG,
"Was waiting for visible: " + r);
}
mStackSupervisor.mWaitingVisibleActivities.clear();
mStackSupervisor.scheduleIdleLocked();
}
}
service.scheduleAppGcsLocked();
}
}
|