We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 933a754 commit 32ee831Copy full SHA for 32ee831
1 file changed
services/java/com/android/server/MountService.java
@@ -1577,9 +1577,16 @@ public int[] getStorageUsers(String path) {
1577
1578
private void warnOnNotMounted() {
1579
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");
+ if (primary != null) {
+ boolean mounted = false;
+ 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
1590
}
1591
1592
0 commit comments