am 2cc8043c: Merge "If task isn\'t found in recents, look in the stacks." into lmp-mr1-dev
automerge: d476bfd * commit 'd476bfd01b7443d63381141d14a20833421d8657': If task isn't found in recents, look in the stacks.
This commit is contained in:
committed by
android-build-merger
commit
f82ab735a7
@@ -8160,6 +8160,16 @@ public final class ActivityManagerService extends ActivityManagerNative
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private TaskRecord taskForIdLocked(int id) {
|
||||||
|
final TaskRecord task = recentTaskForIdLocked(id);
|
||||||
|
if (task != null) {
|
||||||
|
return task;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Don't give up. Sometimes it just hasn't made it to recents yet.
|
||||||
|
return mStackSupervisor.anyTaskForIdLocked(id);
|
||||||
|
}
|
||||||
|
|
||||||
private TaskRecord recentTaskForIdLocked(int id) {
|
private TaskRecord recentTaskForIdLocked(int id) {
|
||||||
final int N = mRecentTasks.size();
|
final int N = mRecentTasks.size();
|
||||||
for (int i=0; i<N; i++) {
|
for (int i=0; i<N; i++) {
|
||||||
@@ -8380,7 +8390,7 @@ public final class ActivityManagerService extends ActivityManagerNative
|
|||||||
* @return Returns true if the given task was found and removed.
|
* @return Returns true if the given task was found and removed.
|
||||||
*/
|
*/
|
||||||
private boolean removeTaskByIdLocked(int taskId, boolean killProcess) {
|
private boolean removeTaskByIdLocked(int taskId, boolean killProcess) {
|
||||||
TaskRecord tr = recentTaskForIdLocked(taskId);
|
TaskRecord tr = taskForIdLocked(taskId);
|
||||||
if (tr != null) {
|
if (tr != null) {
|
||||||
tr.removeTaskActivitiesLocked();
|
tr.removeTaskActivitiesLocked();
|
||||||
cleanUpRemovedTaskLocked(tr, killProcess);
|
cleanUpRemovedTaskLocked(tr, killProcess);
|
||||||
@@ -8455,7 +8465,7 @@ public final class ActivityManagerService extends ActivityManagerNative
|
|||||||
"moveTaskToBack()");
|
"moveTaskToBack()");
|
||||||
|
|
||||||
synchronized(this) {
|
synchronized(this) {
|
||||||
TaskRecord tr = recentTaskForIdLocked(taskId);
|
TaskRecord tr = taskForIdLocked(taskId);
|
||||||
if (tr != null) {
|
if (tr != null) {
|
||||||
if (tr == mStackSupervisor.mLockTaskModeTask) {
|
if (tr == mStackSupervisor.mLockTaskModeTask) {
|
||||||
mStackSupervisor.showLockTaskToast();
|
mStackSupervisor.showLockTaskToast();
|
||||||
@@ -8647,7 +8657,7 @@ public final class ActivityManagerService extends ActivityManagerNative
|
|||||||
long ident = Binder.clearCallingIdentity();
|
long ident = Binder.clearCallingIdentity();
|
||||||
try {
|
try {
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
TaskRecord tr = recentTaskForIdLocked(taskId);
|
TaskRecord tr = taskForIdLocked(taskId);
|
||||||
return tr != null && tr.stack != null && tr.stack.isHomeStack();
|
return tr != null && tr.stack != null && tr.stack.isHomeStack();
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -1643,8 +1643,8 @@ final class ActivityStack {
|
|||||||
boolean dontWaitForPause = (next.info.flags&ActivityInfo.FLAG_RESUME_WHILE_PAUSING) != 0;
|
boolean dontWaitForPause = (next.info.flags&ActivityInfo.FLAG_RESUME_WHILE_PAUSING) != 0;
|
||||||
boolean pausing = mStackSupervisor.pauseBackStacks(userLeaving, true, dontWaitForPause);
|
boolean pausing = mStackSupervisor.pauseBackStacks(userLeaving, true, dontWaitForPause);
|
||||||
if (mResumedActivity != null) {
|
if (mResumedActivity != null) {
|
||||||
pausing |= startPausingLocked(userLeaving, false, true, dontWaitForPause);
|
|
||||||
if (DEBUG_STATES) Slog.d(TAG, "resumeTopActivityLocked: Pausing " + mResumedActivity);
|
if (DEBUG_STATES) Slog.d(TAG, "resumeTopActivityLocked: Pausing " + mResumedActivity);
|
||||||
|
pausing |= startPausingLocked(userLeaving, false, true, dontWaitForPause);
|
||||||
}
|
}
|
||||||
if (pausing) {
|
if (pausing) {
|
||||||
if (DEBUG_SWITCH || DEBUG_STATES) Slog.v(TAG,
|
if (DEBUG_SWITCH || DEBUG_STATES) Slog.v(TAG,
|
||||||
|
|||||||
Reference in New Issue
Block a user