am 70273e05: Merge "Stop activity onVisibleBehindCanceled()" into lmp-mr1-dev

* commit '70273e05b26f671dcec9ff1aa4bafabb5e407895':
  Stop activity onVisibleBehindCanceled()
This commit is contained in:
Wale Ogunwale
2014-11-20 01:49:37 +00:00
committed by Android Git Automerger
2 changed files with 4 additions and 3 deletions

View File

@@ -6260,7 +6260,7 @@ public final class ActivityManagerService extends ActivityManagerNative
synchronized (this) { synchronized (this) {
ActivityStack stack = ActivityRecord.getStackLocked(token); ActivityStack stack = ActivityRecord.getStackLocked(token);
if (stack != null) { if (stack != null) {
stack.backgroundResourcesReleased(token); stack.backgroundResourcesReleased();
} }
} }
} finally { } finally {

View File

@@ -3317,17 +3317,18 @@ final class ActivityStack {
mHandler.sendEmptyMessageDelayed(RELEASE_BACKGROUND_RESOURCES_TIMEOUT_MSG, 500); mHandler.sendEmptyMessageDelayed(RELEASE_BACKGROUND_RESOURCES_TIMEOUT_MSG, 500);
} else { } else {
Slog.e(TAG, "releaseBackgroundResources: activity " + r + " no longer running"); Slog.e(TAG, "releaseBackgroundResources: activity " + r + " no longer running");
backgroundResourcesReleased(r.appToken); backgroundResourcesReleased();
} }
} }
} }
final void backgroundResourcesReleased(IBinder token) { final void backgroundResourcesReleased() {
mHandler.removeMessages(RELEASE_BACKGROUND_RESOURCES_TIMEOUT_MSG); mHandler.removeMessages(RELEASE_BACKGROUND_RESOURCES_TIMEOUT_MSG);
final ActivityRecord r = getVisibleBehindActivity(); final ActivityRecord r = getVisibleBehindActivity();
if (r != null) { if (r != null) {
mStackSupervisor.mStoppingActivities.add(r); mStackSupervisor.mStoppingActivities.add(r);
setVisibleBehindActivity(null); setVisibleBehindActivity(null);
mStackSupervisor.scheduleIdleTimeoutLocked(null);
} }
mStackSupervisor.resumeTopActivitiesLocked(); mStackSupervisor.resumeTopActivitiesLocked();
} }