1<?xml version="1.0" encoding="utf-8"?> 2<!-- 3 ~ Copyright (C) 2022 The Android Open Source Project 4 ~ 5 ~ Licensed under the Apache License, Version 2.0 (the "License"); 6 ~ you may not use this file except in compliance with the License. 7 ~ You may obtain a copy of the License at 8 ~ 9 ~ http://www.apache.org/licenses/LICENSE-2.0 10 ~ 11 ~ Unless required by applicable law or agreed to in writing, software 12 ~ distributed under the License is distributed on an "AS IS" BASIS, 13 ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 ~ See the License for the specific language governing permissions and 15 ~ limitations under the License. 16 --> 17<configuration description="Config for SafetyCenter subpages testcases"> 18 19 <object 20 class="com.android.tradefed.testtype.suite.module.Sdk34ModuleController" 21 type="module_controller"/> 22 23 <option name="config-descriptor:metadata" key="component" value="framework"/> 24 <option name="config-descriptor:metadata" key="parameter" 25 value="not_instant_app"/> 26 <option name="config-descriptor:metadata" key="parameter" 27 value="not_multi_abi"/> 28 <option name="config-descriptor:metadata" key="parameter" 29 value="secondary_user"/> 30 <option name="config-descriptor:metadata" key="mainline-param" value="com.google.android.permission.apex" /> 31 <option name="config-descriptor:metadata" key="parameter" value="all_foldable_states" /> 32 33 <option name="test-suite-tag" value="functional"/> 34 35 <target_preparer 36 class="com.android.tradefed.targetprep.suite.SuiteApkInstaller"> 37 <option name="cleanup-apks" value="true"/> 38 <option name="test-file-name" value="SafetyCenterSubpagesTestCases.apk"/> 39 </target_preparer> 40 41 <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer"> 42 <!-- Ensure all broadcasts are dispatched prior to running our tests, to make sure they 43 aren't polluted by `BOOT_COMPLETED` or similar broadcasts still being delivered, which 44 causes our `ActivityManager#waitForBroadcastIdle()` calls to timeout. --> 45 <option name="run-command" value="am wait-for-broadcast-idle" /> 46 <option name="run-command" value="am wait-for-broadcast-barrier" /> 47 <!-- Disable syncing to prevent overwriting flags during testing. --> 48 <option name="run-command" value="device_config set_sync_disabled_for_tests persistent" /> 49 <option name="teardown-command" value="device_config set_sync_disabled_for_tests none" /> 50 <!-- Dismiss any system dialogs (e.g. crashes, ANR). --> 51 <option name="run-command" value="am broadcast -a android.intent.action.CLOSE_SYSTEM_DIALOGS --receiver-foreground" /> 52 </target_preparer> 53 54 <metrics_collector class="com.android.tradefed.device.metric.FilePullerLogCollector"> 55 <option name="directory-keys" value="/data/user/0/android.safetycenter.functional.subpages/files" /> 56 <option name="collect-on-run-ended-only" value="true" /> 57 </metrics_collector> 58 59 <test class="com.android.tradefed.testtype.AndroidJUnitTest"> 60 <option name="package" value="android.safetycenter.functional.subpages"/> 61 <option name="exclude-annotation" value="org.junit.Ignore"/> 62 <option name="runtime-hint" value="10m"/> 63 </test> 64</configuration> 65