Advanced Power Menu v2.0
This release significantly improves power-menu compatibility across different Android versions and custom ROMs, strengthens Lockdown execution, and adds experimental Quick Settings support.
Lockdown improvements
-
Reworked Lockdown to use internal Android system APIs whenever possible.
-
Added a root-based fallback when the internal Lockdown implementation is unavailable or fails.
-
The root fallback now mirrors the internal implementation by:
- Requiring strong authentication after lockdown.
- Immediately locking the device.
- Locking enabled managed and secondary profiles when supported.
-
Improved failure handling.
-
Added compatibility handling for differences in hidden LockSettings, WindowManager, UserManager, and TrustManager APIs.
Improved power-menu hook compatibility
-
Expanded the power-menu interception chain to support more Android versions and ROM implementations.
-
Added support for multiple fallback hook points:
PhoneWindowManager.showGlobalActions()PhoneWindowManager.showGlobalActionsInternal()PhoneWindowManager.powerLongPress()GlobalActions.showDialog()
-
Added support for both modern
powerLongPress(long eventTime)and legacy no-argument implementations. -
Fixed an issue on older Android versions where the device could go to sleep after releasing the power button.
-
Added direct long-press haptic feedback for the final compatibility fallback.
-
Improved compatibility with ROMs where the standard Power + Volume Up interception path is unavailable or modified.
-
Hook initialization failures are now isolated so one unsupported hook no longer prevents the remaining compatibility hooks from being installed.
Experimental Quick Settings support
- Added an optional Replace QS Power Menu setting.
- The Advanced Power Menu can now replace the stock power menu opened from the Quick Settings power button.
- Uses the SystemUI Global Actions dialog entry point instead of depending directly on ROM-specific footer layouts.
- Separates Quick Settings invocations from regular power-button invocations using the expandable animation source.
- The Disable on lock screen setting now also applies to Quick Settings.
- Added an additional SystemUI keyguard-state check for ROMs that provide an incorrect or incomplete keyguard value to the Global Actions dialog.
- Compatibility may vary on ROMs with heavily customized SystemUI implementations.
Reliability and security improvements
- Improved duplicate-display prevention and dialog lifecycle handling.
- Improved communication between SystemUI and
system_server. - Restricted internal power-action requests and added validation for pending action results.
- Root fallback commands are now limited to known supported operations instead of accepting arbitrary command strings.
- Improved result matching and timeout handling to prevent stale fallback requests from being executed.
- Settings continue to update dynamically through cached preferences without normally requiring a reboot or SystemUI restart.
Other changes
- Added a setting to always force the use of the fallback that employs root privileges.
- Improved detailed logging for hook installation, invocation paths, keyguard handling, and fallback execution.
- Various compatibility and stability fixes across Android versions.