Improve MtpStorage handling when more than one storage is present

Change-Id: I02f1984d02a85d9fd42450cc3772e88a43d9e9ff
This commit is contained in:
Ethan Yonker
2014-09-03 15:06:00 -05:00
parent 6d154c4fe2
commit 5e083dcc20
2 changed files with 11 additions and 7 deletions
+6 -1
View File
@@ -322,7 +322,7 @@ MtpResponseCode MyMtpDatabase::getObjectPropertyValue(MtpObjectHandle handle,
MtpDataPacket& packet) {
MTPD("MyMtpDatabase::getObjectPropertyValue mtpid: %i, property: %x\n", handle, property);
int type;
MtpResponseCode result;
MtpResponseCode result = MTP_RESPONSE_INVALID_OBJECT_HANDLE;
uint64_t longValue;
if (!getObjectPropertyInfo(property, type)) {
MTPE("MyMtpDatabase::setObjectPropertyValue returning MTP_RESPONSE_OBJECT_PROP_NOT_SUPPORTED\n");
@@ -336,6 +336,11 @@ MtpResponseCode MyMtpDatabase::getObjectPropertyValue(MtpObjectHandle handle,
}
}
if (result != MTP_RESPONSE_OK) {
MTPE("MyMtpDatabase::setObjectPropertyValue unable to locate handle: %i\n", handle);
return MTP_RESPONSE_INVALID_OBJECT_HANDLE;
}
// special case date properties, which are strings to MTP
// but stored internally as a uint64
if (property == MTP_PROPERTY_DATE_MODIFIED || property == MTP_PROPERTY_DATE_ADDED) {