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="TF Config for AdServices Ui Cts test">
18    <!-- For this test suite to get picked up in presubmit -->
19    <option name="config-descriptor:metadata" key="mainline-param"
20            value="com.google.android.extservices.apex" />
21
22    <!-- Prevent test from running on Android T+ -->
23    <object type="module_controller"
24            class="com.android.tradefed.testtype.suite.module.MaxSdkModuleController">
25        <option name="max-sdk-level" value="32"/>
26    </object>
27
28    <!-- Prevent tests from running on Android R- -->
29    <object type="module_controller"
30            class="com.android.tradefed.testtype.suite.module.Sdk31ModuleController"/>
31
32    <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"/>
33
34    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
35        <option name="run-command" value="device_config set_sync_disabled_for_tests persistent"/>
36        <option name="teardown-command" value="device_config set_sync_disabled_for_tests none"/>
37
38        <option name="run-command" value="setprop log.tag.adservices VERBOSE" />
39        <option
40            name="run-command"
41            value="setprop debug.adservices.consent_notification_debug_mode false"/>
42        <option
43            name="run-command"
44            value="device_config put adservices ui_ota_strings_feature_enabled false"/>
45        <option
46            name="run-command"
47            value="device_config put adservices is_eea_device_feature_enabled true"/>
48        <option
49            name="run-command"
50            value="device_config put adservices is_eea_device true"/>
51        <option
52            name="run-command"
53            value="device_config put adservices ga_ux_enabled true"/>
54        <option
55            name="run-command"
56            value="setprop debug.adservices.consent_notification_debug_mode true"/>
57        <option
58            name="run-command"
59            value="device_config put adservices consent_already_interacted_fix_enable false"/>
60        <option name="run-command" value="device_config put adservices global_kill_switch false"/>
61        <option name="run-command" value="device_config put adservices enable_back_compat true"/>
62        <option
63            name="run-command"
64            value="device_config put adservices adservice_enable_status true"/>
65        <option
66            name="run-command"
67            value="device_config put adservices adservice_enabled true"/>
68        <option
69            name="run-command"
70            value="device_config put adservices enable_ad_services_system_api false"/>
71        <!-- override scheduling params so the test is unaffected by time of the day -->
72        <option
73            name="run-command"
74            value="device_config put adservices consent_notification_interval_begin_ms 0"/>
75        <!-- end of day (24 hours) -->
76        <option
77            name="run-command"
78            value="device_config put adservices consent_notification_interval_end_ms 86400000"/>
79        <option
80            name="run-command"
81            value="device_config put adservices consent_notification_minimal_delay_before_interval_ends 0"/>
82    </target_preparer>
83
84    <target_preparer class="com.android.tradefed.targetprep.RebootTargetPreparer">
85        <option name="pre-reboot" value="true"/>
86    </target_preparer>
87    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
88        <option name="run-command" value="am wait-for-broadcast-idle"/>
89    </target_preparer>
90
91    <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
92        <option name="cleanup-apks" value="true"/>
93        <option name="test-file-name" value="AdExtServicesGaUxDebugChannelApiOffTest.apk"/>
94    </target_preparer>
95
96    <metrics_collector class="com.android.tradefed.device.metric.FilePullerLogCollector">
97        <option name="directory-keys" value="/sdcard/Documents/adservices-tests" />
98        <option name="clean-up" value="false" />
99        <option name="collect-on-run-ended-only" value="true" />
100    </metrics_collector>
101
102    <metrics_collector class="com.android.tradefed.device.metric.FilePullerLogCollector">
103        <option name="directory-keys" value="/data/system/files" />
104        <option name="clean-up" value="false" />
105        <option name="collect-on-run-ended-only" value="true" />
106    </metrics_collector>
107
108    <test class="com.android.tradefed.testtype.AndroidJUnitTest">
109        <option name="package" value="com.android.adservices.tests.ui.gaux.debugchannel"/>
110    </test>
111
112    <object type="module_controller"
113            class="com.android.tradefed.testtype.suite.module.MainlineTestModuleController">
114        <option name="mainline-module-package-name" value="com.google.android.extservices"/>
115    </object>
116</configuration>
117