summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
author Simon Wingrove <simonjw@google.com> 2025-02-21 02:39:37 -0800
committer Simon Wingrove <simonjw@google.com> 2025-02-21 06:39:00 -0800
commit6b345e301ac290a295f756c607f3dbb6793d65ff (patch)
tree846933c222c3127b3ef536d4982f9a83e589a24c /tests
parente9359134aa8e6e9e6831031d0b23eada16bac006 (diff)
Attempt to dismiss keyguard before each SafetyCenter test
This is a belt-and-braces approach together with aosp/3504430 that should go some way to mitigating the problem in b/379620557 which might not be entirely solvable (at least for tests running mainline on top of older system images) LOW_COVERAGE_REASON=TEST_ONLY Bug: 379620557 Change-Id: I3de11df34e82ef31a5e1b7602ad946ecb94d0648 Test: atest <all the test suites> Relnote: N/A change to reduce test flakiness Flag: EXEMPT test flakiness fix
Diffstat (limited to 'tests')
-rw-r--r--tests/cts/safetycenter/AndroidTest.xml4
-rw-r--r--tests/functional/safetycenter/multiusers/AndroidTest.xml4
-rw-r--r--tests/functional/safetycenter/safetycenteractivity/AndroidTest.xml4
-rw-r--r--tests/functional/safetycenter/singleuser/AndroidTest.xml4
-rw-r--r--tests/functional/safetycenter/subpages/AndroidTest.xml4
-rw-r--r--tests/hostside/safetycenter/AndroidTest.xml4
6 files changed, 22 insertions, 2 deletions
diff --git a/tests/cts/safetycenter/AndroidTest.xml b/tests/cts/safetycenter/AndroidTest.xml
index 6d8c3069c..ed161f0b6 100644
--- a/tests/cts/safetycenter/AndroidTest.xml
+++ b/tests/cts/safetycenter/AndroidTest.xml
@@ -47,6 +47,10 @@
<!-- Disable syncing to prevent overwriting flags during testing. -->
<option name="run-command" value="device_config set_sync_disabled_for_tests persistent" />
<option name="teardown-command" value="device_config set_sync_disabled_for_tests none" />
+ <!-- Belt-and-braces attempt to dismiss keyguard. Tradefed should have already done this
+ for us, but this is a precaution in an attempt to mitigate b/379620557. -->
+ <option name="run-command" value="input keyevent KEYCODE_WAKEUP" />
+ <option name="run-command" value="wm dismiss-keyguard" />
<!-- Dismiss any system dialogs (e.g. crashes, ANR). -->
<option name="run-command" value="am broadcast -a android.intent.action.CLOSE_SYSTEM_DIALOGS --receiver-foreground" />
</target_preparer>
diff --git a/tests/functional/safetycenter/multiusers/AndroidTest.xml b/tests/functional/safetycenter/multiusers/AndroidTest.xml
index 20032357a..bfb7fdbf2 100644
--- a/tests/functional/safetycenter/multiusers/AndroidTest.xml
+++ b/tests/functional/safetycenter/multiusers/AndroidTest.xml
@@ -47,6 +47,10 @@
<!-- Disable syncing to prevent overwriting flags during testing. -->
<option name="run-command" value="device_config set_sync_disabled_for_tests persistent" />
<option name="teardown-command" value="device_config set_sync_disabled_for_tests none" />
+ <!-- Belt-and-braces attempt to dismiss keyguard. Tradefed should have already done this
+ for us, but this is a precaution in an attempt to mitigate b/379620557. -->
+ <option name="run-command" value="input keyevent KEYCODE_WAKEUP" />
+ <option name="run-command" value="wm dismiss-keyguard" />
<!-- Dismiss any system dialogs (e.g. crashes, ANR). -->
<option name="run-command" value="am broadcast -a android.intent.action.CLOSE_SYSTEM_DIALOGS --receiver-foreground" />
</target_preparer>
diff --git a/tests/functional/safetycenter/safetycenteractivity/AndroidTest.xml b/tests/functional/safetycenter/safetycenteractivity/AndroidTest.xml
index a1826653f..ee79dcd2a 100644
--- a/tests/functional/safetycenter/safetycenteractivity/AndroidTest.xml
+++ b/tests/functional/safetycenter/safetycenteractivity/AndroidTest.xml
@@ -47,6 +47,10 @@
<!-- Disable syncing to prevent overwriting flags during testing. -->
<option name="run-command" value="device_config set_sync_disabled_for_tests persistent" />
<option name="teardown-command" value="device_config set_sync_disabled_for_tests none" />
+ <!-- Belt-and-braces attempt to dismiss keyguard. Tradefed should have already done this
+ for us, but this is a precaution in an attempt to mitigate b/379620557. -->
+ <option name="run-command" value="input keyevent KEYCODE_WAKEUP" />
+ <option name="run-command" value="wm dismiss-keyguard" />
<!-- Dismiss any system dialogs (e.g. crashes, ANR). -->
<option name="run-command" value="am broadcast -a android.intent.action.CLOSE_SYSTEM_DIALOGS --receiver-foreground" />
</target_preparer>
diff --git a/tests/functional/safetycenter/singleuser/AndroidTest.xml b/tests/functional/safetycenter/singleuser/AndroidTest.xml
index af040eb6f..f778ca93e 100644
--- a/tests/functional/safetycenter/singleuser/AndroidTest.xml
+++ b/tests/functional/safetycenter/singleuser/AndroidTest.xml
@@ -47,8 +47,8 @@
<!-- Disable syncing to prevent overwriting flags during testing. -->
<option name="run-command" value="device_config set_sync_disabled_for_tests persistent" />
<option name="teardown-command" value="device_config set_sync_disabled_for_tests none" />
- <!-- TODO(b/379928062): Ensure device not on lockscreen. Reassess when keyguard bug is
- closed -->
+ <!-- Belt-and-braces attempt to dismiss keyguard. Tradefed should have already done this
+ for us, but this is a precaution in an attempt to mitigate b/379620557. -->
<option name="run-command" value="input keyevent KEYCODE_WAKEUP" />
<option name="run-command" value="wm dismiss-keyguard" />
<!-- Dismiss any system dialogs (e.g. crashes, ANR). -->
diff --git a/tests/functional/safetycenter/subpages/AndroidTest.xml b/tests/functional/safetycenter/subpages/AndroidTest.xml
index c3245e9d7..ac493841f 100644
--- a/tests/functional/safetycenter/subpages/AndroidTest.xml
+++ b/tests/functional/safetycenter/subpages/AndroidTest.xml
@@ -47,6 +47,10 @@
<!-- Disable syncing to prevent overwriting flags during testing. -->
<option name="run-command" value="device_config set_sync_disabled_for_tests persistent" />
<option name="teardown-command" value="device_config set_sync_disabled_for_tests none" />
+ <!-- Belt-and-braces attempt to dismiss keyguard. Tradefed should have already done this
+ for us, but this is a precaution in an attempt to mitigate b/379620557. -->
+ <option name="run-command" value="input keyevent KEYCODE_WAKEUP" />
+ <option name="run-command" value="wm dismiss-keyguard" />
<!-- Dismiss any system dialogs (e.g. crashes, ANR). -->
<option name="run-command" value="am broadcast -a android.intent.action.CLOSE_SYSTEM_DIALOGS --receiver-foreground" />
</target_preparer>
diff --git a/tests/hostside/safetycenter/AndroidTest.xml b/tests/hostside/safetycenter/AndroidTest.xml
index a28b70c3c..41f0bcc40 100644
--- a/tests/hostside/safetycenter/AndroidTest.xml
+++ b/tests/hostside/safetycenter/AndroidTest.xml
@@ -32,6 +32,10 @@
<!-- Disable syncing to prevent overwriting flags during testing. -->
<option name="run-command" value="device_config set_sync_disabled_for_tests persistent" />
<option name="teardown-command" value="device_config set_sync_disabled_for_tests none" />
+ <!-- Belt-and-braces attempt to dismiss keyguard. Tradefed should have already done this
+ for us, but this is a precaution in an attempt to mitigate b/379620557. -->
+ <option name="run-command" value="input keyevent KEYCODE_WAKEUP" />
+ <option name="run-command" value="wm dismiss-keyguard" />
<!-- Dismiss any system dialogs (e.g. crashes, ANR). -->
<option name="run-command" value="am broadcast -a android.intent.action.CLOSE_SYSTEM_DIALOGS --receiver-foreground" />
</target_preparer>