diff options
| author | 2019-01-10 16:33:02 -0500 | |
|---|---|---|
| committer | 2019-01-14 19:50:48 -0500 | |
| commit | 5015ac872e9cb85c05a8082bf8d41a00323a9ad8 (patch) | |
| tree | 1e209e372ee1774e07f3a8bc2e940ecb333f6c5b | |
| parent | 564c97ee981cdee5a40f1994c699680bd1c84781 (diff) | |
Add skip and silence gestures
Test: manual
Bug: 118388808
Change-Id: I099484cd37737741bf9d003ea9003e76ac8cf147
| -rw-r--r-- | core/java/android/provider/Settings.java | 20 | ||||
| -rw-r--r-- | core/proto/android/app/settings_enums.proto | 6 | ||||
| -rw-r--r-- | core/proto/android/providers/settings/secure.proto | 5 | ||||
| -rw-r--r-- | core/res/res/values/config.xml | 6 | ||||
| -rw-r--r-- | core/res/res/values/symbols.xml | 3 | ||||
| -rw-r--r-- | packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java | 8 | ||||
| -rw-r--r-- | proto/src/metrics_constants/metrics_constants.proto | 9 |
7 files changed, 56 insertions, 1 deletions
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index ef117eaaecc6..adfd4a02e388 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -7407,6 +7407,22 @@ public final class Settings { private static final Validator DOZE_WAKE_SCREEN_GESTURE_VALIDATOR = BOOLEAN_VALIDATOR; /** + * Gesture that skips media. + * @hide + */ + public static final String SKIP_GESTURE = "skip_gesture"; + + private static final Validator SKIP_GESTURE_VALIDATOR = BOOLEAN_VALIDATOR; + + /** + * Gesture that silences sound (alarms, notification, calls). + * @hide + */ + public static final String SILENCE_GESTURE = "silence_gesture"; + + private static final Validator SILENCE_GESTURE_VALIDATOR = BOOLEAN_VALIDATOR; + + /** * The current night mode that has been selected by the user. Owned * and controlled by UiModeManagerService. Constants are as per * UiModeManager. @@ -8483,6 +8499,8 @@ public final class Settings { NOTIFICATION_NEW_INTERRUPTION_MODEL, TRUST_AGENTS_EXTEND_UNLOCK, LOCK_SCREEN_WHEN_TRUST_LOST, + SKIP_GESTURE, + SILENCE_GESTURE, }; /** @@ -8650,6 +8668,8 @@ public final class Settings { VALIDATORS.put(TRUST_AGENTS_EXTEND_UNLOCK, TRUST_AGENTS_EXTEND_UNLOCK_VALIDATOR); VALIDATORS.put(LOCK_SCREEN_CUSTOM_CLOCK_FACE, LOCK_SCREEN_CUSTOM_CLOCK_FACE_VALIDATOR); VALIDATORS.put(LOCK_SCREEN_WHEN_TRUST_LOST, LOCK_SCREEN_WHEN_TRUST_LOST_VALIDATOR); + VALIDATORS.put(SKIP_GESTURE, SKIP_GESTURE_VALIDATOR); + VALIDATORS.put(SILENCE_GESTURE, SILENCE_GESTURE_VALIDATOR); } /** diff --git a/core/proto/android/app/settings_enums.proto b/core/proto/android/app/settings_enums.proto index 2f2f62392157..49ca378ef0e2 100644 --- a/core/proto/android/app/settings_enums.proto +++ b/core/proto/android/app/settings_enums.proto @@ -91,4 +91,10 @@ enum PageId { // OPEN: Settings > Apps & Notifications -> Special app access -> Financial Apps Sms Access SETTINGS_FINANCIAL_APPS_SMS_ACCESS = 1597; + + // OPEN: Settings > System > Input & Gesture > Skip songs + SETTINGS_GESTURE_SKIP = 1624; + + // OPEN: Settings > System > Input & Gesture > Silence alerts + SETTINGS_GESTURE_SILENCE = 1625; } diff --git a/core/proto/android/providers/settings/secure.proto b/core/proto/android/providers/settings/secure.proto index 0e052fe8d4b1..9f4345d4668f 100644 --- a/core/proto/android/providers/settings/secure.proto +++ b/core/proto/android/providers/settings/secure.proto @@ -525,7 +525,10 @@ message SecureSettingsProto { } optional Zen zen = 71; + optional SettingProto skip_gesture_enabled = 74 [ (android.privacy).dest = DEST_AUTOMATIC ]; + optional SettingProto silence_gesture_enabled = 75 [ (android.privacy).dest = DEST_AUTOMATIC ]; + // Please insert fields in alphabetical order and group them into messages // if possible (to avoid reaching the method limit). - // Next tag = 74; + // Next tag = 76; } diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 1feb59a52ad1..e2897795460c 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -3673,4 +3673,10 @@ <!-- If device supports corner radius on windows. This should be turned off on low-end devices to improve animation performance. --> <bool name="config_supportsRoundedCornersOnWindows">true</bool> + + <!-- If the sensor that skips media is available or not. --> + <bool name="config_skipSensorAvailable">false</bool> + + <!-- If the sensor that silences alerts is available or not. --> + <bool name="config_silenceSensorAvailable">false</bool> </resources> diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 010accf19d18..de06a2da108d 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -3529,4 +3529,7 @@ <java-symbol type="string" name="dynamic_mode_notification_title" /> <java-symbol type="string" name="dynamic_mode_notification_summary" /> <java-symbol type="drawable" name="ic_battery" /> + + <java-symbol type="bool" name="config_skipSensorAvailable" /> + <java-symbol type="bool" name="config_silenceSensorAvailable" /> </resources> diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java index bcf37ffef262..18bdb20ad0a6 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java @@ -2363,6 +2363,14 @@ class SettingsProtoDumpUtil { SecureSettingsProto.Zen.SETTINGS_SUGGESTION_VIEWED); p.end(zenToken); + dumpSetting(s, p, + Settings.Secure.SKIP_GESTURE, + SecureSettingsProto.SKIP_GESTURE_ENABLED); + + dumpSetting(s, p, + Settings.Secure.SILENCE_GESTURE, + SecureSettingsProto.SILENCE_GESTURE_ENABLED); + // Please insert new settings using the same order as in SecureSettingsProto. p.end(token); diff --git a/proto/src/metrics_constants/metrics_constants.proto b/proto/src/metrics_constants/metrics_constants.proto index 44edb568573c..bb5d288f11e7 100644 --- a/proto/src/metrics_constants/metrics_constants.proto +++ b/proto/src/metrics_constants/metrics_constants.proto @@ -6803,6 +6803,15 @@ message MetricsEvent { ACTION_NFC_PAYMENT_ALWAYS_SETTING = 1623; // ---- End Q Constants, all Q constants go above this line ---- + // OPEN: Settings > System > Input & Gesture > Skip song gesture + // OS: Q + SETTINGS_GESTURE_SKIP_SONG = 1624; + + // OPEN: Settings > System > Input & Gesture > Silence gesture + // OS: Q + SETTINGS_GESTURE_SILENCE = 1625; + + // ---- End Q Constants, all Q constants go above this line ---- // Add new aosp constants above this line. // END OF AOSP CONSTANTS } |