Merge "Progress towards splitting MediaProvider UID."
diff --git a/OWNERS b/OWNERS
new file mode 100644
index 0000000..bcf40cd
--- /dev/null
+++ b/OWNERS
@@ -0,0 +1,5 @@
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
diff --git a/src/com/android/mtp/MtpService.java b/src/com/android/mtp/MtpService.java
index 0b6e1ab..035c0f4 100644
--- a/src/com/android/mtp/MtpService.java
+++ b/src/com/android/mtp/MtpService.java
@@ -67,6 +67,8 @@
             synchronized (MtpService.this) {
                 Log.d(TAG, "onStorageStateChanged " + path + " " + oldState + " -> " + newState);
                 if (Environment.MEDIA_MOUNTED.equals(newState)) {
+                    // Updating mVolumes variable because new storage could be inserted
+                    mVolumes = StorageManager.getVolumeList(getUserId(), 0);
                     for (int i = 0; i < mVolumes.length; i++) {
                         StorageVolume volume = mVolumes[i];
                         if (volume.getPath().equals(path)) {