MTP: Fix reading and writing property descriptors
We were missing support for the group code, resulting in an off by 4 bytes problem.
Change-Id: I4a640c67b8d36e1bd658b6185178a71966d4b0b6
Signed-off-by: Mike Lockwood <lockwood@android.com>
diff --git a/media/mtp/MtpProperty.cpp b/media/mtp/MtpProperty.cpp
index d6beb8a..932ad6a 100644
--- a/media/mtp/MtpProperty.cpp
+++ b/media/mtp/MtpProperty.cpp
@@ -31,6 +31,7 @@
mDefaultArrayValues(NULL),
mCurrentArrayLength(0),
mCurrentArrayValues(NULL),
+ mGroupCode(0),
mFormFlag(kFormNone),
mEnumLength(0),
mEnumValues(NULL)
@@ -52,6 +53,7 @@
mDefaultArrayValues(NULL),
mCurrentArrayLength(0),
mCurrentArrayValues(NULL),
+ mGroupCode(0),
mFormFlag(kFormNone),
mEnumLength(0),
mEnumValues(NULL)
@@ -142,6 +144,7 @@
if (deviceProp)
readValue(packet, mCurrentValue);
}
+ mGroupCode = packet.getUInt32();
mFormFlag = packet.getUInt8();
if (mFormFlag == kFormRange) {
@@ -178,6 +181,7 @@
default:
writeValue(packet, mDefaultValue);
}
+ packet.putUInt32(mGroupCode);
packet.putUInt8(mFormFlag);
if (mFormFlag == kFormRange) {
writeValue(packet, mMinimumValue);