summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorLais Andrade <lsandrade@google.com>2021-11-22 17:54:42 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2021-11-22 17:54:42 +0000
commit2dda2584712e8333697ddb83b534d27b37166d47 (patch)
tree3bdcb6859a4d91be9efb8bb4306719552c2a3bec /core/java/android
parent811ae06be3fd471d828bd0a17d96169d40996c47 (diff)
parent657b009bcae4cefe6cadf284d50246c798ba3e96 (diff)
Merge "Introduce separate setting key for hardware haptic feedback"
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/provider/Settings.java19
-rw-r--r--core/java/android/view/HapticFeedbackConstants.java9
2 files changed, 28 insertions, 0 deletions
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index ae09b45a8f99..cc95c1f6c60b 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -4537,6 +4537,25 @@ public final class Settings {
"haptic_feedback_intensity";
/**
+ * The intensity of haptic feedback vibrations for interaction with hardware components from
+ * the device, like buttons and sensors, if configurable.
+ *
+ * Not all devices are capable of changing their feedback intensity; on these devices
+ * there will likely be no difference between the various vibration intensities except for
+ * intensity 0 (off) and the rest.
+ *
+ * <b>Values:</b><br/>
+ * 0 - Vibration is disabled<br/>
+ * 1 - Weak vibrations<br/>
+ * 2 - Medium vibrations<br/>
+ * 3 - Strong vibrations
+ * @hide
+ */
+ @Readable
+ public static final String HARDWARE_HAPTIC_FEEDBACK_INTENSITY =
+ "hardware_haptic_feedback_intensity";
+
+ /**
* Ringer volume. This is used internally, changing this value will not
* change the volume. See AudioManager.
*
diff --git a/core/java/android/view/HapticFeedbackConstants.java b/core/java/android/view/HapticFeedbackConstants.java
index ec613edeedb4..c5bc99d042d7 100644
--- a/core/java/android/view/HapticFeedbackConstants.java
+++ b/core/java/android/view/HapticFeedbackConstants.java
@@ -153,11 +153,20 @@ public class HapticFeedbackConstants {
/**
* Invocation of the voice assistant via hardware button.
+ * This is a private constant. Feel free to renumber as desired.
* @hide
*/
public static final int ASSISTANT_BUTTON = 10002;
/**
+ * The user has performed a long press on the power button hardware that is resulting
+ * in an action being performed.
+ * This is a private constant. Feel free to renumber as desired.
+ * @hide
+ */
+ public static final int LONG_PRESS_POWER_BUTTON = 10003;
+
+ /**
* Flag for {@link View#performHapticFeedback(int, int)
* View.performHapticFeedback(int, int)}: Ignore the setting in the
* view for whether to perform haptic feedback, do it always.