diff options
| author | 2015-12-11 18:19:26 -0800 | |
|---|---|---|
| committer | 2015-12-11 18:19:26 -0800 | |
| commit | e2b4f49795b4f23fa563a0ffb9986b49aee7f9be (patch) | |
| tree | 4f76293b2e3cd763e778364464b8d016a3d03cbb | |
| parent | f026f82fb55b5ef8aaf23a99ee16b5dbad21a3af (diff) | |
Created initial bugreports dir if it doesn't exist.
BUG: 25752530
Change-Id: Iec65b88231e26aaa62d301a26b2f51cf92651c72
| -rw-r--r-- | packages/Shell/tests/src/com/android/shell/BugreportReceiverTest.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/packages/Shell/tests/src/com/android/shell/BugreportReceiverTest.java b/packages/Shell/tests/src/com/android/shell/BugreportReceiverTest.java index 6b6b0daf0d0d..4f8138b3f335 100644 --- a/packages/Shell/tests/src/com/android/shell/BugreportReceiverTest.java +++ b/packages/Shell/tests/src/com/android/shell/BugreportReceiverTest.java @@ -352,6 +352,10 @@ public class BugreportReceiverTest extends InstrumentationTestCase { private String getPath(String file) { File rootDir = new ContextWrapper(mContext).getFilesDir(); File dir = new File(rootDir, BUGREPORTS_DIR); + if (!dir.exists()) { + Log.i(TAG, "Creating directory " + dir); + assertTrue("Could not create directory " + dir, dir.mkdir()); + } String path = new File(dir, file).getAbsolutePath(); Log.v(TAG, "Path for '" + file + "': " + path); return path; |