AppCleaner/AppControl: Improve performance of accessibility service based actions - #1668
Merged
Conversation
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.
…nd `nodeTest` into `nodeAction`
d4rken
force-pushed
the
appcleaner-acs-hyperos-performance
branch
from
April 7, 2025 21:00
bdf41f5 to
987fbe6
Compare
d4rken
marked this pull request as ready for review
April 7, 2025 21:20
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.
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.