Skip to content

Conversation

@d4rken
Copy link
Member

@d4rken d4rken commented Aug 31, 2025

Enhances the logic for locating the "Force Stop" button within the AOSP AppControl automation.

On Android 16 (API 35) and higher, if the initial attempt to find a clickable parent for the "Force Stop" text label fails, the system will now attempt to find a clickable sibling element immediately preceding the text label. This change addresses a layout variation observed on Pixel devices running Android 16 beta, where the "Force Stop" button and its label are separate sibling views.

------6: text='null', class=android.widget.ScrollView, clickable=false, checkable=false enabled=true, id=null pkg=com.android.settings, identity=89d31bd, bounds=Rect(0, 27 - 1080, 2427)
-------7: text='CAPod', class=android.widget.TextView, clickable=false, checkable=false enabled=true, id=null pkg=com.android.settings, identity=10a5457, bounds=Rect(448, 579 - 633, 652)
-------7: text='null', class=android.widget.Button, clickable=true, checkable=false enabled=false, id=null pkg=com.android.settings, identity=5d5c9d6, bounds=Rect(114, 726 - 303, 873)
-------7: text='Archive', class=android.widget.TextView, clickable=false, checkable=false enabled=true, id=null pkg=com.android.settings, identity=9bdb9f1, bounds=Rect(142, 889 - 276, 936)
-------7: text='null', class=android.widget.Button, clickable=true, checkable=false enabled=true, id=null pkg=com.android.settings, identity=b2b3d98, bounds=Rect(446, 726 - 635, 873)
-------7: text='Uninstall', class=android.widget.TextView, clickable=false, checkable=false enabled=true, id=null pkg=com.android.settings, identity=8e97b7b, bounds=Rect(465, 889 - 617, 936)
-------7: text='null', class=android.widget.Button, clickable=true, checkable=false enabled=true, id=null pkg=com.android.settings, identity=ad2470a, bounds=Rect(778, 726 - 967, 873)
-------7: text='Force stop', class=android.widget.TextView, clickable=false, checkable=false enabled=true, id=null pkg=com.android.settings, identity=adddb75, bounds=Rect(780, 889 - 965, 936)

d4rken added 2 commits August 31, 2025 18:03
This commit enhances the logic for locating the "Force Stop" button within the AOSP AppControl automation.

On Android 16 (API 35) and higher, if the initial attempt to find a clickable parent for the "Force Stop" text label fails, the system will now attempt to find a clickable sibling element immediately preceding the text label. This change addresses a layout variation observed on Pixel devices running Android 16 beta, where the "Force Stop" button and its label are separate sibling views.

```java
------6: text='null', class=android.widget.ScrollView, clickable=false, checkable=false enabled=true, id=null pkg=com.android.settings, identity=89d31bd, bounds=Rect(0, 27 - 1080, 2427)
-------7: text='CAPod', class=android.widget.TextView, clickable=false, checkable=false enabled=true, id=null pkg=com.android.settings, identity=10a5457, bounds=Rect(448, 579 - 633, 652)
-------7: text='null', class=android.widget.Button, clickable=true, checkable=false enabled=false, id=null pkg=com.android.settings, identity=5d5c9d6, bounds=Rect(114, 726 - 303, 873)
-------7: text='Archive', class=android.widget.TextView, clickable=false, checkable=false enabled=true, id=null pkg=com.android.settings, identity=9bdb9f1, bounds=Rect(142, 889 - 276, 936)
-------7: text='null', class=android.widget.Button, clickable=true, checkable=false enabled=true, id=null pkg=com.android.settings, identity=b2b3d98, bounds=Rect(446, 726 - 635, 873)
-------7: text='Uninstall', class=android.widget.TextView, clickable=false, checkable=false enabled=true, id=null pkg=com.android.settings, identity=8e97b7b, bounds=Rect(465, 889 - 617, 936)
-------7: text='null', class=android.widget.Button, clickable=true, checkable=false enabled=true, id=null pkg=com.android.settings, identity=ad2470a, bounds=Rect(778, 726 - 967, 873)
-------7: text='Force stop', class=android.widget.TextView, clickable=false, checkable=false enabled=true, id=null pkg=com.android.settings, identity=adddb75, bounds=Rect(780, 889 - 965, 936)
```
@d4rken d4rken added bug Something isn't working as expected c: AppControl Automation Accessibility service related (ACS) ROM: AOSP AOSP or close to AOSP. labels Aug 31, 2025
@d4rken
Copy link
Member Author

d4rken commented Aug 31, 2025

Screenshot 2025-08-31 at 18 29 06

This commit consolidates test setup into a new `setupTests()` extension function.

This function now also configures:
- `maxHeapSize` to "2048m"
- `maxParallelForks` to 2
- `forkEvery` to 100

This improves consistency and potentially speeds up test execution by enabling parallel forks.
This commit enhances the test logging output to provide a clearer and more informative summary of test executions.

Key changes:
- Modified `testLogging` to only log `FAILED` and `SKIPPED` events by default, reducing noise from passed tests.
- Switched `exceptionFormat` to `SHORT` and disabled full `showStackTraces` by default for a more concise error view. Stack traces can still be seen for failures.
- Implemented a custom `TestListener` to:
    - Print a starting message for the root test suite.
    - Indicate test progress with `.` for pass, `F` for fail, and `S` for skip.
    - Collect a list of failed test names.
    - Display a detailed summary at the end of the root suite execution, including:
        - Total tests, passed, failed, and skipped counts.
        - Execution duration.
        - A list of all failed test names, if any.
        - An overall "PASSED" or "FAILED" status.
@d4rken d4rken merged commit 1b91b86 into main Sep 1, 2025
16 checks passed
@d4rken d4rken deleted the appcontrol-force-stop branch September 1, 2025 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Automation Accessibility service related (ACS) bug Something isn't working as expected c: AppControl ROM: AOSP AOSP or close to AOSP.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants