Skip to content

AppCleaner/AppControl: Improve performance of accessibility service based actions - #1668

Merged
d4rken merged 4 commits into
mainfrom
appcleaner-acs-hyperos-performance
Apr 7, 2025
Merged

AppCleaner/AppControl: Improve performance of accessibility service based actions#1668
d4rken merged 4 commits into
mainfrom
appcleaner-acs-hyperos-performance

Conversation

@d4rken

@d4rken d4rken commented Apr 3, 2025

Copy link
Copy Markdown
Member

The new Security app (com.miui.securitycenter) on HyperOS2 poses new challenges. SD Maid has to wait for the animation of BottomSheetDialog to settle to press "Clear cache". The previous approach of iterating through events via the stepper was not powerful enough. We need to wait until the coordinates of the target Button are no longer changing, only then is the animation done. Tracking the moving button was not possible in the way the Spec+Stepper logic was setup before.

We need to give specifics specs (i.e. here the HyperOS spec) the ability to wait, block and loop through events on their own. This makes the stepper tool a bit more dump and moves more of the logic into the spec classes.

Now each spec provides the stepper with a function that gets a stepper context and that function is only called once by the stepper. The function only returns when its conditions are fulfilled, whether that is done by polling or not is up to each ROM specific spec.

This improves performance for all ROM types as we no longer poll the windowRoot to check all nodes. Instead we now react to window events, and then check the windowRoot. Less delay based, more event based.

The new Security app (`com.miui.securitycenter`) on HyperOS2 poses new challenges.
SD Maid has to wait for the animation of BottomSheetDialog to settle.
The previous approach of iterating through events via the stepper was not powerful enough.
We need to wait until the coordinates of the target Button are no longer changing, only then is the animation done.
Tracking the moving button was not possible in the way the Spec+Stepper logic was setup before.

We need to give specifics specs (i.e. here the HyperOS spec) the ability to wait, block and loop through events on their own.
This makes the stepper tool a bit more dump and moves more of the logic into the spec classes.

Now each spec provides the stepper with a function that gets a stepper context and that function is only called once by the stepper.
The function only returns when its conditions are fulfilled, whether that is done by polling or not is up to each ROM specific spec.

This improves performance for all ROM types as we no longer poll the windowRoot to check all nodes.
Instead we now react to window events, and then check the `windowRoot`.
Less delay based, more event based.
@d4rken d4rken added enhancement New feature, request, improvement or optimization c: AppCleaner c: AppControl Automation Accessibility service related (ACS) labels Apr 3, 2025
@d4rken
d4rken force-pushed the appcleaner-acs-hyperos-performance branch from bdf41f5 to 987fbe6 Compare April 7, 2025 21:00
@d4rken
d4rken marked this pull request as ready for review April 7, 2025 21:20
@d4rken
d4rken merged commit 6607be4 into main Apr 7, 2025
@d4rken
d4rken deleted the appcleaner-acs-hyperos-performance branch April 7, 2025 21:20
@d4rken d4rken added the ROM: HyperOS Xiaomi, Redmi etc. label May 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Automation Accessibility service related (ACS) c: AppCleaner c: AppControl enhancement New feature, request, improvement or optimization ROM: HyperOS Xiaomi, Redmi etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant