Do not clear activity type in clearSizeCompatMode

The activity type was set when adding the activity to a task, so
reseting activity type in clearSizeCompatMode might leaving it undefined
because the activity is already added to a task.

Fix: 267559999
Test: atest SizeCompatTests
Change-Id: I611a5e98124937b7056b02cdedfe3884f99c3218
This commit is contained in:
Jerry Chang
2023-03-03 04:48:39 +00:00
parent aeec834753
commit a64494059c

View File

@@ -8035,7 +8035,13 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
}
// Clear config override in #updateCompatDisplayInsets().
onRequestedOverrideConfigurationChanged(EMPTY);
final int activityType = getActivityType();
final Configuration overrideConfig = getRequestedOverrideConfiguration();
overrideConfig.unset();
// Keep the activity type which was set when attaching to a task to prevent leaving it
// undefined.
overrideConfig.windowConfiguration.setActivityType(activityType);
onRequestedOverrideConfigurationChanged(overrideConfig);
}
@Override