Merge "Don't relaunch activity in TaskRecord.size if caller deferResume" into oc-dev

This commit is contained in:
TreeHugger Robot
2017-05-02 01:55:15 +00:00
committed by Android (Google) Code Review
2 changed files with 7 additions and 8 deletions

View File

@@ -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,

View File

@@ -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();
}
}
}