AppCleaner: Fix finding of "Clear Cache" button on Android 16 Beta Q1#1796
Merged
Conversation
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
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 |
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 "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