Fix dismissing activity getting relaunch signal while dismissing split

When applying dismissing split window container transaction to reparent
child tasks out of split roots, it'll schedule update multi window mode
change.

Prevent sending relaunch signal to the dismissing activity which won't
be visible after split dismissed by considering visibility while
applying new configuration for multi window mode udpate.

Fix: 194646075
Test: enter split screen, drag divider bar to dismiss split, checked
      the dismissing activity won't get relaunch signal.
Change-Id: Ifb40fcbf89abaaa1bfb76e5018b31fc95778925d
This commit is contained in:
Jerry Chang
2021-09-01 10:33:02 +08:00
parent 77b764bcd7
commit bf31a0641f

View File

@@ -1354,14 +1354,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
updatePictureInPictureMode(null, false);
} else {
mLastReportedMultiWindowMode = inMultiWindowMode;
// If the activity is in stopping or stopped state, for instance, it's in the
// split screen task and not the top one, the last configuration it should keep
// is the one before multi-window mode change.
final State state = getState();
if (state != STOPPED && state != STOPPING) {
ensureActivityConfiguration(0 /* globalChanges */, PRESERVE_WINDOWS,
true /* ignoreVisibility */);
}
ensureActivityConfiguration(0 /* globalChanges */, PRESERVE_WINDOWS,
false /* ignoreVisibility */);
}
}
}