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
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java index 9944f12..c8f9db7 100644 --- a/services/core/java/com/android/server/wm/ActivityRecord.java +++ b/services/core/java/com/android/server/wm/ActivityRecord.java
@@ -8035,7 +8035,13 @@ } // 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