diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 692e7b6b4933a..b062aeb9ffaf7 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -5930,6 +5930,13 @@ public final class Settings { */ public static final String ADAPTIVE_SLEEP = "adaptive_sleep"; + /** + * Setting key to indicate whether camera-based autorotate is enabled. + * + * @hide + */ + public static final String CAMERA_AUTOROTATE = "camera_autorotate"; + /** * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED} * instead diff --git a/core/proto/android/providers/settings/secure.proto b/core/proto/android/providers/settings/secure.proto index f5aa17d45fa92..632d372bf7ab8 100644 --- a/core/proto/android/providers/settings/secure.proto +++ b/core/proto/android/providers/settings/secure.proto @@ -518,6 +518,11 @@ message SecureSettingsProto { } optional Search search = 48; + message CameraAutorotate { + optional SettingProto enabled = 1 [ (android.privacy).dest = DEST_AUTOMATIC ]; + } + optional CameraAutorotate camera_autorotate = 88; + message SpellChecker { option (android.msg_privacy).dest = DEST_EXPLICIT; @@ -642,5 +647,5 @@ message SecureSettingsProto { // Please insert fields in alphabetical order and group them into messages // if possible (to avoid reaching the method limit). - // Next tag = 88; + // Next tag = 89; } diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 3400069e52594..a90dd782a4396 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -517,6 +517,9 @@ false + + false + 180 diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index b08e44b52e0d5..e718d28486def 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -1881,6 +1881,7 @@ + diff --git a/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java b/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java index 60620bd70a155..e92591d78e92d 100644 --- a/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java +++ b/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java @@ -38,6 +38,7 @@ public class SecureSettings { Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED, Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED, Settings.Secure.ADAPTIVE_SLEEP, + Settings.Secure.CAMERA_AUTOROTATE, Settings.Secure.AUTOFILL_SERVICE, Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE, Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES, diff --git a/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java b/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java index 3f462628c7153..ed2b6c92530b2 100644 --- a/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java +++ b/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java @@ -57,6 +57,7 @@ public class SecureSettingsValidators { VALIDATORS.put( Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED, BOOLEAN_VALIDATOR); VALIDATORS.put(Secure.ADAPTIVE_SLEEP, BOOLEAN_VALIDATOR); + VALIDATORS.put(Secure.CAMERA_AUTOROTATE, BOOLEAN_VALIDATOR); VALIDATORS.put(Secure.AUTOFILL_SERVICE, NULLABLE_COMPONENT_NAME_VALIDATOR); VALIDATORS.put( Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE, diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java index 83ded43b13d42..1ce738ef065cb 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java @@ -1969,6 +1969,12 @@ class SettingsProtoDumpUtil { Settings.Secure.BLUETOOTH_ON_WHILE_DRIVING, SecureSettingsProto.BLUETOOTH_ON_WHILE_DRIVING); + final long smartAutoRotateToken = p.start(SecureSettingsProto.CAMERA_AUTOROTATE); + dumpSetting(s, p, + Settings.Secure.CAMERA_AUTOROTATE, + SecureSettingsProto.CameraAutorotate.ENABLED); + p.end(smartAutoRotateToken); + final long cameraToken = p.start(SecureSettingsProto.CAMERA); dumpSetting(s, p, Settings.Secure.CAMERA_GESTURE_DISABLED,