Skip to content

Commit 3b60dac

Browse files
author
bo huang
committed
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 <bo.b.huang@intel.com> Signed-off-by: Jack Ren<jack.ren@intel.com> Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
1 parent d2237df commit 3b60dac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

media/java/android/mtp/MtpStorage.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public MtpStorage(StorageVolume volume, Context context) {
3939
mStorageId = volume.getStorageId();
4040
mPath = volume.getPath();
4141
mDescription = context.getResources().getString(volume.getDescriptionId());
42-
mReserveSpace = volume.getMtpReserveSpace();
42+
mReserveSpace = volume.getMtpReserveSpace() * 1024 * 1024;
4343
mRemovable = volume.isRemovable();
4444
mMaxFileSize = volume.getMaxFileSize();
4545
}
@@ -87,7 +87,7 @@ public final String getDescription() {
8787
* Returns the amount of space to reserve on the storage file system.
8888
* This can be set to a non-zero value to prevent MTP from filling up the entire storage.
8989
*
90-
* @return the storage unit description
90+
* @return reserved space in bytes.
9191
*/
9292
public final long getReserveSpace() {
9393
return mReserveSpace;

0 commit comments

Comments
 (0)