Skip to content

Commit 71520a6

Browse files
jsharkeyAndroid (Google) Code Review
authored andcommitted
Merge "Handle ISE when physical volume isn't mounted." into jb-mr1-dev
2 parents 62ea436 + 32ee831 commit 71520a6

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

services/java/com/android/server/MountService.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1577,9 +1577,16 @@ public int[] getStorageUsers(String path) {
15771577

15781578
private void warnOnNotMounted() {
15791579
final StorageVolume primary = getPrimaryPhysicalVolume();
1580-
if (primary != null
1581-
&& Environment.MEDIA_MOUNTED.equals(getVolumeState(primary.getPath()))) {
1582-
Slog.w(TAG, "getSecureContainerList() called when storage not mounted");
1580+
if (primary != null) {
1581+
boolean mounted = false;
1582+
try {
1583+
mounted = Environment.MEDIA_MOUNTED.equals(getVolumeState(primary.getPath()));
1584+
} catch (IllegalStateException e) {
1585+
}
1586+
1587+
if (!mounted) {
1588+
Slog.w(TAG, "getSecureContainerList() called when storage not mounted");
1589+
}
15831590
}
15841591
}
15851592

0 commit comments

Comments
 (0)