From b894c71af8e992bf861ce218d0adc0eada732aba Mon Sep 17 00:00:00 2001 From: Yu Shan Emily Lau Date: Fri, 21 Sep 2012 16:20:12 -0700 Subject: [PATCH] For the recent SD card access change. The non-zogyte process need to use the Environment#getLegacyExternalStorage to access the sdcard. Change-Id: I797d235954defe25e1bd8728f167250e4f9d0fe9 --- cmds/monkey/src/com/android/commands/monkey/Monkey.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmds/monkey/src/com/android/commands/monkey/Monkey.java b/cmds/monkey/src/com/android/commands/monkey/Monkey.java index 706dd0f80..c8a480fd6 100644 --- a/cmds/monkey/src/com/android/commands/monkey/Monkey.java +++ b/cmds/monkey/src/com/android/commands/monkey/Monkey.java @@ -411,7 +411,7 @@ public class Monkey { if (mRequestBugreport) { logOutput = new BufferedWriter(new FileWriter(new File(Environment - .getExternalStorageDirectory(), reportName), true)); + .getLegacyExternalStorageDirectory(), reportName), true)); } // pipe everything from process stdout -> System.err InputStream inStream = p.getInputStream(); @@ -444,7 +444,7 @@ public class Monkey { // TO DO: Add the script file name to the log. try { Writer output = new BufferedWriter(new FileWriter(new File( - Environment.getExternalStorageDirectory(), "scriptlog.txt"), true)); + Environment.getLegacyExternalStorageDirectory(), "scriptlog.txt"), true)); output.write("iteration: " + count + " time: " + MonkeyUtils.toCalendarTime(System.currentTimeMillis()) + "\n"); output.close();