1<?xml version="1.0" encoding="utf-8"?>
2
3<!--
4  ~ Copyright (C) 2020 The Android Open Source Project
5  ~
6  ~ Licensed under the Apache License, Version 2.0 (the "License");
7  ~ you may not use this file except in compliance with the License.
8  ~ You may obtain a copy of the License at
9  ~
10  ~      http://www.apache.org/licenses/LICENSE-2.0
11  ~
12  ~ Unless required by applicable law or agreed to in writing, software
13  ~ distributed under the License is distributed on an "AS IS" BASIS,
14  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  ~ See the License for the specific language governing permissions and
16  ~ limitations under the License.
17  -->
18
19<configuration description="Config for CTS Permission UI test cases">
20
21    <option name="test-suite-tag" value="cts" />
22
23    <option name="config-descriptor:metadata" key="component" value="permissions" />
24    <option name="config-descriptor:metadata" key="parameter" value="no_foldable_states" />
25    <option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
26    <option name="config-descriptor:metadata" key="parameter" value="not_multi_abi" />
27    <option name="config-descriptor:metadata" key="parameter" value="secondary_user" />
28    <option name="config-descriptor:metadata" key="parameter" value="run_on_sdk_sandbox" />
29    <option name="config-descriptor:metadata" key="mainline-param" value="com.google.android.permission.apex" />
30
31    <object type="module_controller" class="com.android.tradefed.testtype.suite.module.Sdk30ModuleController" />
32
33    <!-- Keep screen on for Bluetooth scanning -->
34    <target_preparer class="com.android.tradefed.targetprep.DeviceSetup">
35        <option name="force-skip-system-props" value="true" /> <!-- avoid restarting device -->
36        <option name="set-global-setting" key="verifier_verify_adb_installs" value="0" />
37        <option name="restore-settings" value="true" />
38        <option name="disable-device-config-sync" value="true" />
39        <option name="screen-always-on" value="on" />
40    </target_preparer>
41
42    <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
43        <option name="cleanup-apks" value="true" />
44        <option name="test-file-name" value="CtsPermissionUiTestCases.apk" />
45    </target_preparer>
46
47    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
48        <option name="push" value="CtsAccessMicrophoneAppLocationProvider.apk->/data/local/tmp/cts-permissionui/CtsAccessMicrophoneAppLocationProvider.apk" />
49        <option name="push" value="CtsPermissionPolicyApp25.apk->/data/local/tmp/cts-permissionui/CtsPermissionPolicyApp25.apk" />
50        <option name="push" value="CtsUsePermissionApp22.apk->/data/local/tmp/cts-permissionui/CtsUsePermissionApp22.apk" />
51        <option name="push" value="CtsUsePermissionApp22CalendarOnly.apk->/data/local/tmp/cts-permissionui/CtsUsePermissionApp22CalendarOnly.apk" />
52        <option name="push" value="CtsUsePermissionApp22None.apk->/data/local/tmp/cts-permissionui/CtsUsePermissionApp22None.apk" />
53        <option name="push" value="CtsUsePermissionApp23.apk->/data/local/tmp/cts-permissionui/CtsUsePermissionApp23.apk" />
54        <option name="push" value="CtsUsePermissionApp25.apk->/data/local/tmp/cts-permissionui/CtsUsePermissionApp25.apk" />
55        <option name="push" value="CtsUsePermissionApp26.apk->/data/local/tmp/cts-permissionui/CtsUsePermissionApp26.apk" />
56        <option name="push" value="CtsUsePermissionApp28.apk->/data/local/tmp/cts-permissionui/CtsUsePermissionApp28.apk" />
57        <option name="push" value="CtsUsePermissionApp29.apk->/data/local/tmp/cts-permissionui/CtsUsePermissionApp29.apk" />
58        <option name="push" value="CtsUsePermissionApp30.apk->/data/local/tmp/cts-permissionui/CtsUsePermissionApp30.apk" />
59        <option name="push" value="CtsUsePermissionApp30WithBackground.apk->/data/local/tmp/cts-permissionui/CtsUsePermissionApp30WithBackground.apk" />
60        <option name="push" value="CtsUsePermissionApp30WithBluetooth.apk->/data/local/tmp/cts-permissionui/CtsUsePermissionApp30WithBluetooth.apk" />
61        <option name="push" value="CtsUsePermissionApp31.apk->/data/local/tmp/cts-permissionui/CtsUsePermissionApp31.apk" />
62        <option name="push" value="CtsUsePermissionApp31WithAsl.apk->/data/local/tmp/cts-permissionui/CtsUsePermissionApp31WithAsl.apk" />
63        <option name="push" value="CtsUsePermissionApp32.apk->/data/local/tmp/cts-permissionui/CtsUsePermissionApp32.apk" />
64        <option name="push" value="CtsUsePermissionAppLatest.apk->/data/local/tmp/cts-permissionui/CtsUsePermissionAppLatest.apk" />
65        <option name="push" value="CtsUsePermissionAppLatestNone.apk->/data/local/tmp/cts-permissionui/CtsUsePermissionAppLatestNone.apk" />
66        <option name="push" value="CtsUsePermissionAppWithOverlay.apk->/data/local/tmp/cts-permissionui/CtsUsePermissionAppWithOverlay.apk" />
67        <option name="push" value="CtsHelperAppOverlay.apk->/data/local/tmp/cts-permissionui/CtsHelperAppOverlay.apk" />
68        <option name="push" value="CtsCreateNotificationChannelsApp31.apk->/data/local/tmp/cts-permissionui/CtsCreateNotificationChannelsApp31.apk" />
69        <option name="push" value="CtsDifferentPkgNameApp.apk->/data/local/tmp/cts-permissionui/CtsDifferentPkgNameApp.apk" />
70        <option name="push" value="CtsMediaPermissionApp33WithStorage.apk->/data/local/tmp/cts-permissionui/CtsMediaPermissionApp33WithStorage.apk" />
71        <option name="push" value="CtsUsePermissionAppImplicitUserSelectStorage.apk->/data/local/tmp/cts-permissionui/CtsUsePermissionAppImplicitUserSelectStorage.apk" />
72        <option name="push" value="CtsAppThatAccessesMicAndCameraPermission.apk->/data/local/tmp/cts-permissionui/CtsAppThatAccessesMicAndCameraPermission.apk" />
73        <option name="push" value="CtsUsePermissionAppStorage33.apk->/data/local/tmp/cts-permissionui/CtsUsePermissionAppStorage33.apk" />
74        <option name="push" value="CtsAppThatMakesTwoPermRequests.apk->/data/local/tmp/cts-permissionui/CtsAppThatMakesTwoPermRequests.apk" />
75    </target_preparer>
76
77    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
78        <option name="run-command" value="appops set android.permissionui.cts REQUEST_INSTALL_PACKAGES allow" />
79        <option name="run-command" value="am wait-for-broadcast-barrier"  />
80        <!-- ensure device provisioning and user setup are marked as completed -->
81        <option name="run-command" value="settings put global device_provisioned 1" />
82        <option name="run-command" value="settings put secure user_setup_complete 1" />
83        <!-- disable DeprecatedAbi warning -->
84        <option name="run-command" value="setprop debug.wm.disable_deprecated_abi_dialog 1" />
85        <!-- disable DeprecatedTargetSdk warning -->
86        <option name="run-command" value="setprop debug.wm.disable_deprecated_target_sdk_dialog 1" />
87    </target_preparer>
88
89    <!-- Create place to store apks -->
90    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
91        <option name="run-command" value="mkdir -p /data/local/tmp/cts-permissionui" />
92        <option name="teardown-command" value="rm -rf /data/local/tmp/cts-permissionui"/>
93    </target_preparer>
94
95    <metrics_collector class="com.android.tradefed.device.metric.FilePullerLogCollector">
96        <option name="directory-keys" value="/data/user/0/android.permissionui.cts/files" />
97        <option name="collect-on-run-ended-only" value="true" />
98    </metrics_collector>
99
100    <test class="com.android.tradefed.testtype.AndroidJUnitTest" >
101        <option name="package" value="android.permissionui.cts" />
102        <option name="runtime-hint" value="5m" />
103    </test>
104</configuration>
105