Skip to content

AppCleaner: Fix finding of "Clear Cache" button on Android 16 Beta Q1#1796

Merged
d4rken merged 1 commit into
mainfrom
appcleaner-acs-android-16-aosp
May 25, 2025
Merged

AppCleaner: Fix finding of "Clear Cache" button on Android 16 Beta Q1#1796
d4rken merged 1 commit into
mainfrom
appcleaner-acs-android-16-aosp

Conversation

@d4rken

@d4rken d4rken commented May 21, 2025

Copy link
Copy Markdown
Member

The "Clear Cache" button may be a LinearLayout containing the text label on some AOSP variants. This commit adds logic to find the clickable parent in such cases. Overall this aligns the "Clear cache" button layout with that of the "Force stop" button.

Fixes #1794

The "Clear Cache" button may be a LinearLayout containing the text label on some AOSP variants.
This commit adds logic to find the clickable parent in such cases.
Overall this aligns the "Clear cache" button layout with that of the "Force stop" button.

Fixes #1794
@d4rken d4rken added bug Something isn't working as expected c: AppCleaner Automation Accessibility service related (ACS) ROM: AOSP AOSP or close to AOSP. api: 36 A16 (Baklava) labels May 21, 2025
@d4rken d4rken marked this pull request as ready for review May 25, 2025 14:04
@d4rken

d4rken commented May 25, 2025

Copy link
Copy Markdown
Member Author

Confirmed on a Pixel 8 flashed to 16Q1:

