summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorWale Ogunwale <ogunwale@google.com>2015-03-10 14:55:31 -0700
committerWale Ogunwale <ogunwale@google.com>2015-03-10 15:05:01 -0700
commit7a7bf5ea48b12f044c591fb03ed3e58acd28ceb7 (patch)
treea38ef7f5b836bde4d9c460439d53a7ab9190e841 /services
parent7d6bc4f022dba5583a29a40d9b43207cf7067692 (diff)
downloadframeworks_base-7a7bf5ea48b12f044c591fb03ed3e58acd28ceb7.zip
frameworks_base-7a7bf5ea48b12f044c591fb03ed3e58acd28ceb7.tar.gz
frameworks_base-7a7bf5ea48b12f044c591fb03ed3e58acd28ceb7.tar.bz2
Revert "Remove activity and window stacks when last task is removed."
This reverts commit 0f95e3f0753508344b198c0a76afb892df514f52. Bug: 19644506 Bug: 19083170 Change-Id: I2eb2a0400be58fe2c5d48a4b68368725e98aaf6f
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/am/ActivityManagerService.java8
-rw-r--r--services/core/java/com/android/server/am/ActivityStack.java2
-rw-r--r--services/core/java/com/android/server/am/ActivityStackSupervisor.java29
3 files changed, 13 insertions, 26 deletions
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 46f07cc..b9bb8d0 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -7878,7 +7878,7 @@ public final class ActivityManagerService extends ActivityManagerNative
synchronized (this) {
enforceCallingPermission(android.Manifest.permission.READ_FRAME_BUFFER,
"getTaskThumbnail()");
- TaskRecord tr = mStackSupervisor.anyTaskForIdLocked(id, false);
+ TaskRecord tr = mStackSupervisor.anyTaskForIdLocked(id);
if (tr != null) {
return tr.getTaskThumbnailLocked();
}
@@ -7991,7 +7991,7 @@ public final class ActivityManagerService extends ActivityManagerNative
@Override
public void setTaskResizeable(int taskId, boolean resizeable) {
synchronized (this) {
- TaskRecord task = mStackSupervisor.anyTaskForIdLocked(taskId, false);
+ TaskRecord task = mStackSupervisor.anyTaskForIdLocked(taskId);
if (task == null) {
Slog.w(TAG, "setTaskResizeable: taskId=" + taskId + " not found");
return;
@@ -8158,7 +8158,7 @@ public final class ActivityManagerService extends ActivityManagerNative
* @return Returns true if the given task was found and removed.
*/
private boolean removeTaskByIdLocked(int taskId, boolean killProcess) {
- TaskRecord tr = mStackSupervisor.anyTaskForIdLocked(taskId, false);
+ TaskRecord tr = mStackSupervisor.anyTaskForIdLocked(taskId);
if (tr != null) {
tr.removeTaskActivitiesLocked();
cleanUpRemovedTaskLocked(tr, killProcess);
@@ -8411,7 +8411,7 @@ public final class ActivityManagerService extends ActivityManagerNative
long ident = Binder.clearCallingIdentity();
try {
synchronized (this) {
- TaskRecord tr = mStackSupervisor.anyTaskForIdLocked(taskId, false);
+ TaskRecord tr = mStackSupervisor.anyTaskForIdLocked(taskId);
return tr != null && tr.stack != null && tr.stack.isHomeStack();
}
} finally {
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java
index 40a8b86..a1d99e3 100644
--- a/services/core/java/com/android/server/am/ActivityStack.java
+++ b/services/core/java/com/android/server/am/ActivityStack.java
@@ -4247,8 +4247,6 @@ final class ActivityStack {
mActivityContainer.onTaskListEmptyLocked();
}
}
-
- task.stack = null;
}
TaskRecord createTaskRecord(int taskId, ActivityInfo info, Intent intent,
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
index 8b95ae8..62db20a 100644
--- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
@@ -471,16 +471,6 @@ public final class ActivityStackSupervisor implements DisplayListener {
}
TaskRecord anyTaskForIdLocked(int id) {
- return anyTaskForIdLocked(id, true);
- }
-
- /**
- * Returns a {@link TaskRecord} for the input id if available. Null otherwise.
- * @param id Id of the task we would like returned.
- * @param restoreFromRecents If the id was not in the active list, but was found in recents,
- * restore the task from recents to the active list.
- */
- TaskRecord anyTaskForIdLocked(int id, boolean restoreFromRecents) {
int numDisplays = mActivityDisplays.size();
for (int displayNdx = 0; displayNdx < numDisplays; ++displayNdx) {
ArrayList<ActivityStack> stacks = mActivityDisplays.valueAt(displayNdx).mStacks;
@@ -501,10 +491,6 @@ public final class ActivityStackSupervisor implements DisplayListener {
return null;
}
- if (!restoreFromRecents) {
- return task;
- }
-
if (!restoreRecentTaskLocked(task)) {
if (DEBUG_RECENTS) Slog.w(TAG, "Couldn't restore task id=" + id + " found in recents");
return null;
@@ -539,7 +525,7 @@ public final class ActivityStackSupervisor implements DisplayListener {
if (mCurTaskId <= 0) {
mCurTaskId = 1;
}
- } while (anyTaskForIdLocked(mCurTaskId, false) != null);
+ } while (anyTaskForIdLocked(mCurTaskId) != null);
return mCurTaskId;
}
@@ -2731,7 +2717,7 @@ public final class ActivityStackSupervisor implements DisplayListener {
final ArrayList<ActivityStack> homeDisplayStacks = mHomeStack.mStacks;
for (int stackNdx = homeDisplayStacks.size() - 1; stackNdx >= 0; --stackNdx) {
final ActivityStack tmpStack = homeDisplayStacks.get(stackNdx);
- if (!tmpStack.isHomeStack() && tmpStack.mFullscreen) {
+ if (!tmpStack.isHomeStack()) {
stack = tmpStack;
break;
}
@@ -3993,10 +3979,6 @@ public final class ActivityStackSupervisor implements DisplayListener {
}
void onTaskListEmptyLocked() {
- mHandler.removeMessages(CONTAINER_TASK_LIST_EMPTY_TIMEOUT, this);
- detachLocked();
- deleteActivityContainer(this);
- mHandler.obtainMessage(CONTAINER_CALLBACK_TASK_LIST_EMPTY, this).sendToTarget();
}
@Override
@@ -4085,6 +4067,13 @@ public final class ActivityStackSupervisor implements DisplayListener {
return false;
}
+ void onTaskListEmptyLocked() {
+ mHandler.removeMessages(CONTAINER_TASK_LIST_EMPTY_TIMEOUT, this);
+ detachLocked();
+ deleteActivityContainer(this);
+ mHandler.obtainMessage(CONTAINER_CALLBACK_TASK_LIST_EMPTY, this).sendToTarget();
+ }
+
private void setSurfaceIfReadyLocked() {
if (DEBUG_STACK) Slog.v(TAG, "setSurfaceIfReadyLocked: mDrawn=" + mDrawn +
" mContainerState=" + mContainerState + " mSurface=" + mSurface);