summaryrefslogtreecommitdiffstats
path: root/media/mtp
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2010-06-14 17:58:08 -0700
committerMike Lockwood <lockwood@android.com>2010-06-14 17:59:46 -0700
commitc42aa12f73edf79bc9cb0dbf6b74a7f1af11c683 (patch)
tree9b26a91ad6f84656e9faf42206c312ed8e32f843 /media/mtp
parenta177ae14b8cd9c1172cd166094cbffb2485325c2 (diff)
downloadframeworks_av-c42aa12f73edf79bc9cb0dbf6b74a7f1af11c683.zip
frameworks_av-c42aa12f73edf79bc9cb0dbf6b74a7f1af11c683.tar.gz
frameworks_av-c42aa12f73edf79bc9cb0dbf6b74a7f1af11c683.tar.bz2
MTP device: Read manufacturer name and serial number from system properties.
Change-Id: I8d1ad79f38aaaa50fa8899e6b614096af95fdf39 Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'media/mtp')
-rw-r--r--media/mtp/MtpServer.cpp11
-rw-r--r--media/mtp/MtpStorage.cpp2
2 files changed, 10 insertions, 3 deletions
diff --git a/media/mtp/MtpServer.cpp b/media/mtp/MtpServer.cpp
index 73dee0d..0fba4dd 100644
--- a/media/mtp/MtpServer.cpp
+++ b/media/mtp/MtpServer.cpp
@@ -22,6 +22,8 @@
#include <fcntl.h>
#include <errno.h>
+#include <cutils/properties.h>
+
#include "MtpDebug.h"
#include "MtpServer.h"
#include "MtpStorage.h"
@@ -288,6 +290,7 @@ bool MtpServer::handleRequest() {
MtpResponseCode MtpServer::doGetDeviceInfo() {
MtpStringBuffer string;
+ char prop_value[PROPERTY_VALUE_MAX];
// fill in device info
mData.putUInt16(MTP_STANDARD_VERSION);
@@ -306,11 +309,15 @@ MtpResponseCode MtpServer::doGetDeviceInfo() {
// FIXME
string.set("Google, Inc.");
mData.putString(string); // Manufacturer
- string.set("Just an Ordinary MTP Device");
+
+ property_get("ro.product.model", prop_value, "MTP Device");
+ string.set(prop_value);
mData.putString(string); // Model
string.set("1.0");
mData.putString(string); // Device Version
- string.set("123456789012345678AA");
+
+ property_get("ro.serialno", prop_value, "????????");
+ string.set(prop_value);
mData.putString(string); // Serial Number
return MTP_RESPONSE_OK;
diff --git a/media/mtp/MtpStorage.cpp b/media/mtp/MtpStorage.cpp
index f176148..5e08816 100644
--- a/media/mtp/MtpStorage.cpp
+++ b/media/mtp/MtpStorage.cpp
@@ -71,7 +71,7 @@ uint64_t MtpStorage::getFreeSpace() {
}
const char* MtpStorage::getDescription() const {
- return "Phone Storage";
+ return "Device Storage";
}
bool MtpStorage::scanFiles() {