feat: Implement per-app refresh rate - #564
Open
Mudit200408 wants to merge 2 commits into
Open
Conversation
- Improve app detection accuracy and filter system noise
sameerasw
self-requested a review
August 2, 2026 08:08
sameerasw
requested changes
Aug 2, 2026
sameerasw
left a comment
Owner
There was a problem hiding this comment.
Hi! Can you take a look at these concerns?
Potential Issues & Suggestions
1. Shell Execution Overhead on Main Thread during App Switching
- Location:
AppFlowHandler.ktlines incheckPerAppRefreshRate() - Issue:
RefreshRateUtils.applyFixedRefreshRate()andapplyDynamicRefreshRate()runShellUtils.runCommand(...)directly on the thread callingcheckPerAppRefreshRate(). - Detail:
ShellUtils.runCommandexecutessu/shizukushell commands synchronously. Running up to 4 shell commands (settings put system...,settings put global...) per app switch can freeze window transitions or cause noticeable UI latency during app launches. - Recommendation: Run
RefreshRateUtilsshell commands inside a backgroundCoroutineScope(Dispatchers.IO)worker thread to prevent main thread blocking.
2. State Leak if Accessibility / App Detection Service is Stopped
- Location:
AppFlowHandler.kt - Issue: If the service crashes or is stopped while a per-app refresh rate is active,
restoreFromSnapshot()is never called, leaving the device locked at the custom refresh rate (e.g. 60Hz fixed). - Recommendation: Implement a cleanup hook on service destroy (
onDestroy()) that checks ifperAppRateSnapshot != nulland invokesrestoreFromSnapshot().
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.
No description provided.