summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/java/android/content/pm/ActivityInfo.java30
-rw-r--r--core/res/res/values/attrs_manifest.xml19
2 files changed, 47 insertions, 2 deletions
diff --git a/core/java/android/content/pm/ActivityInfo.java b/core/java/android/content/pm/ActivityInfo.java
index 8f3b62d..7ccae76 100644
--- a/core/java/android/content/pm/ActivityInfo.java
+++ b/core/java/android/content/pm/ActivityInfo.java
@@ -279,6 +279,30 @@ public class ActivityInfo extends ComponentInfo
public static final int SCREEN_ORIENTATION_FULL_SENSOR = 10;
/**
+ * Constant corresponding to <code>userLandscape</code> in
+ * the {@link android.R.attr#screenOrientation} attribute.
+ */
+ public static final int SCREEN_ORIENTATION_USER_LANDSCAPE = 11;
+
+ /**
+ * Constant corresponding to <code>userPortrait</code> in
+ * the {@link android.R.attr#screenOrientation} attribute.
+ */
+ public static final int SCREEN_ORIENTATION_USER_PORTRAIT = 12;
+
+ /**
+ * Constant corresponding to <code>fullUser</code> in
+ * the {@link android.R.attr#screenOrientation} attribute.
+ */
+ public static final int SCREEN_ORIENTATION_FULL_USER = 13;
+
+ /**
+ * Constant corresponding to <code>locked</code> in
+ * the {@link android.R.attr#screenOrientation} attribute.
+ */
+ public static final int SCREEN_ORIENTATION_LOCKED = 14;
+
+ /**
* The preferred screen orientation this activity would like to run in.
* From the {@link android.R.attr#screenOrientation} attribute, one of
* {@link #SCREEN_ORIENTATION_UNSPECIFIED},
@@ -292,7 +316,11 @@ public class ActivityInfo extends ComponentInfo
* {@link #SCREEN_ORIENTATION_SENSOR_PORTRAIT},
* {@link #SCREEN_ORIENTATION_REVERSE_LANDSCAPE},
* {@link #SCREEN_ORIENTATION_REVERSE_PORTRAIT},
- * {@link #SCREEN_ORIENTATION_FULL_SENSOR}.
+ * {@link #SCREEN_ORIENTATION_FULL_SENSOR},
+ * {@link #SCREEN_ORIENTATION_USER_LANDSCAPE},
+ * {@link #SCREEN_ORIENTATION_USER_PORTRAIT},
+ * {@link #SCREEN_ORIENTATION_FULL_USER},
+ * {@link #SCREEN_ORIENTATION_LOCKED},
*/
public int screenOrientation = SCREEN_ORIENTATION_UNSPECIFIED;
diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml
index 7b70e21..7f5a3dc 100644
--- a/core/res/res/values/attrs_manifest.xml
+++ b/core/res/res/values/attrs_manifest.xml
@@ -570,7 +570,8 @@
this activity. -->
<enum name="behind" value="3" />
<!-- Orientation is determined by a physical orientation sensor:
- the display will rotate based on how the user moves the device. -->
+ the display will rotate based on how the user moves the device.
+ Ignores user's setting to turn off sensor-based rotation. -->
<enum name="sensor" value="4" />
<!-- Always ignore orientation determined by orientation sensor:
the display will not rotate when the user moves the device. -->
@@ -593,6 +594,22 @@
the device will normally do (for example some devices won't
normally use 180 degree rotation). -->
<enum name="fullSensor" value="10" />
+ <!-- Would like to have the screen in landscape orientation, but if
+ the user has enabled sensor-based rotation then we can use the
+ sensor to change which direction the screen is facing. -->
+ <enum name="userLandscape" value="11" />
+ <!-- Would like to have the screen in portrait orientation, but if
+ the user has enabled sensor-based rotation then we can use the
+ sensor to change which direction the screen is facing. -->
+ <enum name="userPortrait" value="12" />
+ <!-- Respect the user's sensor-based rotation preference, but if
+ sensor-based rotation is enabled then allow the screen to rotate
+ in all 4 possible directions regardless of what
+ the device will normally do (for example some devices won't
+ normally use 180 degree rotation). -->
+ <enum name="fullUser" value="13" />
+ <!-- Screen is locked to its current rotation, whatever that is. -->
+ <enum name="locked" value="14" />
</attr>
<!-- Specify one or more configuration changes that the activity will