Loading services/core/java/com/android/server/wm/ActivityRecord.java +1 −3 Original line number Diff line number Diff line Loading @@ -7941,9 +7941,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A } // This is necessary in order to avoid going into size compat mode when the orientation // change request comes from the app if (mWmService.mLetterboxConfiguration .isSizeCompatModeDisabledAfterOrientationChangeFromApp() && getRequestedConfigurationOrientation(false, requestedOrientation) if (getRequestedConfigurationOrientation(false, requestedOrientation) != getRequestedConfigurationOrientation(false /*forDisplay */)) { // Do not change the requested configuration now, because this will be done when setting // the orientation below with the new mCompatDisplayInsets Loading services/core/java/com/android/server/wm/LetterboxConfiguration.java +0 −14 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ package com.android.server.wm; import static com.android.server.wm.ActivityTaskManagerDebugConfig.TAG_ATM; import static com.android.server.wm.ActivityTaskManagerDebugConfig.TAG_WITH_CLASS_NAME; import static com.android.server.wm.LetterboxConfigurationDeviceConfig.KEY_ALLOW_IGNORE_ORIENTATION_REQUEST; import static com.android.server.wm.LetterboxConfigurationDeviceConfig.KEY_DISABLE_SIZE_COMPAT_MODE_AFTER_ORIENTATION_CHANGE_FROM_APP; import static com.android.server.wm.LetterboxConfigurationDeviceConfig.KEY_ENABLE_CAMERA_COMPAT_TREATMENT; import static com.android.server.wm.LetterboxConfigurationDeviceConfig.KEY_ENABLE_COMPAT_FAKE_FOCUS; import static com.android.server.wm.LetterboxConfigurationDeviceConfig.KEY_ENABLE_DISPLAY_ROTATION_IMMERSIVE_APP_COMPAT_POLICY; Loading Loading @@ -330,9 +329,6 @@ final class LetterboxConfiguration { mDeviceConfig.updateFlagActiveStatus( /* isActive */ mTranslucentLetterboxingEnabled, /* key */ KEY_ENABLE_LETTERBOX_TRANSLUCENT_ACTIVITY); mDeviceConfig.updateFlagActiveStatus( /* isActive */ true, /* key */ KEY_DISABLE_SIZE_COMPAT_MODE_AFTER_ORIENTATION_CHANGE_FROM_APP); mLetterboxConfigurationPersister = letterboxConfigurationPersister; mLetterboxConfigurationPersister.start(); Loading @@ -346,16 +342,6 @@ final class LetterboxConfiguration { return mDeviceConfig.getFlag(KEY_ALLOW_IGNORE_ORIENTATION_REQUEST); } /** * Whether size compat mode is disabled after an orientation change request comes from the app. * This value is controlled via {@link android.provider.DeviceConfig}. */ // TODO(b/270356567) Clean up this flag boolean isSizeCompatModeDisabledAfterOrientationChangeFromApp() { return mDeviceConfig.getFlag( KEY_DISABLE_SIZE_COMPAT_MODE_AFTER_ORIENTATION_CHANGE_FROM_APP); } /** * Overrides the aspect ratio of letterbox for fixed orientation. If given value is <= {@link * #MIN_FIXED_ORIENTATION_LETTERBOX_ASPECT_RATIO}, both it and a value of {@link Loading services/core/java/com/android/server/wm/LetterboxConfigurationDeviceConfig.java +1 −18 Original line number Diff line number Diff line Loading @@ -52,11 +52,6 @@ final class LetterboxConfigurationDeviceConfig private static final boolean DEFAULT_VALUE_ENABLE_LETTERBOX_TRANSLUCENT_ACTIVITY = true; static final String KEY_DISABLE_SIZE_COMPAT_MODE_AFTER_ORIENTATION_CHANGE_FROM_APP = "disable_size_compat_mode_after_orientation_change_from_app"; private static final boolean DEFAULT_VALUE_DISABLE_SIZE_COMPAT_MODE_AFTER_ORIENTATION_CHANGE_FROM_APP = true; @VisibleForTesting static final Map<String, Boolean> sKeyToDefaultValueMap = Map.of( KEY_ENABLE_CAMERA_COMPAT_TREATMENT, Loading @@ -68,9 +63,7 @@ final class LetterboxConfigurationDeviceConfig KEY_ENABLE_COMPAT_FAKE_FOCUS, DEFAULT_VALUE_ENABLE_COMPAT_FAKE_FOCUS, KEY_ENABLE_LETTERBOX_TRANSLUCENT_ACTIVITY, DEFAULT_VALUE_ENABLE_LETTERBOX_TRANSLUCENT_ACTIVITY, KEY_DISABLE_SIZE_COMPAT_MODE_AFTER_ORIENTATION_CHANGE_FROM_APP, DEFAULT_VALUE_DISABLE_SIZE_COMPAT_MODE_AFTER_ORIENTATION_CHANGE_FROM_APP DEFAULT_VALUE_ENABLE_LETTERBOX_TRANSLUCENT_ACTIVITY ); // Whether camera compatibility treatment is enabled. Loading Loading @@ -99,10 +92,6 @@ final class LetterboxConfigurationDeviceConfig private boolean mIsTranslucentLetterboxingAllowed = DEFAULT_VALUE_ENABLE_LETTERBOX_TRANSLUCENT_ACTIVITY; // Whether size compat mode is disabled after an orientation change request comes from the app private boolean mIsSizeCompatModeDisabledAfterOrientationChangeFromApp = DEFAULT_VALUE_DISABLE_SIZE_COMPAT_MODE_AFTER_ORIENTATION_CHANGE_FROM_APP; // Set of active device configs that need to be updated in // DeviceConfig.OnPropertiesChangedListener#onPropertiesChanged. private final ArraySet<String> mActiveDeviceConfigsSet = new ArraySet<>(); Loading Loading @@ -152,8 +141,6 @@ final class LetterboxConfigurationDeviceConfig return mIsCompatFakeFocusAllowed; case KEY_ENABLE_LETTERBOX_TRANSLUCENT_ACTIVITY: return mIsTranslucentLetterboxingAllowed; case KEY_DISABLE_SIZE_COMPAT_MODE_AFTER_ORIENTATION_CHANGE_FROM_APP: return mIsSizeCompatModeDisabledAfterOrientationChangeFromApp; default: throw new AssertionError("Unexpected flag name: " + key); } Loading Loading @@ -181,10 +168,6 @@ final class LetterboxConfigurationDeviceConfig case KEY_ENABLE_LETTERBOX_TRANSLUCENT_ACTIVITY: mIsTranslucentLetterboxingAllowed = getDeviceConfig(key, defaultValue); break; case KEY_DISABLE_SIZE_COMPAT_MODE_AFTER_ORIENTATION_CHANGE_FROM_APP: mIsSizeCompatModeDisabledAfterOrientationChangeFromApp = getDeviceConfig(key, defaultValue); break; default: throw new AssertionError("Unexpected flag name: " + key); } Loading Loading
services/core/java/com/android/server/wm/ActivityRecord.java +1 −3 Original line number Diff line number Diff line Loading @@ -7941,9 +7941,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A } // This is necessary in order to avoid going into size compat mode when the orientation // change request comes from the app if (mWmService.mLetterboxConfiguration .isSizeCompatModeDisabledAfterOrientationChangeFromApp() && getRequestedConfigurationOrientation(false, requestedOrientation) if (getRequestedConfigurationOrientation(false, requestedOrientation) != getRequestedConfigurationOrientation(false /*forDisplay */)) { // Do not change the requested configuration now, because this will be done when setting // the orientation below with the new mCompatDisplayInsets Loading
services/core/java/com/android/server/wm/LetterboxConfiguration.java +0 −14 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ package com.android.server.wm; import static com.android.server.wm.ActivityTaskManagerDebugConfig.TAG_ATM; import static com.android.server.wm.ActivityTaskManagerDebugConfig.TAG_WITH_CLASS_NAME; import static com.android.server.wm.LetterboxConfigurationDeviceConfig.KEY_ALLOW_IGNORE_ORIENTATION_REQUEST; import static com.android.server.wm.LetterboxConfigurationDeviceConfig.KEY_DISABLE_SIZE_COMPAT_MODE_AFTER_ORIENTATION_CHANGE_FROM_APP; import static com.android.server.wm.LetterboxConfigurationDeviceConfig.KEY_ENABLE_CAMERA_COMPAT_TREATMENT; import static com.android.server.wm.LetterboxConfigurationDeviceConfig.KEY_ENABLE_COMPAT_FAKE_FOCUS; import static com.android.server.wm.LetterboxConfigurationDeviceConfig.KEY_ENABLE_DISPLAY_ROTATION_IMMERSIVE_APP_COMPAT_POLICY; Loading Loading @@ -330,9 +329,6 @@ final class LetterboxConfiguration { mDeviceConfig.updateFlagActiveStatus( /* isActive */ mTranslucentLetterboxingEnabled, /* key */ KEY_ENABLE_LETTERBOX_TRANSLUCENT_ACTIVITY); mDeviceConfig.updateFlagActiveStatus( /* isActive */ true, /* key */ KEY_DISABLE_SIZE_COMPAT_MODE_AFTER_ORIENTATION_CHANGE_FROM_APP); mLetterboxConfigurationPersister = letterboxConfigurationPersister; mLetterboxConfigurationPersister.start(); Loading @@ -346,16 +342,6 @@ final class LetterboxConfiguration { return mDeviceConfig.getFlag(KEY_ALLOW_IGNORE_ORIENTATION_REQUEST); } /** * Whether size compat mode is disabled after an orientation change request comes from the app. * This value is controlled via {@link android.provider.DeviceConfig}. */ // TODO(b/270356567) Clean up this flag boolean isSizeCompatModeDisabledAfterOrientationChangeFromApp() { return mDeviceConfig.getFlag( KEY_DISABLE_SIZE_COMPAT_MODE_AFTER_ORIENTATION_CHANGE_FROM_APP); } /** * Overrides the aspect ratio of letterbox for fixed orientation. If given value is <= {@link * #MIN_FIXED_ORIENTATION_LETTERBOX_ASPECT_RATIO}, both it and a value of {@link Loading
services/core/java/com/android/server/wm/LetterboxConfigurationDeviceConfig.java +1 −18 Original line number Diff line number Diff line Loading @@ -52,11 +52,6 @@ final class LetterboxConfigurationDeviceConfig private static final boolean DEFAULT_VALUE_ENABLE_LETTERBOX_TRANSLUCENT_ACTIVITY = true; static final String KEY_DISABLE_SIZE_COMPAT_MODE_AFTER_ORIENTATION_CHANGE_FROM_APP = "disable_size_compat_mode_after_orientation_change_from_app"; private static final boolean DEFAULT_VALUE_DISABLE_SIZE_COMPAT_MODE_AFTER_ORIENTATION_CHANGE_FROM_APP = true; @VisibleForTesting static final Map<String, Boolean> sKeyToDefaultValueMap = Map.of( KEY_ENABLE_CAMERA_COMPAT_TREATMENT, Loading @@ -68,9 +63,7 @@ final class LetterboxConfigurationDeviceConfig KEY_ENABLE_COMPAT_FAKE_FOCUS, DEFAULT_VALUE_ENABLE_COMPAT_FAKE_FOCUS, KEY_ENABLE_LETTERBOX_TRANSLUCENT_ACTIVITY, DEFAULT_VALUE_ENABLE_LETTERBOX_TRANSLUCENT_ACTIVITY, KEY_DISABLE_SIZE_COMPAT_MODE_AFTER_ORIENTATION_CHANGE_FROM_APP, DEFAULT_VALUE_DISABLE_SIZE_COMPAT_MODE_AFTER_ORIENTATION_CHANGE_FROM_APP DEFAULT_VALUE_ENABLE_LETTERBOX_TRANSLUCENT_ACTIVITY ); // Whether camera compatibility treatment is enabled. Loading Loading @@ -99,10 +92,6 @@ final class LetterboxConfigurationDeviceConfig private boolean mIsTranslucentLetterboxingAllowed = DEFAULT_VALUE_ENABLE_LETTERBOX_TRANSLUCENT_ACTIVITY; // Whether size compat mode is disabled after an orientation change request comes from the app private boolean mIsSizeCompatModeDisabledAfterOrientationChangeFromApp = DEFAULT_VALUE_DISABLE_SIZE_COMPAT_MODE_AFTER_ORIENTATION_CHANGE_FROM_APP; // Set of active device configs that need to be updated in // DeviceConfig.OnPropertiesChangedListener#onPropertiesChanged. private final ArraySet<String> mActiveDeviceConfigsSet = new ArraySet<>(); Loading Loading @@ -152,8 +141,6 @@ final class LetterboxConfigurationDeviceConfig return mIsCompatFakeFocusAllowed; case KEY_ENABLE_LETTERBOX_TRANSLUCENT_ACTIVITY: return mIsTranslucentLetterboxingAllowed; case KEY_DISABLE_SIZE_COMPAT_MODE_AFTER_ORIENTATION_CHANGE_FROM_APP: return mIsSizeCompatModeDisabledAfterOrientationChangeFromApp; default: throw new AssertionError("Unexpected flag name: " + key); } Loading Loading @@ -181,10 +168,6 @@ final class LetterboxConfigurationDeviceConfig case KEY_ENABLE_LETTERBOX_TRANSLUCENT_ACTIVITY: mIsTranslucentLetterboxingAllowed = getDeviceConfig(key, defaultValue); break; case KEY_DISABLE_SIZE_COMPAT_MODE_AFTER_ORIENTATION_CHANGE_FROM_APP: mIsSizeCompatModeDisabledAfterOrientationChangeFromApp = getDeviceConfig(key, defaultValue); break; default: throw new AssertionError("Unexpected flag name: " + key); } Loading