1<?xml version="1.0" encoding="utf-8"?>
2<!--
3  ~ Copyright (C) 2023 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 CTS AdServices test cases in ExtServices">
18    <option name="test-suite-tag" value="cts"/>
19    <option name="config-descriptor:metadata" key="component" value="framework"/>
20    <option name="config-descriptor:metadata" key="parameter" value="not_instant_app"/>
21    <option name="config-descriptor:metadata" key="parameter" value="not_multi_abi"/>
22    <option name="config-descriptor:metadata" key="parameter" value="secondary_user"/>
23
24    <!-- Prevent test from running on Android T+ -->
25    <object type="module_controller"
26            class="com.android.tradefed.testtype.suite.module.MaxSdkModuleController">
27        <option name="max-sdk-level" value="32"/>
28    </object>
29
30    <!-- Prevent tests from running on Android Q- -->
31    <object type="module_controller"
32            class="com.android.tradefed.testtype.suite.module.Sdk30ModuleController"/>
33
34    <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
35        <option name="cleanup-apks" value="true"/>
36        <option name="test-file-name" value="CtsAdExtServicesDeviceTestCases.apk"/>
37    </target_preparer>
38    <target_preparer class="com.android.tradefed.targetprep.RebootTargetPreparer">
39        <option name="pre-reboot" value="true"/>
40    </target_preparer>
41    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
42        <option name="run-command" value="am wait-for-broadcast-idle"/>
43    </target_preparer>
44    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
45        <option name="run-command" value="setprop log.tag.adservices VERBOSE"/>
46        <option name="run-command" value="setprop log.tag.adservices.topics VERBOSE"/>
47        <option name="run-command" value="setprop log.tag.adservices.fledge VERBOSE"/>
48        <option name="run-command" value="setprop log.tag.adservices.measurement VERBOSE"/>
49        <!-- Disable kill switches to ignore the effect of actual PH values. -->
50        <option name="run-command" value="device_config put adservices global_kill_switch false"/>
51        <option name="run-command" value="device_config put adservices enable_back_compat true"/>
52
53        <option name="run-command"
54                value="device_config put adservices fledge_select_ads_kill_switch false"/>
55        <option name="run-command"
56                value="device_config put adservices fledge_custom_audience_service_kill_switch false"/>
57
58        <!-- Override Consent notification to debug mode to grant user consent -->
59        <option name="run-command"
60                value="setprop debug.adservices.consent_notified_debug_mode true"/>
61        <option name="teardown-command"
62                value="setprop debug.adservices.consent_notified_debug_mode false"/>
63
64        <!-- Override Consent Manager to debug mode to grant user consent -->
65        <option name="run-command"
66                value="setprop debug.adservices.consent_manager_debug_mode true"/>
67        <option name="teardown-command"
68                value="setprop debug.adservices.consent_manager_debug_mode false"/>
69
70        <!-- Override MDD background job to avoid race condition. -->
71        <option name="run-command"
72                value="device_config put adservices mdd_background_task_kill_switch true"/>
73        <option name="teardown-command"
74                value="device_config put adservices mdd_background_task_kill_switch false"/>
75
76        <!-- Force enable enrollment checks for FLEDGE when testing enrollment -->
77        <option name="run-command"
78                value="device_config put adservices disable_fledge_enrollment_check false"/>
79
80        <!-- Increase the allowed API queries per second -->
81        <option name="run-command"
82                value="device_config put adservices sdk_request_permits_per_second 100000"/>
83        <option name="teardown-command"
84                value="device_config put adservices sdk_request_permits_per_second 1"/>
85
86        <!-- Temporarily disable Device Config sync -->
87        <option name="run-command" value="device_config set_sync_disabled_for_tests persistent"/>
88        <option name="teardown-command" value="device_config set_sync_disabled_for_tests none"/>
89
90        <!-- Temporarily enable enrollment seed for testing -->
91        <option name="run-command"
92                value="device_config put adservices enable_enrollment_test_seed true" />
93        <option name="teardown-command"
94                value="device_config put adservices enable_enrollment_test_seed false" />
95
96        <!-- Disable Register Ad Beacon Feature -->
97        <option name="run-command"
98                value="device_config put adservices fledge_register_ad_beacon_enabled false"/>
99    </target_preparer>
100
101    <test class="com.android.tradefed.testtype.AndroidJUnitTest" >
102        <option name="package" value="android.adextservices.cts"/>
103    </test>
104
105    <object type="module_controller"
106            class="com.android.tradefed.testtype.suite.module.MainlineTestModuleController" >
107        <option name="mainline-module-package-name" value="com.google.android.extservices"/>
108    </object>
109    <option name="config-descriptor:metadata" key="mainline-param"
110            value="com.google.android.extservices.apex"/>
111</configuration>
112
113