diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java index 04777baf13943..be41a7cf200c6 100644 --- a/core/java/android/content/pm/PackageParser.java +++ b/core/java/android/content/pm/PackageParser.java @@ -3083,9 +3083,6 @@ public class PackageParser { a.info.maxRecents = sa.getInt( R.styleable.AndroidManifestActivity_maxRecents, ActivityManager.getDefaultAppRecentsLimitStatic()); - a.info.screenOrientation = sa.getInt( - R.styleable.AndroidManifestActivity_screenOrientation, - ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); a.info.configChanges = sa.getInt(R.styleable.AndroidManifestActivity_configChanges, 0); a.info.softInputMode = sa.getInt( R.styleable.AndroidManifestActivity_windowSoftInputMode, 0); @@ -3113,6 +3110,14 @@ public class PackageParser { a.info.resizeable = sa.getBoolean( R.styleable.AndroidManifestActivity_resizeableActivity, owner.applicationInfo.targetSdkVersion >= Build.VERSION_CODES.MNC); + if (a.info.resizeable) { + // Fixed screen orientation isn't supported with resizeable activities. + a.info.screenOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; + } else { + a.info.screenOrientation = sa.getInt( + R.styleable.AndroidManifestActivity_screenOrientation, + ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); + } } else { a.info.launchMode = ActivityInfo.LAUNCH_MULTIPLE; a.info.configChanges = 0; diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml index 84609cadaf140..1849b5c14f9ef 100644 --- a/core/res/res/values/attrs_manifest.xml +++ b/core/res/res/values/attrs_manifest.xml @@ -1023,7 +1023,11 @@
NOTE: A task's root activity value is applied to all additional activities launched in the task. That is if the root activity of a task is resizeable then the system will treat all other activities in the task as resizeable and will not if the root activity isn't - resizeable. --> + resizeable. + +
NOTE: The value of {@link android.R.attr#screenOrientation} will be ignored for
+ resizeable activities as the system doesn't store fixed orientation on a resizeable
+ activity. -->