Fix controls: prevent duplicate bindings#20749
Merged
mikehardy merged 1 commit intoankidroid:mainfrom Apr 19, 2026
Merged
Conversation
david-allison
approved these changes
Apr 15, 2026
Member
david-allison
left a comment
There was a problem hiding this comment.
Really solid, thank you!!
3e22644 to
5d6a28f
Compare
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.
Purpose / Description
This PR fixes the following bug: In Controls, it is currently possible to end up with conflicting bindings.
For instance, if you
you end up with "swipe down" assigned to both "Toggle orange -> A" and "Toggle green -> BOTH", i.e. duplicate bindings. This happens because we're only removing a single conflicting binding.
Fixes
Approach
When we add a new binding, instead of removing a single conflicting binding, we now retrieve for and remove all conflicting bindings. I did this by introducing a couple of helpers:
getPreferencesAssignedTo()andremoveDuplicateBindings().After the fix, the steps above don't produce duplicates anymore:
Screen_recording_20260415_143803.mp4
How Has This Been Tested?
I manually tried various combinations of gesture/key assignments on my physical device.
I ran:
Checklist
UI Changes: You have tested your change using the Google Accessibility ScannerNA