Repository navigation
Conversation
jawzf
force-pushed
the
feat/012-power-button-remap
branch
from
October 21, 2026 07:39
17e2c98 to
8db0d1d
Compare
jawzf
force-pushed
the
feat/012-power-button-remap
branch
from
October 23, 2026 12:30
8db0d1d to
ffac88d
Compare
Button Remap now starts with a button picker (Volume up, Volume down, Power) above the Screen off / Screen on picker. Double press keeps Android's own camera gesture. An optional "Flip camera with double press" switches between front and back cameras while a camera app is open, using camera availability to tell whether a camera was in use at the first press. Press and hold is set per screen state: Digital assistant, Power menu or Custom actions. Matching system choices stay with Android; otherwise Essentials reads the power key through Shizuku or root and runs the choice itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jawzf
force-pushed
the
feat/012-power-button-remap
branch
from
October 24, 2026 17:17
ffac88d to
0fbdb95
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.
Description
Adds the Power button to Button Remap. The screen now starts with a button picker (Volume Up | Volume Down | Power) above the Screen Off | Screen On picker. The volume keys work as before.
Power has two sections:
How it works:
power_button_long_press(5 assistant, 1 power menu) and Android does the rest. When the states differ or Custom actions is picked, it sets it to 0 and runs the hold itself. This needs WRITE_SECURE_SETTINGS; the permission sheet shows otherwise. Turning Button Remap off puts the assistant back, but only if Essentials changed it.getevent -plfinds every device withKEY_POWER.PowerPressDetectorreports a double press (300 ms window) or a hold (500 ms). The listener only runs with the screen on when a hold is handled by Essentials or camera flip is on.KEYCODE_ASSIST, which opens the default assistant like Android does (ACTION_ASSISTshowed a chooser). Power menu opens the power dialog. Custom actions runs the list and puts the screen back the way it was, since Android still toggles the screen on the press.CameraManager.AvailabilityCallbackkeeps the last few camera sessions (lens, opened, closed). If a camera was in use at the first press, Essentials waits for Android to reopen it. If it's still on the same lens, Essentials clicks the app's flip button through accessibility, found by view id (camera_switch, …) or description ("Switch camera", …). If no camera was open at the first press, it does nothing, and if no button is found, nothing happens. The toggle says it may not work in every camera app.Limits:
Type of change
UI changes
The button picker above the screen picker, and the Power tab: Double press with the flip toggle, Press and hold with its choices.
Checklist
develop(notmain)../gradlew assembleDebug(andassembleRelease)../gradlew testDebugUnitTest(new:PowerButtonGesturesTest,PowerGestureTrackerTest,InputDeviceScannerTest,CameraFlipButtonTest).SettingsRepositorykeys and getters/setters.FeatureRegistry.kt: "Flip camera with double press" and the Power press and hold options are in search and open Button Remap on the Power tab.RoundedCardContainer,SegmentedPicker,RemapActionItem,IconToggleItem,ActionSequenceEditorand the existing permission sheet.strings.xml(English only); icons arerounded_*drawables.🤖 Generated with Claude Code