summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorWale Ogunwale <ogunwale@google.com>2015-03-10 22:36:40 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-03-10 22:36:41 +0000
commite5afd8293d0caedb816b16cbb68bced1fd2e7736 (patch)
tree3037b1b5aa881726021425e3de41e35485867b03 /services
parentc4be90872685c4507b516e96040d57a796792165 (diff)
parent7a7bf5ea48b12f044c591fb03ed3e58acd28ceb7 (diff)
downloadframeworks_base-e5afd8293d0caedb816b16cbb68bced1fd2e7736.zip
frameworks_base-e5afd8293d0caedb816b16cbb68bced1fd2e7736.tar.gz
frameworks_base-e5afd8293d0caedb816b16cbb68bced1fd2e7736.tar.bz2
Merge "Revert "Remove activity and window stacks when last task is removed.""
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);