1<?xml version="1.0" encoding="utf-8"?>
2<!--
3 * Copyright 2018 Google Inc. All Rights Reserved.
4 -->
5<configuration description="Runs WindowManager {MODULE}">
6    <option name="test-tag" value="FlickerTests"/>
7    <!-- Needed for storing the perfetto trace files in the sdcard/test_results-->
8    <option name="isolated-storage" value="false"/>
9
10    <target_preparer class="com.android.tradefed.targetprep.DeviceSetup">
11        <!-- disable DeprecatedTargetSdk warning -->
12        <option name="run-command" value="setprop debug.wm.disable_deprecated_target_sdk_dialog 1"/>
13        <!-- keeps the screen on during tests -->
14        <option name="screen-always-on" value="on"/>
15        <!-- prevents the phone from restarting -->
16        <option name="force-skip-system-props" value="true"/>
17        <!-- set WM tracing verbose level to all -->
18        <option name="run-command" value="cmd window tracing level all"/>
19        <!-- set WM tracing to frame (avoid incomplete states) -->
20        <option name="run-command" value="cmd window tracing frame"/>
21        <!-- ensure lock screen mode is swipe -->
22        <option name="run-command" value="locksettings set-disabled false"/>
23        <!-- disable betterbug as it's log collection dialogues cause flakes in e2e tests -->
24        <option name="run-command" value="pm disable com.google.android.internal.betterbug"/>
25        <!-- restart launcher to activate TAPL -->
26        <option name="run-command"
27                value="setprop ro.test_harness 1 ; am force-stop com.google.android.apps.nexuslauncher"/>
28        <!-- Increase trace size: 20mb for WM and 80mb for SF -->
29        <option name="run-command" value="cmd window tracing size 20480"/>
30        <option name="run-command" value="su root service call SurfaceFlinger 1029 i32 81920"/>
31        <!-- b/307664397 - Ensure camera has the correct permissions and doesn't show a dialog -->
32        <option name="run-command"
33                value="pm grant com.google.android.GoogleCamera android.permission.CAMERA"/>
34        <option name="run-command"
35                value="pm grant com.google.android.GoogleCamera android.permission.RECORD_AUDIO"/>
36        <option name="run-command"
37                value="pm grant com.google.android.GoogleCamera android.permission.ACCESS_FINE_LOCATION"/>
38        <option name="run-command"
39                value="pm grant com.google.android.GoogleCamera android.permission.ACCESS_COARSE_LOCATION"/>
40    </target_preparer>
41    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
42        <option name="test-user-token" value="%TEST_USER%"/>
43        <option name="run-command" value="rm -rf /data/user/%TEST_USER%/files/*"/>
44        <option name="run-command" value="settings put secure show_ime_with_hard_keyboard 1"/>
45        <option name="run-command" value="settings put system show_touches 1"/>
46        <option name="run-command" value="settings put system pointer_location 1"/>
47        <option name="teardown-command"
48                value="settings delete secure show_ime_with_hard_keyboard"/>
49        <option name="teardown-command" value="settings delete system show_touches"/>
50        <option name="teardown-command" value="settings delete system pointer_location"/>
51        <option name="teardown-command"
52                value="cmd overlay enable com.android.internal.systemui.navbar.gestural"/>
53    </target_preparer>
54    <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
55        <option name="cleanup-apks" value="true"/>
56        <option name="test-file-name" value="{MODULE}.apk"/>
57        <option name="test-file-name" value="FlickerTestApp.apk"/>
58    </target_preparer>
59    <!-- Needed for pushing the trace config file -->
60    <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"/>
61    <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
62        <option name="push-file"
63                key="trace_config.textproto"
64                value="/data/misc/perfetto-traces/trace_config.textproto"
65        />
66        <!--Install the content provider automatically when we push some file in sdcard folder.-->
67        <!--Needed to avoid the installation during the test suite.-->
68        <option name="push-file" key="trace_config.textproto" value="/sdcard/sample.textproto"/>
69    </target_preparer>
70    <test class="com.android.tradefed.testtype.AndroidJUnitTest">
71        <option name="package" value="{PACKAGE}"/>
72        <option name="shell-timeout" value="6600s"/>
73        <option name="test-timeout" value="6600s"/>
74        <option name="hidden-api-checks" value="false"/>
75        <option name="device-listeners" value="android.device.collectors.PerfettoListener"/>
76        <!-- PerfettoListener related arguments -->
77        <option name="instrumentation-arg" key="perfetto_config_text_proto" value="true"/>
78        <option name="instrumentation-arg"
79                key="perfetto_config_file"
80                value="trace_config.textproto"
81        />
82        <option name="instrumentation-arg" key="per_run" value="true"/>
83        <option name="instrumentation-arg" key="perfetto_persist_pid_track" value="true"/>
84    </test>
85    <!-- Needed for pulling the collected trace config on to the host -->
86    <metrics_collector class="com.android.tradefed.device.metric.FilePullerLogCollector">
87        <option name="pull-pattern-keys" value="perfetto_file_path"/>
88        <option name="directory-keys"
89                value="/data/user/0/com.android.server.wm.flicker/files"/>
90        <option name="collect-on-run-ended-only" value="true"/>
91        <option name="clean-up" value="true"/>
92    </metrics_collector>
93</configuration>
94