Repository navigation
AppControl: Improve "Force Stop" button detection on Android 16+ - #1928
Merged
Merged
Conversation
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) ```
Member
Author
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.
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.

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.