Merge "Only restore to mLastNonFullscreenBounds if requested bounds unset" into tm-qpr-dev

This commit is contained in:
Jorge Gil
2022-06-17 17:45:14 +00:00
committed by Android (Google) Code Review

View File

@@ -1858,6 +1858,11 @@ class Task extends TaskFragment {
if (getRequestedOverrideWindowingMode() == WINDOWING_MODE_UNDEFINED) {
nextPersistTaskBounds = newParentConfig.windowConfiguration.persistTaskBounds();
}
// Only restore to the last non-fullscreen bounds when the requested override bounds
// have not been explicitly set already.
nextPersistTaskBounds &=
(getRequestedOverrideConfiguration().windowConfiguration.getBounds() == null
|| getRequestedOverrideConfiguration().windowConfiguration.getBounds().isEmpty());
if (!prevPersistTaskBounds && nextPersistTaskBounds
&& mLastNonFullscreenBounds != null && !mLastNonFullscreenBounds.isEmpty()) {
// Bypass onRequestedOverrideConfigurationChanged here to avoid infinite loop.