16:02:50.046 SDMSE:AppCleaner:Automation:AOSP:Specs            D  clearCacheButtonLabels=[Clear cache]
16:02:50.046 SDMSE:AppCleaner:Automation:AOSP:Specs:Stepper    I  process(): Step(source=SDMSE:AppCleaner:Automation:AOSP:Specs, description=Clear cache button)
16:02:50.046 SDMSE:AppCleaner:Automation:AOSP:Specs:Stepper    I  doProcess(): context=StepContext(hostContext=AutomationContext(host=eu.darken.sdmse.automation.core.AutomationService@9da08a2), tag=SDMSE:AppCleaner:Automation:AOSP:Specs, stepAttempts=0) for Step(source=SDMSE:AppCleaner:Automation:AOSP:Specs, description=Clear cache button)
16:02:50.098 SDMSE:AppCleaner:Automation:AOSP:Specs:Stepper    I  Executing windowCheck and determining root window...
16:02:50.134 SDMSE:AppCleaner:Automation:AOSP:Specs            D  checkIdentifiers: labelRes was 0 for NormalPkg(packageName=com.topjohnwu.magisk, userHandle=UserHandle2(handleId=0))
16:02:50.140 SDMSE:AppCleaner:Automation:AOSP:Specs            V  checkIdentifiers: Looking for: [com.topjohnwu.magisk, Magisk, com.topjohnwu.magisk.core.App]
16:02:50.146 SDMSE:AppCleaner:Automation:AOSP:Specs            W  checkIdentifiers: Window check failed.
16:02:50.213 SDMSE:AppCleaner:Automation:AOSP:Specs            D  checkIdentifiers: labelRes was 0 for NormalPkg(packageName=com.topjohnwu.magisk, userHandle=UserHandle2(handleId=0))
16:02:50.214 SDMSE:AppCleaner:Automation:AOSP:Specs            V  checkIdentifiers: Looking for: [com.topjohnwu.magisk, Magisk, com.topjohnwu.magisk.core.App]
16:02:50.216 SDMSE:AppCleaner:Automation:AOSP:Specs            I  checkIdentifiers: Passed ('Magisk' on text='Magisk', class=android.widget.TextView, clickable=false, checkable=false enabled=true, id=com.android.settings:id/entity_header_title pkg=com.android.settings, identity=f632598, bounds=Rect(453, 489 - 627, 566))
16:02:50.216 SDMSE:AppCleaner:Automation:AOSP:Specs            V  Check passed after event EventType: TYPE_WINDOW_CONTENT_CHANGED; EventTime: 2621351; PackageName: com.android.settings; MovementGranularity: 0; Action: 0; ContentChangeTypes: []; WindowChangeTypes: [] [ ClassName: android.view.View; Text: []; ContentDescription: null; ItemCount: -1; CurrentItemIndex: -1; Enabled: true; Password: false; Checked: false; FullScreen: false; Scrollable: false; ImportantForAccessibility: true; AccessibilityDataSensitive: false; BeforeText: null; FromIndex: -1; ToIndex: -1; ScrollX: 0; ScrollY: 0; MaxScrollX: 0; MaxScrollY: 0; ScrollDeltaX: -1; ScrollDeltaY: -1; AddedCount: -1; RemovedCount: -1; ParcelableData: null; DisplayId: 0 ]; recordCount: 0, root is android.view.accessibility.AccessibilityNodeInfo@80006ce0; boundsInParent: Rect(0, 0 - 1080, 2400); boundsInScreen: Rect(0, 0 - 1080, 2400); boundsInWindow: Rect(0, 0 - 1080, 2400); packageName: com.android.settings; className: android.widget.FrameLayout; text: null; error: null; maxTextLength: -1; stateDescription: null; contentDescription: null; tooltipText: null; containerTitle: null; viewIdResName: null; uniqueId: null; checkable: false; checked: false; focusable: false; focused: false; selected: false; clickable: false; longClickable: false; contextClickable: false; enabled: true; password: false; scrollable: false; granularScrollingSupported: false; importantForAccessibility: true; visible: true; actions: [AccessibilityAction: ACTION_SELECT - null, AccessibilityAction: ACTION_CLEAR_SELECTION - null, AccessibilityAction: ACTION_ACCESSIBILITY_FOCUS - null, AccessibilityAction: ACTION_SHOW_ON_SCREEN - null]; isTextSelectable: false
16:02:50.216 SDMSE:AppCleaner:Automation:AOSP:Specs:Stepper    I  Target root window node is text='null', class=android.widget.FrameLayout, clickable=false, checkable=false enabled=true, id=null pkg=com.android.settings, identity=3f395d9, bounds=Rect(0, 0 - 1080, 2400)
16:02:50.218 SDMSE:AppCleaner:Automation:AOSP:Specs:Stepper    I  Executing nodeAction... eu.darken.sdmse.automation.core.common.stepper.StepContext.() -> kotlin.Boolean
16:02:50.343 SDMSE:AppCleaner:Automation:AOSP:Specs            D  Potential target is text='Clear cache', class=android.widget.TextView, clickable=true, checkable=false enabled=true, id=com.android.settings:id/text2 pkg=com.android.settings, identity=3e7e5f6, bounds=Rect(852, 857 - 1072, 912)
16:02:50.344 SDMSE:AppCleaner:Automation:AOSP:Specs            V  isClickable? text='null', class=android.widget.LinearLayout, clickable=true, checkable=false enabled=true, id=com.android.settings:id/action2 pkg=com.android.settings, identity=ffb6464, bounds=Rect(724, 694 - 1201, 912)
16:02:50.344 SDMSE:AppCleaner:Automation:AOSP:Specs            D  Target is clickable parent
16:02:50.344 SDMSE:AppCleaner:Automation:AOSP:Specs            D  Clicking 'Clear cache' target text='null', class=android.widget.LinearLayout, clickable=true, checkable=false enabled=true, id=com.android.settings:id/action2 pkg=com.android.settings, identity=ffb6464, bounds=Rect(724, 694 - 1201, 912) for NormalPkg(packageName=com.topjohnwu.magisk, userHandle=UserHandle2(handleId=0)):
16:02:50.345 SDMSE:AppCleaner:Automation:AOSP:Specs            V  clickNormal(isDryRun=false): Clicking on text='null', class=android.widget.LinearLayout, clickable=true, checkable=false enabled=true, id=com.android.settings:id/action2 pkg=com.android.settings, identity=ffb6464, bounds=Rect(724, 694 - 1201, 912)
16:02:50.361 SDMSE:AppCleaner:Automation:AOSP:Specs:Stepper    I  nodeAction was successful :)
16:02:50.361 SDMSE:AppCleaner:Automation:AOSP:Specs:Stepper    I  Step finished successfully after 315ms

@d4rken d4rken merged commit 3873846 into main May 25, 2025
@d4rken d4rken deleted the appcleaner-acs-android-16-aosp branch May 25, 2025 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: 36 A16 (Baklava) Automation Accessibility service related (ACS) bug Something isn't working as expected c: AppCleaner ROM: AOSP AOSP or close to AOSP.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automation error with Android 16 Q1

1 participant