Decode merged rapid double clicks so repeated skips stack - #376
Draft
voijoi wants to merge 2 commits into
Draft
Conversation
The ring's music gestures could route to play/pause, next track or nothing; there was no way to jump backwards, which audiobook and podcast listeners need. Adds a PreviousTrack destination wired the same way as NextTrack end to end: routing enum, preference encoding, switchboard entry (SkipPrevious icon), action handler, and the expect/actual dispatch, with Android sending KEYCODE_MEDIA_PREVIOUS exactly as onNextTrack sends KEYCODE_MEDIA_NEXT and iOS a no-op to match. Written with AI assistance; reviewed and hardware-tested by the submitter on a Pixel 10 Pro with an Index ring against Listen Audiobook Player. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The ring merges rapid repeated presses into a single growing record, so six quick double clicks arrive as one twelve-Short sequence that matches no gesture and is silently dropped. Decode an all-Short sequence of 2k presses (k >= 2) as k double clicks and repeat the double click action, for directional skip destinations only since repeating play/pause would toggle it. Odd remainders are ignored rather than misfired. Field-verified against logcat on an Index ring: bursts of three and six double clicks previously produced no action at all and now produce exactly three and six skips. Written with AI assistance; reviewed and hardware-tested by the submitter on a Pixel 10 Pro with an Index ring. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The ring merges rapid repeated presses into one growing record: six quick double clicks arrive as a single twelve-Short sequence, match no gesture, and are silently dropped (logcat-verified). This decodes an all-Short sequence of 2k presses (k >= 2) as k double clicks and repeats the double-click action — directional skip destinations only, since repeating play/pause would toggle it; odd remainders are ignored rather than misfired. Unit test included alongside
GestureRoutingTest.Builds on #375 — review the top commit only; I'll rebase once that lands (draft until then).
Field-verified: bursts of three and six double clicks previously produced no action at all; they now produce exactly three and six skips.
Written with AI assistance (Claude); reviewed and hardware-tested by me on a Pixel 10 Pro + Index ring.
🤖 Generated with Claude Code