From 8e2ea2a9f15217bd5e44665650251f83f3f70313 Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Wed, 19 Aug 2015 14:15:33 -0700 Subject: [PATCH] Pass underlying volume UUID to StorageVolume. To help MediaProvider uniquely identify storage devices, pass through the UUID of the underlying private storage volume. Bug: 23329611 Change-Id: I22ee7ea98fcb208d7797310acb3396a3f074f09b --- core/java/android/os/storage/VolumeInfo.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/java/android/os/storage/VolumeInfo.java b/core/java/android/os/storage/VolumeInfo.java index ef54d84fdebf7..6888594797133 100644 --- a/core/java/android/os/storage/VolumeInfo.java +++ b/core/java/android/os/storage/VolumeInfo.java @@ -341,6 +341,7 @@ public class VolumeInfo implements Parcelable { } String description = null; + String derivedFsUuid = fsUuid; long mtpReserveSize = 0; long maxFileSize = 0; int mtpStorageId = StorageVolume.STORAGE_ID_INVALID; @@ -351,6 +352,7 @@ public class VolumeInfo implements Parcelable { final VolumeInfo privateVol = storage.findPrivateForEmulated(this); if (privateVol != null) { description = storage.getBestVolumeDescription(privateVol); + derivedFsUuid = privateVol.fsUuid; } if (isPrimary()) { @@ -393,7 +395,7 @@ public class VolumeInfo implements Parcelable { return new StorageVolume(id, mtpStorageId, userPath, description, isPrimary(), removable, emulated, mtpReserveSize, allowMassStorage, maxFileSize, new UserHandle(userId), - fsUuid, envState); + derivedFsUuid, envState); } public static int buildStableMtpStorageId(String fsUuid) {