Dispatch organized tasks info chagne when committing visibility

Make sure to traverse all organized parent tasks when dispatching task
info chagned after committing activity visibility. Remove queuing task
info changed in Task#ensureActivitiesVisible because it is not actually
committing activity visibility.

Fix: 200139190
Test: pass existing tests
Test: manual check the repro steps in bug
Change-Id: I869dfa85c4e488e20b4dc7aa1a77d258362081b6
This commit is contained in:
Jerry Chang
2021-09-28 18:21:48 +08:00
parent f950ee685f
commit 49abc7fa2d
2 changed files with 4 additions and 9 deletions

View File

@@ -4938,11 +4938,10 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
// dispatchTaskInfoChangedIfNeeded() right after ActivityRecord#setVisibility() can report
// the stale visible state, because the state will be updated after the app transition.
// So tries to report the actual visible state again where the state is changed.
if (!mTaskSupervisor.inActivityVisibilityUpdate()) {
final Task task = getOrganizedTask();
if (task != null) {
task.dispatchTaskInfoChangedIfNeeded(false /* force */);
}
Task task = getOrganizedTask();
while (task != null) {
task.dispatchTaskInfoChangedIfNeeded(false /* force */);
task = task.getParent().asTask();
}
ProtoLog.v(WM_DEBUG_APP_TRANSITIONS,
"commitVisibility: %s: visible=%b mVisibleRequested=%b", this,

View File

@@ -4809,10 +4809,6 @@ class Task extends TaskFragment {
notifyClients);
}, true /* traverseTopToBottom */);
// Notify WM shell that task visibilities may have changed
forAllTasks(task -> task.dispatchTaskInfoChangedIfNeeded(/* force */ false),
true /* traverseTopToBottom */);
if (mTranslucentActivityWaiting != null &&
mUndrawnActivitiesBelowTopTranslucent.isEmpty()) {
// Nothing is getting drawn or everything was already visible, don't wait for