Loading services/core/java/com/android/server/wm/ActivityRecord.java +6 −4 Original line number Diff line number Diff line Loading @@ -3238,10 +3238,12 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A } final boolean compatEnabled = isLargeScreen && Flags.universalResizableByDefault() && appInfo.isChangeEnabled(ActivityInfo.UNIVERSAL_RESIZABLE_BY_DEFAULT); if (!compatEnabled && !wms.mConstants.mIgnoreActivityOrientationRequest) { return false; } if (wms.mConstants.isPackageOptOutIgnoreActivityOrientationRequest(appInfo.packageName)) { final boolean configEnabled = (isLargeScreen ? wms.mConstants.mIgnoreActivityOrientationRequestLargeScreen : wms.mConstants.mIgnoreActivityOrientationRequestSmallScreen) && !wms.mConstants.isPackageOptOutIgnoreActivityOrientationRequest( appInfo.packageName); if (!compatEnabled && !configEnabled) { return false; } if (forActivity) { Loading services/core/java/com/android/server/wm/WindowManagerConstants.java +19 −7 Original line number Diff line number Diff line Loading @@ -36,7 +36,15 @@ import java.util.concurrent.Executor; */ final class WindowManagerConstants { /** The orientation of activity will be always "unspecified" except for game apps. */ /** * The orientation of activity will be always "unspecified" except for game apps. * <p>Possible values: * <ul> * <li>false: applies to no apps (default)</li> * <li>true: applies to all apps</li> * <li>large: applies to all apps but only on large screens</li> * </ul> */ private static final String KEY_IGNORE_ACTIVITY_ORIENTATION_REQUEST = "ignore_activity_orientation_request"; Loading Loading @@ -69,7 +77,8 @@ final class WindowManagerConstants { boolean mSystemGestureExcludedByPreQStickyImmersive; /** @see #KEY_IGNORE_ACTIVITY_ORIENTATION_REQUEST */ boolean mIgnoreActivityOrientationRequest; boolean mIgnoreActivityOrientationRequestLargeScreen; boolean mIgnoreActivityOrientationRequestSmallScreen; /** @see #KEY_OPT_OUT_IGNORE_ACTIVITY_ORIENTATION_REQUEST_LIST */ private ArraySet<String> mOptOutIgnoreActivityOrientationRequestPackages; Loading Loading @@ -177,9 +186,12 @@ final class WindowManagerConstants { } private void updateIgnoreActivityOrientationRequest() { mIgnoreActivityOrientationRequest = mDeviceConfig.getBoolean( final String value = mDeviceConfig.getProperty( DeviceConfig.NAMESPACE_WINDOW_MANAGER, KEY_IGNORE_ACTIVITY_ORIENTATION_REQUEST, false); KEY_IGNORE_ACTIVITY_ORIENTATION_REQUEST); mIgnoreActivityOrientationRequestSmallScreen = Boolean.parseBoolean(value); mIgnoreActivityOrientationRequestLargeScreen = mIgnoreActivityOrientationRequestSmallScreen || ("large".equals(value)); } private void updateOptOutIgnoreActivityOrientationRequestList() { Loading @@ -196,8 +208,7 @@ final class WindowManagerConstants { } boolean isPackageOptOutIgnoreActivityOrientationRequest(String packageName) { return mIgnoreActivityOrientationRequest && mOptOutIgnoreActivityOrientationRequestPackages != null return mOptOutIgnoreActivityOrientationRequestPackages != null && mOptOutIgnoreActivityOrientationRequestPackages.contains(packageName); } Loading @@ -211,7 +222,8 @@ final class WindowManagerConstants { pw.print(" "); pw.print(KEY_SYSTEM_GESTURES_EXCLUDED_BY_PRE_Q_STICKY_IMMERSIVE); pw.print("="); pw.println(mSystemGestureExcludedByPreQStickyImmersive); pw.print(" "); pw.print(KEY_IGNORE_ACTIVITY_ORIENTATION_REQUEST); pw.print("="); pw.println(mIgnoreActivityOrientationRequest); pw.print("="); pw.println(mIgnoreActivityOrientationRequestSmallScreen ? "true" : mIgnoreActivityOrientationRequestLargeScreen ? "large" : "false"); if (mOptOutIgnoreActivityOrientationRequestPackages != null) { pw.print(" "); pw.print(KEY_OPT_OUT_IGNORE_ACTIVITY_ORIENTATION_REQUEST_LIST); pw.print("="); pw.println(mOptOutIgnoreActivityOrientationRequestPackages); Loading services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java +1 −1 Original line number Diff line number Diff line Loading @@ -2670,7 +2670,7 @@ public class ActivityRecordTests extends WindowTestsBase { assertSetOrientation(Build.VERSION_CODES.CUR_DEVELOPMENT, CATEGORY_GAME, true); // Blanket application, also ignoring Target SDK mWm.mConstants.mIgnoreActivityOrientationRequest = true; mWm.mConstants.mIgnoreActivityOrientationRequestLargeScreen = true; assertSetOrientation(Build.VERSION_CODES.VANILLA_ICE_CREAM, CATEGORY_SOCIAL, false); } Loading services/tests/wmtests/src/com/android/server/wm/SizeCompatTests.java +2 −1 Original line number Diff line number Diff line Loading @@ -4892,7 +4892,8 @@ public class SizeCompatTests extends WindowTestsBase { @Test public void testUniversalResizeable() { mWm.mConstants.mIgnoreActivityOrientationRequest = true; mWm.mConstants.mIgnoreActivityOrientationRequestSmallScreen = true; mWm.mConstants.mIgnoreActivityOrientationRequestLargeScreen = true; setUpApp(mDisplayContent); final float maxAspect = 1.8f; final float minAspect = 1.5f; Loading Loading
services/core/java/com/android/server/wm/ActivityRecord.java +6 −4 Original line number Diff line number Diff line Loading @@ -3238,10 +3238,12 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A } final boolean compatEnabled = isLargeScreen && Flags.universalResizableByDefault() && appInfo.isChangeEnabled(ActivityInfo.UNIVERSAL_RESIZABLE_BY_DEFAULT); if (!compatEnabled && !wms.mConstants.mIgnoreActivityOrientationRequest) { return false; } if (wms.mConstants.isPackageOptOutIgnoreActivityOrientationRequest(appInfo.packageName)) { final boolean configEnabled = (isLargeScreen ? wms.mConstants.mIgnoreActivityOrientationRequestLargeScreen : wms.mConstants.mIgnoreActivityOrientationRequestSmallScreen) && !wms.mConstants.isPackageOptOutIgnoreActivityOrientationRequest( appInfo.packageName); if (!compatEnabled && !configEnabled) { return false; } if (forActivity) { Loading
services/core/java/com/android/server/wm/WindowManagerConstants.java +19 −7 Original line number Diff line number Diff line Loading @@ -36,7 +36,15 @@ import java.util.concurrent.Executor; */ final class WindowManagerConstants { /** The orientation of activity will be always "unspecified" except for game apps. */ /** * The orientation of activity will be always "unspecified" except for game apps. * <p>Possible values: * <ul> * <li>false: applies to no apps (default)</li> * <li>true: applies to all apps</li> * <li>large: applies to all apps but only on large screens</li> * </ul> */ private static final String KEY_IGNORE_ACTIVITY_ORIENTATION_REQUEST = "ignore_activity_orientation_request"; Loading Loading @@ -69,7 +77,8 @@ final class WindowManagerConstants { boolean mSystemGestureExcludedByPreQStickyImmersive; /** @see #KEY_IGNORE_ACTIVITY_ORIENTATION_REQUEST */ boolean mIgnoreActivityOrientationRequest; boolean mIgnoreActivityOrientationRequestLargeScreen; boolean mIgnoreActivityOrientationRequestSmallScreen; /** @see #KEY_OPT_OUT_IGNORE_ACTIVITY_ORIENTATION_REQUEST_LIST */ private ArraySet<String> mOptOutIgnoreActivityOrientationRequestPackages; Loading Loading @@ -177,9 +186,12 @@ final class WindowManagerConstants { } private void updateIgnoreActivityOrientationRequest() { mIgnoreActivityOrientationRequest = mDeviceConfig.getBoolean( final String value = mDeviceConfig.getProperty( DeviceConfig.NAMESPACE_WINDOW_MANAGER, KEY_IGNORE_ACTIVITY_ORIENTATION_REQUEST, false); KEY_IGNORE_ACTIVITY_ORIENTATION_REQUEST); mIgnoreActivityOrientationRequestSmallScreen = Boolean.parseBoolean(value); mIgnoreActivityOrientationRequestLargeScreen = mIgnoreActivityOrientationRequestSmallScreen || ("large".equals(value)); } private void updateOptOutIgnoreActivityOrientationRequestList() { Loading @@ -196,8 +208,7 @@ final class WindowManagerConstants { } boolean isPackageOptOutIgnoreActivityOrientationRequest(String packageName) { return mIgnoreActivityOrientationRequest && mOptOutIgnoreActivityOrientationRequestPackages != null return mOptOutIgnoreActivityOrientationRequestPackages != null && mOptOutIgnoreActivityOrientationRequestPackages.contains(packageName); } Loading @@ -211,7 +222,8 @@ final class WindowManagerConstants { pw.print(" "); pw.print(KEY_SYSTEM_GESTURES_EXCLUDED_BY_PRE_Q_STICKY_IMMERSIVE); pw.print("="); pw.println(mSystemGestureExcludedByPreQStickyImmersive); pw.print(" "); pw.print(KEY_IGNORE_ACTIVITY_ORIENTATION_REQUEST); pw.print("="); pw.println(mIgnoreActivityOrientationRequest); pw.print("="); pw.println(mIgnoreActivityOrientationRequestSmallScreen ? "true" : mIgnoreActivityOrientationRequestLargeScreen ? "large" : "false"); if (mOptOutIgnoreActivityOrientationRequestPackages != null) { pw.print(" "); pw.print(KEY_OPT_OUT_IGNORE_ACTIVITY_ORIENTATION_REQUEST_LIST); pw.print("="); pw.println(mOptOutIgnoreActivityOrientationRequestPackages); Loading
services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java +1 −1 Original line number Diff line number Diff line Loading @@ -2670,7 +2670,7 @@ public class ActivityRecordTests extends WindowTestsBase { assertSetOrientation(Build.VERSION_CODES.CUR_DEVELOPMENT, CATEGORY_GAME, true); // Blanket application, also ignoring Target SDK mWm.mConstants.mIgnoreActivityOrientationRequest = true; mWm.mConstants.mIgnoreActivityOrientationRequestLargeScreen = true; assertSetOrientation(Build.VERSION_CODES.VANILLA_ICE_CREAM, CATEGORY_SOCIAL, false); } Loading
services/tests/wmtests/src/com/android/server/wm/SizeCompatTests.java +2 −1 Original line number Diff line number Diff line Loading @@ -4892,7 +4892,8 @@ public class SizeCompatTests extends WindowTestsBase { @Test public void testUniversalResizeable() { mWm.mConstants.mIgnoreActivityOrientationRequest = true; mWm.mConstants.mIgnoreActivityOrientationRequestSmallScreen = true; mWm.mConstants.mIgnoreActivityOrientationRequestLargeScreen = true; setUpApp(mDisplayContent); final float maxAspect = 1.8f; final float minAspect = 1.5f; Loading