merge in jb-mr1-release history after reset to jb-mr1-dev
diff --git a/src/com/android/providers/media/MtpService.java b/src/com/android/providers/media/MtpService.java
index fce8360..545fcde 100644
--- a/src/com/android/providers/media/MtpService.java
+++ b/src/com/android/providers/media/MtpService.java
@@ -50,7 +50,13 @@
private void addStorageDevicesLocked() {
if (mPtpMode) {
// In PTP mode we support only primary storage
- addStorageLocked(mVolumeMap.get(mVolumes[0].getPath()));
+ String path = mVolumes[0].getPath();
+ if (path != null) {
+ String state = mStorageManager.getVolumeState(path);
+ if (Environment.MEDIA_MOUNTED.equals(state)) {
+ addStorageLocked(mVolumeMap.get(mVolumes[0].getPath()));
+ }
+ }
} else {
for (StorageVolume volume : mVolumeMap.values()) {
addStorageLocked(volume);