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