diff options
| author | 2020-03-27 17:16:48 +0000 | |
|---|---|---|
| committer | 2020-03-27 17:16:48 +0000 | |
| commit | 1f8d91de8ccdacc7e23320971dc231a6c2a05a05 (patch) | |
| tree | 4eb3763278fcc8f6631b218659c33c3be0781391 | |
| parent | 1410b406d78ffadd5b3440bf2021f243a0ef01a2 (diff) | |
| parent | bcaf0efea379f351ccfe1f80064e50a11e0a1dae (diff) | |
Merge "Add Secure Setting for Controls" into rvc-dev
6 files changed, 29 insertions, 2 deletions
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index d2a03f0ff166..530585d86465 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -8571,6 +8571,16 @@ public final class Settings { public static final String QS_TILES = "sysui_qs_tiles"; /** + * Whether this user has enabled Quick controls. + * + * 0 indicates disabled and 1 indicates enabled. A non existent value should be treated as + * enabled. + * + * @hide + */ + public static final String CONTROLS_ENABLED = "controls_enabled"; + + /** * Specifies whether the web action API is enabled. * * @hide diff --git a/core/proto/android/providers/settings/secure.proto b/core/proto/android/providers/settings/secure.proto index d09273cdd369..075aa97edb58 100644 --- a/core/proto/android/providers/settings/secure.proto +++ b/core/proto/android/providers/settings/secure.proto @@ -180,6 +180,14 @@ message SecureSettingsProto { optional SettingProto cmas_additional_broadcast_pkg = 14 [ (android.privacy).dest = DEST_AUTOMATIC ]; repeated SettingProto completed_categories = 15; optional SettingProto connectivity_release_pending_intent_delay_ms = 16 [ (android.privacy).dest = DEST_AUTOMATIC ]; + + message Controls { + option (android.msg_privacy).dest = DEST_EXPLICIT; + + optional SettingProto enabled = 1 [ (android.privacy).dest = DEST_AUTOMATIC ]; + } + optional Controls controls = 79; + optional SettingProto device_paired = 17 [ (android.privacy).dest = DEST_AUTOMATIC ]; optional SettingProto dialer_default_application = 18 [ (android.privacy).dest = DEST_AUTOMATIC ]; optional SettingProto display_density_forced = 19 [ (android.privacy).dest = DEST_AUTOMATIC ]; @@ -580,5 +588,5 @@ message SecureSettingsProto { // Please insert fields in alphabetical order and group them into messages // if possible (to avoid reaching the method limit). - // Next tag = 79; + // Next tag = 80; } diff --git a/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java b/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java index 3c0ddc4b65c5..736e995451cd 100644 --- a/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java +++ b/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java @@ -96,6 +96,7 @@ public class SecureSettings { Settings.Secure.CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED, Settings.Secure.SYSTEM_NAVIGATION_KEYS_ENABLED, Settings.Secure.QS_TILES, + Settings.Secure.CONTROLS_ENABLED, Settings.Secure.DOZE_ENABLED, Settings.Secure.DOZE_ALWAYS_ON, Settings.Secure.DOZE_PICK_UP_GESTURE, diff --git a/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java b/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java index 3e64a378bc6a..b413e8e9dda2 100644 --- a/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java +++ b/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java @@ -141,6 +141,7 @@ public class SecureSettingsValidators { VALIDATORS.put(Secure.CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED, BOOLEAN_VALIDATOR); VALIDATORS.put(Secure.SYSTEM_NAVIGATION_KEYS_ENABLED, BOOLEAN_VALIDATOR); VALIDATORS.put(Secure.QS_TILES, TILE_LIST_VALIDATOR); + VALIDATORS.put(Secure.CONTROLS_ENABLED, BOOLEAN_VALIDATOR); VALIDATORS.put(Secure.DOZE_ENABLED, BOOLEAN_VALIDATOR); VALIDATORS.put(Secure.DOZE_ALWAYS_ON, BOOLEAN_VALIDATOR); VALIDATORS.put(Secure.DOZE_PICK_UP_GESTURE, BOOLEAN_VALIDATOR); diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java index 6fba15f5381f..8a7b9134a5d9 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java @@ -1972,6 +1972,13 @@ class SettingsProtoDumpUtil { dumpSetting(s, p, Settings.Secure.CONNECTIVITY_RELEASE_PENDING_INTENT_DELAY_MS, SecureSettingsProto.CONNECTIVITY_RELEASE_PENDING_INTENT_DELAY_MS); + + final long controlsToken = p.start(SecureSettingsProto.CONTROLS); + dumpSetting(s, p, + Settings.Secure.CONTROLS_ENABLED, + SecureSettingsProto.Controls.ENABLED); + p.end(controlsToken); + dumpSetting(s, p, Settings.Secure.DEVICE_PAIRED, SecureSettingsProto.DEVICE_PAIRED); diff --git a/packages/SystemUI/src/com/android/systemui/controls/controller/ControlsControllerImpl.kt b/packages/SystemUI/src/com/android/systemui/controls/controller/ControlsControllerImpl.kt index 118fcbb20f26..f51660d8085b 100644 --- a/packages/SystemUI/src/com/android/systemui/controls/controller/ControlsControllerImpl.kt +++ b/packages/SystemUI/src/com/android/systemui/controls/controller/ControlsControllerImpl.kt @@ -65,7 +65,7 @@ class ControlsControllerImpl @Inject constructor ( companion object { private const val TAG = "ControlsControllerImpl" - internal const val CONTROLS_AVAILABLE = "systemui.controls_available" + internal const val CONTROLS_AVAILABLE = Settings.Secure.CONTROLS_ENABLED internal val URI = Settings.Secure.getUriFor(CONTROLS_AVAILABLE) private const val USER_CHANGE_RETRY_DELAY = 500L // ms private const val DEFAULT_ENABLED = 1 |