summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Wale Ogunwale <ogunwale@google.com> 2017-05-01 07:41:08 -0700
committer Wale Ogunwale <ogunwale@google.com> 2017-05-01 13:39:01 -0700
commitea3d3fdefd7a89f2e93ec692298660ce63aff4b2 (patch)
tree62af4aacf78709df59b8af618a1235aed71d87ea
parent030107f0bdebb1d52838baab87b5d0146e6586b4 (diff)
Don't relaunch activity in TaskRecord.size if caller deferResume
If the caller of TaskRecord.resize() requested resume to be deferred, then we also don't want to ensure configuration on the top activity in the task as that can lead to a re-launch. In this case the caller will handle things. Test: manual Change-Id: I247c4409d4bd19c8ae801e1720aa415d55395201 Fixes: 37767027
-rw-r--r--services/core/java/com/android/server/am/ActivityRecord.java3
-rw-r--r--services/core/java/com/android/server/am/TaskRecord.java12
2 files changed, 7 insertions, 8 deletions
diff --git a/services/core/java/com/android/server/am/ActivityRecord.java b/services/core/java/com/android/server/am/ActivityRecord.java
index 158175f4b0d9..7bd8b0b3209a 100644
--- a/services/core/java/com/android/server/am/ActivityRecord.java
+++ b/services/core/java/com/android/server/am/ActivityRecord.java
@@ -2328,6 +2328,9 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo
return true;
}
+ // TODO: We should add ActivityRecord.shouldBeVisible() that checks if the activity should
+ // be visible based on the stack, task, and lockscreen state and use that here instead. The
+ // method should be based on the logic in ActivityStack.ensureActivitiesVisibleLocked().
// Skip updating configuration for activity is a stack that shouldn't be visible.
if (stack.shouldBeVisible(null /* starting */) == STACK_INVISIBLE) {
if (DEBUG_SWITCH || DEBUG_CONFIGURATION) Slog.v(TAG_CONFIGURATION,
diff --git a/services/core/java/com/android/server/am/TaskRecord.java b/services/core/java/com/android/server/am/TaskRecord.java
index 056fec526502..2b4cb8dbefd8 100644
--- a/services/core/java/com/android/server/am/TaskRecord.java
+++ b/services/core/java/com/android/server/am/TaskRecord.java
@@ -550,15 +550,11 @@ final class TaskRecord extends ConfigurationContainer implements TaskWindowConta
boolean kept = true;
if (updatedConfig) {
final ActivityRecord r = topRunningActivityLocked();
- if (r != null) {
+ if (r != null && !deferResume) {
kept = r.ensureActivityConfigurationLocked(0 /* globalChanges */, preserveWindow);
-
- if (!deferResume) {
- // All other activities must be made visible with their correct configuration.
- mService.mStackSupervisor.ensureActivitiesVisibleLocked(r, 0, !PRESERVE_WINDOWS);
- if (!kept) {
- mService.mStackSupervisor.resumeFocusedStackTopActivityLocked();
- }
+ mService.mStackSupervisor.ensureActivitiesVisibleLocked(r, 0, !PRESERVE_WINDOWS);
+ if (!kept) {
+ mService.mStackSupervisor.resumeFocusedStackTopActivityLocked();
}
}
}