diff options
author | Mike Lockwood <lockwood@android.com> | 2011-05-09 20:16:05 -0700 |
---|---|---|
committer | Mike Lockwood <lockwood@android.com> | 2011-05-16 14:29:45 -0400 |
commit | 51690544aaeee82b1c50232cd57d50038b77f0c4 (patch) | |
tree | 15c07b891ca2c1b8e0fdd2471b6d0855162d66dd /media/mtp | |
parent | 2f6a3885533a52758c2cd4f81f6123a712be8ae6 (diff) | |
download | frameworks_base-51690544aaeee82b1c50232cd57d50038b77f0c4.zip frameworks_base-51690544aaeee82b1c50232cd57d50038b77f0c4.tar.gz frameworks_base-51690544aaeee82b1c50232cd57d50038b77f0c4.tar.bz2 |
MTP: Have GetStorageInfo command return correct storage type for removable storage
Change-Id: I09b548483c12080e7d77970babcae2eef379f2f4
Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'media/mtp')
-rw-r--r-- | media/mtp/MtpStorage.cpp | 7 | ||||
-rw-r--r-- | media/mtp/MtpStorage.h | 5 |
2 files changed, 8 insertions, 4 deletions
diff --git a/media/mtp/MtpStorage.cpp b/media/mtp/MtpStorage.cpp index fff0b5f..fef8066 100644 --- a/media/mtp/MtpStorage.cpp +++ b/media/mtp/MtpStorage.cpp @@ -33,12 +33,13 @@ namespace android { MtpStorage::MtpStorage(MtpStorageID id, const char* filePath, - const char* description, uint64_t reserveSpace) + const char* description, uint64_t reserveSpace, bool removable) : mStorageID(id), mFilePath(filePath), mDescription(description), mMaxCapacity(0), - mReserveSpace(reserveSpace) + mReserveSpace(reserveSpace), + mRemovable(removable) { LOGV("MtpStorage id: %d path: %s\n", id, filePath); } @@ -47,7 +48,7 @@ MtpStorage::~MtpStorage() { } int MtpStorage::getType() const { - return MTP_STORAGE_FIXED_RAM; + return (mRemovable ? MTP_STORAGE_REMOVABLE_RAM : MTP_STORAGE_FIXED_RAM); } int MtpStorage::getFileSystemType() const { diff --git a/media/mtp/MtpStorage.h b/media/mtp/MtpStorage.h index d6ad25f..3e4f40d 100644 --- a/media/mtp/MtpStorage.h +++ b/media/mtp/MtpStorage.h @@ -33,10 +33,12 @@ private: uint64_t mMaxCapacity; // amount of free space to leave unallocated uint64_t mReserveSpace; + bool mRemovable; public: MtpStorage(MtpStorageID id, const char* filePath, - const char* description, uint64_t reserveSpace); + const char* description, uint64_t reserveSpace, + bool removable); virtual ~MtpStorage(); inline MtpStorageID getStorageID() const { return mStorageID; } @@ -47,6 +49,7 @@ public: uint64_t getFreeSpace(); const char* getDescription() const; inline const char* getPath() const { return (const char *)mFilePath; } + inline bool isRemovable() const { return mRemovable; } }; }; // namespace android |