hex/android/app
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ryan Vogel 75b8a67762
Android keyboard: Keyboard vibration silences Hex only where the phone has that switch (#2718)
* Android keyboard: honour Keyboard vibration only where the phone has that switch

#2699 made every Hex tick also require Settings.System
"keyboard_vibration_enabled" != 0. Android itself counts that stored value
only on a device that declares config_keyboardVibrationSettingsSupported
(VibrationSettings.updateSettings: with the config, IME feedback takes the
keyboard intensity; without it, IME feedback takes the touch-feedback
intensity and the stored value is ignored). On a phone without the switch a
stored 0 silenced Hex with no setting the person could find. The S23 owner
reports Hex still silent after #2699; this is the one gate in Hex's own code
that can do that while the emulator ticks.

Changed: vibrates() reads the framework's
config_keyboardVibrationSettingsSupported (Resources.getSystem()
.getIdentifier, false when the resource is missing) and lets the stored
value veto a tick only when it is declared (keyboardVibrationAllows).
Removed: the unconditional keyboard_vibration_enabled gate from #2699; on a
phone that doesn't declare the setting it no longer silences Hex.

Verified: KeyboardPageTest covers all four (declared, stored) cases;
testDebugUnitTest, assembleDebug and assemblePreview green. Emulator
(API 36, does not declare the config: with keyboard_vibration_enabled=0 its
IME intensity stays MEDIUM) evidence in the PR.

* Android keyboard: a key press plays Android's keyboard click, at the phone's strength

Optional, separate from the gate fix. #2699 made the press a light
EFFECT_TICK and, where the vibrator doesn't report the effect, a 12 ms pulse
at amplitude 80 of 255. Android's own keyboard press is EFFECT_CLICK
(HapticFeedbackVibrationProvider.getKeyboardVibration: KEYBOARD_TAP ->
PRIMITIVE_CLICK / EFFECT_CLICK, KEYBOARD_RELEASE -> EFFECT_TICK), and a
12 ms pulse at a third of full strength may not be felt on a phone whose
vibrator answers "unknown" for predefined effects, which would look like
the S23 report.

Changed: Press plays EFFECT_CLICK (20 ms pulse where unsupported); every
fallback pulse uses VibrationEffect.DEFAULT_AMPLITUDE. Release, dictation
start (click) and end (tick) keep their effects. The system's touch
intensity still scales every tap.
Removed: the fixed amplitude 80 ("light") for fallback pulses, and the tick
as the key-press effect.

Verified: testDebugUnitTest, assembleDebug and assemblePreview green;
emulator dumpsys shows Prebaked=CLICK per press (evidence in the PR).
2026-11-24 10:41:08 -05:00
..
src Android keyboard: Keyboard vibration silences Hex only where the phone has that switch (#2718) 2026-11-24 10:41:08 -05:00
build.gradle.kts android: password manager suggestions in the strip (labs) (#2695) 2026-11-24 09:10:42 -05:00
proguard-rules.pro Hex for Android: on-device dictation keyboard (#2074) 2026-11-20 17:27:17 +00:00