From 3b60dacb4e1871d1c7b410ac55fd3e5fd6bfacfb Mon Sep 17 00:00:00 2001 From: bo huang Date: Mon, 6 Aug 2012 13:16:57 +0800 Subject: [PATCH] MtpStorage: correct the size of reserve space for MTP According to description in frameworks/base/core/res/res/xml/storage_list.xml, "mtpReserve: (integer) number of megabytes of storage MTP should reserve for free storage". Mtpstorage class use it directly and doesn't change it to correct size in megabyes. Mtp initor can not get correct storage information from android. Change-Id: Icf59eb1eb478e67ea5990be96a9decb41aa55504 Signed-off-by: Bo Huang Signed-off-by: Jack Ren Signed-off-by: Bruce Beare --- media/java/android/mtp/MtpStorage.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/media/java/android/mtp/MtpStorage.java b/media/java/android/mtp/MtpStorage.java index 2f47aadecbff3..9cf65a373dcd5 100644 --- a/media/java/android/mtp/MtpStorage.java +++ b/media/java/android/mtp/MtpStorage.java @@ -39,7 +39,7 @@ public class MtpStorage { mStorageId = volume.getStorageId(); mPath = volume.getPath(); mDescription = context.getResources().getString(volume.getDescriptionId()); - mReserveSpace = volume.getMtpReserveSpace(); + mReserveSpace = volume.getMtpReserveSpace() * 1024 * 1024; mRemovable = volume.isRemovable(); mMaxFileSize = volume.getMaxFileSize(); } @@ -87,7 +87,7 @@ public class MtpStorage { * Returns the amount of space to reserve on the storage file system. * This can be set to a non-zero value to prevent MTP from filling up the entire storage. * - * @return the storage unit description + * @return reserved space in bytes. */ public final long getReserveSpace() { return mReserveSpace;