Skip to content

Commit 798e2d3

Browse files
firefartJean-Baptiste Queru
authored andcommitted
Replaced /sdcard with Environment.getExternalStorageDirectory()
Change-Id: Id789f44a8569e307b1b7ab15eb266c9ce7ef2029
1 parent ae96f63 commit 798e2d3

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

core/java/android/os/Debug.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ private Debug() {}
9494
/**
9595
* Default trace file path and file
9696
*/
97-
private static final String DEFAULT_TRACE_PATH_PREFIX = "/sdcard/";
97+
private static final String DEFAULT_TRACE_PATH_PREFIX =
98+
Environment.getExternalStorageDirectory().getPath() + "/";
9899
private static final String DEFAULT_TRACE_BODY = "dmtrace";
99100
private static final String DEFAULT_TRACE_EXTENSION = ".trace";
100101
private static final String DEFAULT_TRACE_FILE_PATH =
@@ -127,7 +128,7 @@ public static class MemoryInfo implements Parcelable {
127128
public int otherPrivateDirty;
128129
/** The shared dirty pages used by everything else. */
129130
public int otherSharedDirty;
130-
131+
131132
public MemoryInfo() {
132133
}
133134

@@ -137,21 +138,21 @@ public MemoryInfo() {
137138
public int getTotalPss() {
138139
return dalvikPss + nativePss + otherPss;
139140
}
140-
141+
141142
/**
142143
* Return total private dirty memory usage in kB.
143144
*/
144145
public int getTotalPrivateDirty() {
145146
return dalvikPrivateDirty + nativePrivateDirty + otherPrivateDirty;
146147
}
147-
148+
148149
/**
149150
* Return total shared dirty memory usage in kB.
150151
*/
151152
public int getTotalSharedDirty() {
152153
return dalvikSharedDirty + nativeSharedDirty + otherSharedDirty;
153154
}
154-
155+
155156
public int describeContents() {
156157
return 0;
157158
}
@@ -179,7 +180,7 @@ public void readFromParcel(Parcel source) {
179180
otherPrivateDirty = source.readInt();
180181
otherSharedDirty = source.readInt();
181182
}
182-
183+
183184
public static final Creator<MemoryInfo> CREATOR = new Creator<MemoryInfo>() {
184185
public MemoryInfo createFromParcel(Parcel source) {
185186
return new MemoryInfo(source);
@@ -460,7 +461,7 @@ public static void startMethodTracing(String traceName, int bufferSize,
460461
* Like startMethodTracing(String, int, int), but taking an already-opened
461462
* FileDescriptor in which the trace is written. The file name is also
462463
* supplied simply for logging. Makes a dup of the file descriptor.
463-
*
464+
*
464465
* Not exposed in the SDK unless we are really comfortable with supporting
465466
* this and find it would be useful.
466467
* @hide
@@ -1070,7 +1071,7 @@ public static void setFieldsOn(Class<?> cl) {
10701071
* static {
10711072
* // Sets all the fields
10721073
* Debug.setFieldsOn(MyDebugVars.class);
1073-
*
1074+
*
10741075
* // Sets only the fields annotated with @Debug.DebugProperty
10751076
* // Debug.setFieldsOn(MyDebugVars.class, true);
10761077
* }

core/java/android/provider/Telephony.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import android.database.Cursor;
2626
import android.database.sqlite.SqliteWrapper;
2727
import android.net.Uri;
28+
import android.os.Environment;
2829
import android.telephony.SmsMessage;
2930
import android.text.TextUtils;
3031
import android.util.Config;
@@ -1526,7 +1527,8 @@ public static final class ScrapSpace {
15261527
* which streams the captured image to the uri. Internally we write the media content
15271528
* to this file. It's named '.temp.jpg' so Gallery won't pick it up.
15281529
*/
1529-
public static final String SCRAP_FILE_PATH = "/sdcard/mms/scrapSpace/.temp.jpg";
1530+
public static final String SCRAP_FILE_PATH =
1531+
Environment.getExternalStorageDirectory().getPath() + "/mms/scrapSpace/.temp.jpg";
15301532
}
15311533

15321534
public static final class Intents {

core/java/com/android/internal/os/SamplingProfilerIntegration.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ public static void writeSnapshot(final String name) {
8585
pending = true;
8686
snapshotWriter.execute(new Runnable() {
8787
public void run() {
88-
String dir = "/sdcard/snapshots";
88+
String dir =
89+
Environment.getExternalStorageDirectory().getPath() + "/snapshots";
8990
if (!dirMade) {
9091
new File(dir).mkdirs();
9192
if (new File(dir).isDirectory()) {

0 commit comments

Comments
 (0)