Relax user constraint on storage state.
Otherwise we wtf() when called various places in the system.
Bug: 11223886
Change-Id: I514d28603db02e3debd4af1cf20049af0c7399f4
diff --git a/core/java/android/os/Environment.java b/core/java/android/os/Environment.java
index db5cf1c..b5413db 100644
--- a/core/java/android/os/Environment.java
+++ b/core/java/android/os/Environment.java
@@ -686,7 +686,8 @@
* {@link #MEDIA_BAD_REMOVAL}, or {@link #MEDIA_UNMOUNTABLE}.
*/
public static String getExternalStorageState() {
- return getStorageState(getExternalStorageDirectory());
+ final File externalDir = sCurrentUser.getExternalDirsForApp()[0];
+ return getStorageState(externalDir);
}
/**