Loading core/java/android/provider/Settings.java +19 −0 Original line number Diff line number Diff line Loading @@ -4536,6 +4536,25 @@ public final class Settings { public static final String HAPTIC_FEEDBACK_INTENSITY = "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. Loading core/java/android/view/HapticFeedbackConstants.java +9 −0 Original line number Diff line number Diff line Loading @@ -153,10 +153,19 @@ 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 Loading packages/SettingsProvider/src/android/provider/settings/backup/SystemSettings.java +1 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,7 @@ public class SystemSettings { Settings.System.NOTIFICATION_VIBRATION_INTENSITY, Settings.System.RING_VIBRATION_INTENSITY, Settings.System.HAPTIC_FEEDBACK_INTENSITY, Settings.System.HARDWARE_HAPTIC_FEEDBACK_INTENSITY, Settings.System.DISPLAY_COLOR_MODE_VENDOR_HINT, // must precede DISPLAY_COLOR_MODE Settings.System.DISPLAY_COLOR_MODE, Settings.System.ALARM_ALERT, Loading packages/SettingsProvider/src/android/provider/settings/validators/SystemSettingsValidators.java +1 −0 Original line number Diff line number Diff line Loading @@ -120,6 +120,7 @@ public class SystemSettingsValidators { VALIDATORS.put(System.NOTIFICATION_VIBRATION_INTENSITY, VIBRATION_INTENSITY_VALIDATOR); VALIDATORS.put(System.RING_VIBRATION_INTENSITY, VIBRATION_INTENSITY_VALIDATOR); VALIDATORS.put(System.HAPTIC_FEEDBACK_INTENSITY, VIBRATION_INTENSITY_VALIDATOR); VALIDATORS.put(System.HARDWARE_HAPTIC_FEEDBACK_INTENSITY, VIBRATION_INTENSITY_VALIDATOR); VALIDATORS.put(System.RINGTONE, URI_VALIDATOR); VALIDATORS.put(System.NOTIFICATION_SOUND, URI_VALIDATOR); VALIDATORS.put(System.ALARM_ALERT, URI_VALIDATOR); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarCommandQueueCallbacks.java +7 −7 Original line number Diff line number Diff line Loading @@ -30,11 +30,11 @@ import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.res.Resources; import android.media.AudioAttributes; import android.os.Bundle; import android.os.PowerManager; import android.os.SystemClock; import android.os.UserHandle; import android.os.VibrationAttributes; import android.os.VibrationEffect; import android.os.Vibrator; import android.util.Log; Loading Loading @@ -106,10 +106,8 @@ public class StatusBarCommandQueueCallbacks implements CommandQueue.Callbacks { private final VibrationEffect mCameraLaunchGestureVibrationEffect; private static final AudioAttributes VIBRATION_ATTRIBUTES = new AudioAttributes.Builder() .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION) .setUsage(AudioAttributes.USAGE_ASSISTANCE_SONIFICATION) .build(); private static final VibrationAttributes HARDWARE_FEEDBACK_VIBRATION_ATTRIBUTES = VibrationAttributes.createForUsage(VibrationAttributes.USAGE_HARDWARE_FEEDBACK); @Inject StatusBarCommandQueueCallbacks( Loading Loading @@ -611,9 +609,9 @@ public class StatusBarCommandQueueCallbacks implements CommandQueue.Callbacks { } private void vibrateForCameraGesture() { // Make sure to pass -1 for repeat so VibratorService doesn't stop us when going to sleep. mVibratorOptional.ifPresent( v -> v.vibrate(mCameraLaunchGestureVibrationEffect, VIBRATION_ATTRIBUTES)); v -> v.vibrate(mCameraLaunchGestureVibrationEffect, HARDWARE_FEEDBACK_VIBRATION_ATTRIBUTES)); } private static VibrationEffect getCameraGestureVibrationEffect( Loading @@ -627,6 +625,8 @@ public class StatusBarCommandQueueCallbacks implements CommandQueue.Callbacks { .compose(); } if (vibratorOptional.isPresent() && vibratorOptional.get().hasAmplitudeControl()) { // Make sure to pass -1 for repeat so VibratorManagerService doesn't stop us when going // to sleep. return VibrationEffect.createWaveform( StatusBar.CAMERA_LAUNCH_GESTURE_VIBRATION_TIMINGS, StatusBar.CAMERA_LAUNCH_GESTURE_VIBRATION_AMPLITUDES, Loading Loading
core/java/android/provider/Settings.java +19 −0 Original line number Diff line number Diff line Loading @@ -4536,6 +4536,25 @@ public final class Settings { public static final String HAPTIC_FEEDBACK_INTENSITY = "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. Loading
core/java/android/view/HapticFeedbackConstants.java +9 −0 Original line number Diff line number Diff line Loading @@ -153,10 +153,19 @@ 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 Loading
packages/SettingsProvider/src/android/provider/settings/backup/SystemSettings.java +1 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,7 @@ public class SystemSettings { Settings.System.NOTIFICATION_VIBRATION_INTENSITY, Settings.System.RING_VIBRATION_INTENSITY, Settings.System.HAPTIC_FEEDBACK_INTENSITY, Settings.System.HARDWARE_HAPTIC_FEEDBACK_INTENSITY, Settings.System.DISPLAY_COLOR_MODE_VENDOR_HINT, // must precede DISPLAY_COLOR_MODE Settings.System.DISPLAY_COLOR_MODE, Settings.System.ALARM_ALERT, Loading
packages/SettingsProvider/src/android/provider/settings/validators/SystemSettingsValidators.java +1 −0 Original line number Diff line number Diff line Loading @@ -120,6 +120,7 @@ public class SystemSettingsValidators { VALIDATORS.put(System.NOTIFICATION_VIBRATION_INTENSITY, VIBRATION_INTENSITY_VALIDATOR); VALIDATORS.put(System.RING_VIBRATION_INTENSITY, VIBRATION_INTENSITY_VALIDATOR); VALIDATORS.put(System.HAPTIC_FEEDBACK_INTENSITY, VIBRATION_INTENSITY_VALIDATOR); VALIDATORS.put(System.HARDWARE_HAPTIC_FEEDBACK_INTENSITY, VIBRATION_INTENSITY_VALIDATOR); VALIDATORS.put(System.RINGTONE, URI_VALIDATOR); VALIDATORS.put(System.NOTIFICATION_SOUND, URI_VALIDATOR); VALIDATORS.put(System.ALARM_ALERT, URI_VALIDATOR); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarCommandQueueCallbacks.java +7 −7 Original line number Diff line number Diff line Loading @@ -30,11 +30,11 @@ import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.res.Resources; import android.media.AudioAttributes; import android.os.Bundle; import android.os.PowerManager; import android.os.SystemClock; import android.os.UserHandle; import android.os.VibrationAttributes; import android.os.VibrationEffect; import android.os.Vibrator; import android.util.Log; Loading Loading @@ -106,10 +106,8 @@ public class StatusBarCommandQueueCallbacks implements CommandQueue.Callbacks { private final VibrationEffect mCameraLaunchGestureVibrationEffect; private static final AudioAttributes VIBRATION_ATTRIBUTES = new AudioAttributes.Builder() .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION) .setUsage(AudioAttributes.USAGE_ASSISTANCE_SONIFICATION) .build(); private static final VibrationAttributes HARDWARE_FEEDBACK_VIBRATION_ATTRIBUTES = VibrationAttributes.createForUsage(VibrationAttributes.USAGE_HARDWARE_FEEDBACK); @Inject StatusBarCommandQueueCallbacks( Loading Loading @@ -611,9 +609,9 @@ public class StatusBarCommandQueueCallbacks implements CommandQueue.Callbacks { } private void vibrateForCameraGesture() { // Make sure to pass -1 for repeat so VibratorService doesn't stop us when going to sleep. mVibratorOptional.ifPresent( v -> v.vibrate(mCameraLaunchGestureVibrationEffect, VIBRATION_ATTRIBUTES)); v -> v.vibrate(mCameraLaunchGestureVibrationEffect, HARDWARE_FEEDBACK_VIBRATION_ATTRIBUTES)); } private static VibrationEffect getCameraGestureVibrationEffect( Loading @@ -627,6 +625,8 @@ public class StatusBarCommandQueueCallbacks implements CommandQueue.Callbacks { .compose(); } if (vibratorOptional.isPresent() && vibratorOptional.get().hasAmplitudeControl()) { // Make sure to pass -1 for repeat so VibratorManagerService doesn't stop us when going // to sleep. return VibrationEffect.createWaveform( StatusBar.CAMERA_LAUNCH_GESTURE_VIBRATION_TIMINGS, StatusBar.CAMERA_LAUNCH_GESTURE_VIBRATION_AMPLITUDES, Loading