Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d43036b0 authored by Nataniel Borges's avatar Nataniel Borges
Browse files

Store and pull files from /sdcard/

Tradefed FilePullerLogCollector can no longer access the internal app directory (e.g. /storage/emulated/0/Android/data/com.android.server.wm.flicker/files).

This makes it unable to pull trace files, when a test fails. This CL makes flicker tests store their data on /sdcard/flicker which can be accessed by the Tradefed FilePullerLogCollector

Bug: 171026227
Test: atest FlickerTests
Change-Id: Ibed6b621b068b0668d93b39838c0959441527295
parent 0ea52e51
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -21,6 +21,8 @@
    <!-- Read and write traces from external storage -->
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <!-- Allow the test to write directly to /sdcard/ -->
    <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
    <!-- Write secure settings -->
    <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />
    <!-- Capture screen contents -->
@@ -34,7 +36,8 @@
    <!-- Workaround grant runtime permission exception from b/152733071 -->
    <uses-permission android:name="android.permission.PACKAGE_USAGE_STATS"/>
    <uses-permission android:name="android.permission.READ_LOGS"/>
    <application>
    <!-- Allow the test to write directly to /sdcard/ -->
    <application android:requestLegacyExternalStorage="true">
        <uses-library android:name="android.test.runner"/>
    </application>

+1 −1
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@
        <option name="hidden-api-checks" value="false" />
    </test>
    <metrics_collector class="com.android.tradefed.device.metric.FilePullerLogCollector">
        <option name="directory-keys" value="/storage/emulated/0/Android/data/com.android.server.wm.flicker/files" />
        <option name="directory-keys" value="/sdcard/flicker" />
        <option name="collect-on-run-ended-only" value="true" />
        <option name="clean-up" value="true" />
    </metrics_collector>
+1 −1
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@
        <option name="hidden-api-checks" value="false" />
    </test>
    <metrics_collector class="com.android.tradefed.device.metric.FilePullerLogCollector">
        <option name="directory-keys" value="/storage/emulated/0/Android/data/com.android.server.wm.flicker/files" />
        <option name="directory-keys" value="/sdcard/flicker" />
        <option name="collect-on-run-ended-only" value="true" />
        <option name="clean-up" value="true" />
    </metrics_collector>
+2 −1
Original line number Diff line number Diff line
@@ -52,7 +52,8 @@ open class SurfaceTracingTestBase(useBlastAdapter: Boolean) :
    }

    fun withTrace(predicate: (it: MainActivity) -> Unit): LayersTrace {
        return withSFTracing(instrumentation, TRACE_FLAGS) {
        return withSFTracing(TRACE_FLAGS,
                outputDir = instrumentation.targetContext.dataDir.toPath()) {
            scenarioRule.getScenario().onActivity {
                predicate(it)
            }
+2 −1
Original line number Diff line number Diff line
@@ -68,7 +68,8 @@ class ResizeTasksSyncTest {
        val firstBounds = Rect(0, 0, 1080, 800)
        val secondBounds = Rect(0, 1000, 1080, 1800)

        val trace = withSFTracing(instrumentation, TRACE_FLAGS) {
        val trace = withSFTracing(TRACE_FLAGS,
                outputDir = instrumentation.targetContext.dataDir.toPath()) {
            lateinit var resizeReadyLatch: CountDownLatch
            scenarioRule.getScenario().onActivity {
                resizeReadyLatch = it.resizeTaskView(firstBounds, secondBounds)