Repository navigation
Fix volume shortcut with stale preferred flashlight levels - #148
Merged
cyb3rko merged 2 commits intoAug 11, 2026
Merged
Conversation
isaacweber613
marked this pull request as ready for review
August 2, 2026 16:15
cyb3rko
force-pushed
the
agent/fix-stale-preferred-level
branch
from
August 11, 2026 21:16
acb44be to
0d0ee14
Compare
Owner
|
@isaacweber613 Thank you! |
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.
Problem
FlashDim can keep a preferred flashlight level that the current device no longer supports. This can happen in two common ways:
This creates a particularly confusing failure in the volume-button shortcut:
The shortcut's on-path passes the stale preferred level to
turnOnTorchWithStrengthLevel(), which rejects a level above the device's current maximum. The off-path does not pass a strength level, so it continues to work.What changed
This preserves the user's linked-level setting while preventing an old or restored value from breaking flashlight activation.
Related issue
Addresses the stale
45versus new21level failure reported in #146.Validation
Tested with the upstream app on an Android 17 / API 37 Pixel 10 Pro XL emulator profile using simultaneous kernel-level volume-up and volume-down events.
Baseline reproduction with preferred level
45and current maximum10:Both volume buttons pressed, but the flashlight stayed off.Patched behavior with the same stale
45preference:10.45to10.:app:assembleDebugcompleted successfully.