AppCleaner: Add fallback strategies for clearing cache on Android 16 Beta 1#2057
Draft
AppCleaner: Add fallback strategies for clearing cache on Android 16 Beta 1#2057
Conversation
Add `contentDescription` property to the `ACSNodeInfo` interface and its implementations. This allows automation logic to match nodes by their content description in addition to their text.
Refactors the "Clear cache" button finding logic on AOSP. Adds multiple fallback mechanisms for modern Android versions (API 36+) where the button might not be found via accessibility text. Strategies, in order: 1. Find by accessibility text (legacy). 2. Find by content description (new for API 36+). 3. Attempt keyboard D-pad navigation (requires Root/ADB). Only the key input injection via ADB/Root is a possibly workaround for #2056 so far. Didn't find a way with out elevated permissions so far. Gesture click simulation didn't work.
Extends the Android 16 Beta fallback strategies with: - InputInjector.tap(x, y) for coordinate-based clicking via shell - UiDumper for parsing UI hierarchy via `uiautomator dump` - Query methods for finding nodes by text, content-desc, resource-id Note: UiDumper cannot be used during automation as uiautomator conflicts with the accessibility service (causes service unbind). Code retained for debugging and future standalone use cases. Keyboard navigation remains the working fallback for API 36+ where Clear cache button has NAF=true (hidden from accessibility).
bc6d7ce to
7378669
Compare
7378669 to
f790bd8
Compare
Add `application = TestApplication::class` to `@Config` annotation in UiNodeExtensionsTest to fix CI test failures. Without this config, Robolectric tests can crash the JVM test executor.
Restore UiDumperTest.kt with the proper `application = TestApplication::class` in the `@Config` annotation. The original test was removed due to CI failures caused by this missing configuration.
This reverts commit c9f01cf.
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.
Refactors the "Clear cache" button finding logic on AOSP. Adds multiple fallback mechanisms for modern Android versions (API 36+) where the button might not be found via accessibility text.
Strategies, in order:
Gesture click simulation didn't work.
I also tried via UIAutomator but that conflicts with the accessibility service.
Only the key input injection via ADB/Root is currently a possibly workaround for #2056 so far.
Didn't find a way with out elevated permissions so far.☹️
Root users won't need accessibility service anyways. If this is "working as intended" 🫠 then at least ADB access (Shizuku etc.) will be required going forward...