summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2011-04-05 10:21:27 -0400
committerMike Lockwood <lockwood@android.com>2011-04-05 15:19:16 -0400
commit30adaaf9d6fd944c8f6a2c7a06774b019878c368 (patch)
tree45569049e40a03e0e725f472bcec6170d106ecb2
parent7fb4b427d5fca79c09d69b212ddca41539c215a2 (diff)
downloadframeworks_av-30adaaf9d6fd944c8f6a2c7a06774b019878c368.zip
frameworks_av-30adaaf9d6fd944c8f6a2c7a06774b019878c368.tar.gz
frameworks_av-30adaaf9d6fd944c8f6a2c7a06774b019878c368.tar.bz2
MTP and media provider support for multiple storage devices:
- MTP support for multiple storage units - Add storage_id column to media database for MTP storage ID - Add framework resource for defining mount points and user visible descriptions for multiple volumes - Clean up locking in MtpServer JNI code Change-Id: Iffb66ed156ef5bc80b14228af78fbacee7734360
-rw-r--r--media/mtp/MtpServer.h6
-rw-r--r--media/mtp/MtpStorage.cpp6
-rw-r--r--media/mtp/MtpStorage.h3
-rw-r--r--media/mtp/mtp.h2
4 files changed, 9 insertions, 8 deletions
diff --git a/media/mtp/MtpServer.h b/media/mtp/MtpServer.h
index 1efa715..fa729a8 100644
--- a/media/mtp/MtpServer.h
+++ b/media/mtp/MtpServer.h
@@ -70,6 +70,9 @@ public:
int fileGroup, int filePerm, int directoryPerm);
virtual ~MtpServer();
+ MtpStorage* getStorage(MtpStorageID id);
+ inline bool hasStorage() { return mStorages.size() > 0; }
+ bool hasStorage(MtpStorageID id);
void addStorage(MtpStorage* storage);
void removeStorage(MtpStorage* storage);
@@ -79,9 +82,6 @@ public:
void sendObjectRemoved(MtpObjectHandle handle);
private:
- MtpStorage* getStorage(MtpStorageID id);
- inline bool hasStorage() { return mStorages.size() > 0; }
- bool hasStorage(MtpStorageID id);
void sendStoreAdded(MtpStorageID id);
void sendStoreRemoved(MtpStorageID id);
void sendEvent(MtpEventCode code, uint32_t param1);
diff --git a/media/mtp/MtpStorage.cpp b/media/mtp/MtpStorage.cpp
index 6cb88b3..fff0b5f 100644
--- a/media/mtp/MtpStorage.cpp
+++ b/media/mtp/MtpStorage.cpp
@@ -32,9 +32,11 @@
namespace android {
-MtpStorage::MtpStorage(MtpStorageID id, const char* filePath, uint64_t reserveSpace)
+MtpStorage::MtpStorage(MtpStorageID id, const char* filePath,
+ const char* description, uint64_t reserveSpace)
: mStorageID(id),
mFilePath(filePath),
+ mDescription(description),
mMaxCapacity(0),
mReserveSpace(reserveSpace)
{
@@ -75,7 +77,7 @@ uint64_t MtpStorage::getFreeSpace() {
}
const char* MtpStorage::getDescription() const {
- return "Device Storage";
+ return (const char *)mDescription;
}
} // namespace android
diff --git a/media/mtp/MtpStorage.h b/media/mtp/MtpStorage.h
index 858c9d3..d6ad25f 100644
--- a/media/mtp/MtpStorage.h
+++ b/media/mtp/MtpStorage.h
@@ -29,13 +29,14 @@ class MtpStorage {
private:
MtpStorageID mStorageID;
MtpString mFilePath;
+ MtpString mDescription;
uint64_t mMaxCapacity;
// amount of free space to leave unallocated
uint64_t mReserveSpace;
public:
MtpStorage(MtpStorageID id, const char* filePath,
- uint64_t reserveSpace);
+ const char* description, uint64_t reserveSpace);
virtual ~MtpStorage();
inline MtpStorageID getStorageID() const { return mStorageID; }
diff --git a/media/mtp/mtp.h b/media/mtp/mtp.h
index 6fedc16..8bc2e22 100644
--- a/media/mtp/mtp.h
+++ b/media/mtp/mtp.h
@@ -22,8 +22,6 @@
#define MTP_STANDARD_VERSION 100
-#define MTP_FIRST_STORAGE_ID 0x00010001
-
// Container Types
#define MTP_CONTAINER_TYPE_UNDEFINED 0
#define MTP_CONTAINER_TYPE_COMMAND 1