From e6727ee6daabdb7776320f60a5f0afc5b92c6803 Mon Sep 17 00:00:00 2001 From: Beverly Date: Fri, 28 Jun 2019 10:13:07 -0400 Subject: [PATCH] Add gesture touch counts Test: manual Bug: 136229528 Change-Id: I805dfbba821c798c59c0d232e60f41890bc9b20d --- core/java/android/provider/Settings.java | 33 ++++++++++++++++--- .../android/providers/settings/secure.proto | 10 +++++- .../settings/SettingsProtoDumpUtil.java | 16 +++++++-- 3 files changed, 50 insertions(+), 9 deletions(-) diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index e95e6e0812768..ed7aeeba46d19 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -7764,6 +7764,12 @@ public final class Settings { */ public static final String SKIP_GESTURE_COUNT = "skip_gesture_count"; + /** + * Count of non-gesture interaction. + * @hide + */ + public static final String SKIP_TOUCH_COUNT = "skip_touch_count"; + private static final Validator SKIP_GESTURE_COUNT_VALIDATOR = NON_NEGATIVE_INTEGER_VALIDATOR; @@ -7808,11 +7814,22 @@ public final class Settings { public static final String SILENCE_CALL_GESTURE_COUNT = "silence_call_gesture_count"; /** - * Count of successful silence notification gestures. + * Count of non-gesture interaction. * @hide */ - public static final String SILENCE_NOTIFICATION_GESTURE_COUNT = - "silence_notification_gesture_count"; + public static final String SILENCE_ALARMS_TOUCH_COUNT = "silence_alarms_touch_count"; + + /** + * Count of non-gesture interaction. + * @hide + */ + public static final String SILENCE_TIMER_TOUCH_COUNT = "silence_timer_touch_count"; + + /** + * Count of non-gesture interaction. + * @hide + */ + public static final String SILENCE_CALL_TOUCH_COUNT = "silence_call_touch_count"; private static final Validator SILENCE_GESTURE_COUNT_VALIDATOR = NON_NEGATIVE_INTEGER_VALIDATOR; @@ -9025,10 +9042,13 @@ public final class Settings { NAVIGATION_MODE, AWARE_ENABLED, SKIP_GESTURE_COUNT, + SKIP_TOUCH_COUNT, SILENCE_ALARMS_GESTURE_COUNT, - SILENCE_NOTIFICATION_GESTURE_COUNT, SILENCE_CALL_GESTURE_COUNT, SILENCE_TIMER_GESTURE_COUNT, + SILENCE_ALARMS_TOUCH_COUNT, + SILENCE_CALL_TOUCH_COUNT, + SILENCE_TIMER_TOUCH_COUNT, DARK_MODE_DIALOG_SEEN, GLOBAL_ACTIONS_PANEL_ENABLED, AWARE_LOCK_ENABLED @@ -9215,10 +9235,13 @@ public final class Settings { VALIDATORS.put(NAVIGATION_MODE, NAVIGATION_MODE_VALIDATOR); VALIDATORS.put(AWARE_ENABLED, AWARE_ENABLED_VALIDATOR); VALIDATORS.put(SKIP_GESTURE_COUNT, SKIP_GESTURE_COUNT_VALIDATOR); + VALIDATORS.put(SKIP_TOUCH_COUNT, SKIP_GESTURE_COUNT_VALIDATOR); VALIDATORS.put(SILENCE_ALARMS_GESTURE_COUNT, SILENCE_GESTURE_COUNT_VALIDATOR); VALIDATORS.put(SILENCE_TIMER_GESTURE_COUNT, SILENCE_GESTURE_COUNT_VALIDATOR); VALIDATORS.put(SILENCE_CALL_GESTURE_COUNT, SILENCE_GESTURE_COUNT_VALIDATOR); - VALIDATORS.put(SILENCE_NOTIFICATION_GESTURE_COUNT, SILENCE_GESTURE_COUNT_VALIDATOR); + VALIDATORS.put(SILENCE_ALARMS_TOUCH_COUNT, SILENCE_GESTURE_COUNT_VALIDATOR); + VALIDATORS.put(SILENCE_TIMER_TOUCH_COUNT, SILENCE_GESTURE_COUNT_VALIDATOR); + VALIDATORS.put(SILENCE_CALL_TOUCH_COUNT, SILENCE_GESTURE_COUNT_VALIDATOR); VALIDATORS.put(ODI_CAPTIONS_ENABLED, ODI_CAPTIONS_ENABLED_VALIDATOR); VALIDATORS.put(DARK_MODE_DIALOG_SEEN, BOOLEAN_VALIDATOR); VALIDATORS.put(UI_NIGHT_MODE, UI_NIGHT_MODE_VALIDATOR); diff --git a/core/proto/android/providers/settings/secure.proto b/core/proto/android/providers/settings/secure.proto index fed2efaf8a78f..61799eefdca64 100644 --- a/core/proto/android/providers/settings/secure.proto +++ b/core/proto/android/providers/settings/secure.proto @@ -198,11 +198,19 @@ message SecureSettingsProto { optional SettingProto silence_alarms_count = 2 [ (android.privacy).dest = DEST_AUTOMATIC ]; optional SettingProto silence_calls_count = 3 [ (android.privacy).dest = DEST_AUTOMATIC ]; optional SettingProto silence_enabled = 4 [ (android.privacy).dest = DEST_AUTOMATIC ]; - optional SettingProto silence_notification_count = 5 [ (android.privacy).dest = DEST_AUTOMATIC ]; + // del: silence_notification_count = 5 optional SettingProto silence_timer_count = 6 [ (android.privacy).dest = DEST_AUTOMATIC ]; optional SettingProto skip_count = 7 [ (android.privacy).dest = DEST_AUTOMATIC ]; optional SettingProto skip_enabled = 8 [ (android.privacy).dest = DEST_AUTOMATIC ]; + + optional SettingProto silence_alarms_touch_count = 9 [ (android.privacy).dest = + DEST_AUTOMATIC ]; + optional SettingProto silence_calls_touch_count = 10 [ (android.privacy).dest = + DEST_AUTOMATIC ]; + optional SettingProto silence_timer_touch_count = 11 [ (android.privacy).dest = + DEST_AUTOMATIC ]; + optional SettingProto skip_touch_count = 12 [ (android.privacy).dest = DEST_AUTOMATIC ]; } optional Gesture gesture = 74; diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java index 3cd82dfca6b6b..b2c10ec8ea7ff 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java @@ -1943,9 +1943,6 @@ class SettingsProtoDumpUtil { dumpSetting(s, p, Settings.Secure.SILENCE_GESTURE, SecureSettingsProto.Gesture.SILENCE_ENABLED); - dumpSetting(s, p, - Settings.Secure.SILENCE_NOTIFICATION_GESTURE_COUNT, - SecureSettingsProto.Gesture.SILENCE_NOTIFICATION_COUNT); dumpSetting(s, p, Settings.Secure.SILENCE_TIMER_GESTURE_COUNT, SecureSettingsProto.Gesture.SILENCE_TIMER_COUNT); @@ -1956,6 +1953,19 @@ class SettingsProtoDumpUtil { dumpSetting(s, p, Settings.Secure.SKIP_GESTURE, SecureSettingsProto.Gesture.SKIP_ENABLED); + + dumpSetting(s, p, + Settings.Secure.SILENCE_ALARMS_TOUCH_COUNT, + SecureSettingsProto.Gesture.SILENCE_ALARMS_TOUCH_COUNT); + dumpSetting(s, p, + Settings.Secure.SILENCE_CALL_TOUCH_COUNT, + SecureSettingsProto.Gesture.SILENCE_CALLS_TOUCH_COUNT); + dumpSetting(s, p, + Settings.Secure.SILENCE_TIMER_TOUCH_COUNT, + SecureSettingsProto.Gesture.SILENCE_TIMER_TOUCH_COUNT); + dumpSetting(s, p, + Settings.Secure.SKIP_TOUCH_COUNT, + SecureSettingsProto.Gesture.SKIP_TOUCH_COUNT); p.end(gestureToken); dumpSetting(s, p,