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 functional multi users SafetyCenter test cases">
18
19    <object
20        class="com.android.tradefed.testtype.suite.module.Sdk33ModuleController"
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="no_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="SafetyCenterFunctionalMultiUsersTestCases.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    <test class="com.android.tradefed.testtype.AndroidJUnitTest">
55        <option name="package" value="android.safetycenter.functional.multiusers"/>
56        <option name="exclude-annotation" value="org.junit.Ignore"/>
57        <option name="runtime-hint" value="5m"/>
58    </test>
59</configuration>
60