Files
swiftcontrol/android
Jonas Bark c7b89a6059 fix(shift-feedback): Android sound follows media volume, vibration via Vibrator service
Two Android reports from the first device test:

Sound was only audible with the ringer on. The audio attributes used
usage=assistanceSonification, which Android routes to STREAM_SYSTEM — muted
in silent/vibrate mode. Now usage=media (STREAM_MUSIC), i.e. it follows the
media volume like the trainer app's own audio.

Vibration never fired. Flutter's HapticFeedback is View.performHapticFeedback,
which obeys the system "touch feedback" setting (off by default on many
devices) and is a no-op unless our window is focused — mid-ride BikeControl
sits behind the trainer app or its overlay. Android now goes through a small
method channel (ShiftHapticsChannel.kt) into the Vibrator service with
predefined effects (heavy click / click / double click, with pre-Q
fallbacks); VIBRATE permission added. The foreground service keeps the
process eligible under Android 12+'s background-vibration rule. iOS keeps
the impact generators.

PlatformShiftHaptics now keys off defaultTargetPlatform so the routing is
unit-tested per platform, and the HomeExtras test covers both the desktop
and phone toggle layouts.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-15 13:42:12 +02:00
..
2025-03-26 15:41:06 +01:00
2025-03-26 15:41:06 +01:00
2026-06-10 11:09:35 +02:00
2026-01-19 11:01:42 +01:00