Add "Return to Home" feature via Shizuku#53
Open
Xitee1 wants to merge 1 commit into
Open
Conversation
New opt-in Shizuku-backed setting: when the timer expires, the service simulates a home key press (KEYCODE_HOME via the shell user service) so the launcher replaces the media app on screen. Runs only while the screen is interactive — KEYCODE_HOME would otherwise wake a sleeping device — and before the screen-off step so the launcher is what greets the user at the next unlock. Goes through Shizuku like the Wi-Fi/Bluetooth toggles because Android 10+ blocks background activity launches, so a plain startActivity with ACTION_MAIN/CATEGORY_HOME from the service would be silently dropped. The toggle is gated behind the Shizuku dialog in Settings and included in the startup permission check for enabled-but-unpermitted features. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BVM4Gpx6wa9fwwXUoP8PNh
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.
Summary
Adds a new optional timer action that returns the device to the home screen when the timer ends, implemented via Shizuku's shell execution to work around Android 10+ background activity launch restrictions.
Changes
ShizukuHomeControllerexecutesinput keyevent 3(KEYCODE_HOME) to simulate a home button pressSleepTimerServicecallsgoHome()before screen-off if the setting is enabled and Shizuku is ready; only executes while the screen is interactive to avoid waking a sleeping devicereturnToHomeboolean toUserSettingsandSettingsRepositorywith DataStore backingRETURN_HOMEtoShizukuFeatureenum for permission validation inTimerViewModelImplementation Details
https://claude.ai/code/session_01BVM4Gpx6wa9fwwXUoP8PNh