summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Cosmin Băieș <cosminbaies@google.com> 2025-02-27 11:49:46 +0100
committer Cosmin Băieș <cosminbaies@google.com> 2025-03-03 04:46:11 -0800
commit6926c5a3a2816f08b130dc1e4cd14fa4cc7f5939 (patch)
tree4f4d1c9309d87895fe59526d8db775d67202abc8
parentfc2d083585668c9b8f6c689cda1143c932802ecd (diff)
Write to external storage for DumpOnFailure
This is a partial revert of [1], to write the DumpOnFailure files again in external storage. Reading them with the FilePullerLogCollector from the app files only works if the device is rooted, which will not be the case on CTS tests. This will instead write them to the directory given by getExternalStorageDirectory. While the test config has the path of "/sdcard/..." for reading the files, this will get resolved to the actual external storage path. [1]: I6dece3f39a2f3ee3273b6ef12e3314f807d3457f Flag: EXEMPT testfix Bug: 399050749 Bug: 395783236 Test: atest InputMethodServiceTest Change-Id: I5d2e63427c46800d032972b6d74ff9a55377fae7
-rw-r--r--services/tests/InputMethodSystemServerTests/src/com/android/inputmethodservice/AndroidTest.xml5
-rw-r--r--services/tests/InputMethodSystemServerTests/test-apps/SimpleTestIme/AndroidManifest.xml3
2 files changed, 4 insertions, 4 deletions
diff --git a/services/tests/InputMethodSystemServerTests/src/com/android/inputmethodservice/AndroidTest.xml b/services/tests/InputMethodSystemServerTests/src/com/android/inputmethodservice/AndroidTest.xml
index d6a685378d9e..ea01fc4e6140 100644
--- a/services/tests/InputMethodSystemServerTests/src/com/android/inputmethodservice/AndroidTest.xml
+++ b/services/tests/InputMethodSystemServerTests/src/com/android/inputmethodservice/AndroidTest.xml
@@ -18,9 +18,6 @@
<option name="test-suite-tag" value="apct" />
<option name="test-suite-tag" value="apct-instrumentation" />
- <!-- Needed for reading the app files for the test artifacts -->
- <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"/>
-
<target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
<option name="cleanup-apks" value="true" />
<option name="install-arg" value="-t" />
@@ -44,7 +41,7 @@
<!-- Collect output of DumpOnFailure -->
<metrics_collector class="com.android.tradefed.device.metric.FilePullerLogCollector">
- <option name="directory-keys" value="/data/user/0/com.android.apps.inputmethod.simpleime/files" />
+ <option name="directory-keys" value="/sdcard/DumpOnFailure" />
<option name="collect-on-run-ended-only" value="true" />
<option name="clean-up" value="true" />
</metrics_collector>
diff --git a/services/tests/InputMethodSystemServerTests/test-apps/SimpleTestIme/AndroidManifest.xml b/services/tests/InputMethodSystemServerTests/test-apps/SimpleTestIme/AndroidManifest.xml
index 00873de4aaed..b6965a4341d7 100644
--- a/services/tests/InputMethodSystemServerTests/test-apps/SimpleTestIme/AndroidManifest.xml
+++ b/services/tests/InputMethodSystemServerTests/test-apps/SimpleTestIme/AndroidManifest.xml
@@ -20,6 +20,9 @@
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />
+ <!-- Enable writing output of DumpOnFailure to external storage -->
+ <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
+
<application android:debuggable="true"
android:label="@string/app_name">
<service