summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWale Ogunwale <ogunwale@google.com>2015-08-06 17:16:02 -0700
committerWale Ogunwale <ogunwale@google.com>2015-08-07 00:26:01 +0000
commita0ef49c44f7d845e3465591ea977d0c9996c4e5e (patch)
tree45b8646ac4e8be84ab37f54a9671ec67f8a33a7c
parent8f26616d1a1765267d6a3ba09e7ac1bd6edeca67 (diff)
downloadframeworks_base-a0ef49c44f7d845e3465591ea977d0c9996c4e5e.zip
frameworks_base-a0ef49c44f7d845e3465591ea977d0c9996c4e5e.tar.gz
frameworks_base-a0ef49c44f7d845e3465591ea977d0c9996c4e5e.tar.bz2
Look for recent tasks in live stacks.
It is possible for a tasks not to have been saved to the persisted recent list yet for various reasons. This causes some external calls to fail when they are trying to do an operation on a task with a given id. We now use the stack supervisor look-up for a task id that checks everywhere a task might be including live stack. It this fails then the task truly doesn't exist. Bug: 22924782 Change-Id: I57c3df41d0b4f3ee3c5ae9b7d01eeb2b352062b4
-rw-r--r--services/core/java/com/android/server/am/ActivityManagerService.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index b8d32c3..39e3b46 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -4118,7 +4118,7 @@ public final class ActivityManagerService extends ActivityManagerNative
final Intent intent;
final int userId;
synchronized (this) {
- task = mRecentTasks.taskForIdLocked(taskId);
+ task = mStackSupervisor.anyTaskForIdLocked(taskId);
if (task == null) {
throw new IllegalArgumentException("Task " + taskId + " not found.");
}
@@ -8805,7 +8805,7 @@ public final class ActivityManagerService extends ActivityManagerNative
final long origId = Binder.clearCallingIdentity();
try {
int taskId = ActivityRecord.getTaskForActivityLocked(token, !nonRoot);
- final TaskRecord task = mRecentTasks.taskForIdLocked(taskId);
+ final TaskRecord task = mStackSupervisor.anyTaskForIdLocked(taskId);
if (task != null) {
if (mStackSupervisor.isLockedTask(task)) {
mStackSupervisor.showLockTaskToast();
@@ -20573,7 +20573,7 @@ public final class ActivityManagerService extends ActivityManagerNative
synchronized (ActivityManagerService.this) {
long origId = Binder.clearCallingIdentity();
try {
- TaskRecord tr = mRecentTasks.taskForIdLocked(mTaskId);
+ TaskRecord tr = mStackSupervisor.anyTaskForIdLocked(mTaskId);
if (tr == null) {
throw new IllegalArgumentException("Unable to find task ID " + mTaskId);
}
@@ -20600,7 +20600,7 @@ public final class ActivityManagerService extends ActivityManagerNative
TaskRecord tr;
IApplicationThread appThread;
synchronized (ActivityManagerService.this) {
- tr = mRecentTasks.taskForIdLocked(mTaskId);
+ tr = mStackSupervisor.anyTaskForIdLocked(mTaskId);
if (tr == null) {
throw new IllegalArgumentException("Unable to find task ID " + mTaskId);
}
@@ -20621,7 +20621,7 @@ public final class ActivityManagerService extends ActivityManagerNative
synchronized (ActivityManagerService.this) {
long origId = Binder.clearCallingIdentity();
try {
- TaskRecord tr = mRecentTasks.taskForIdLocked(mTaskId);
+ TaskRecord tr = mStackSupervisor.anyTaskForIdLocked(mTaskId);
if (tr == null) {
throw new IllegalArgumentException("Unable to find task ID " + mTaskId);
}