Long mp3 metadata displays as corrupted file after transfer
Cut the metadata to 1 Byte and return in function
getObjectPropertyList in order to show it properly on a PC.
Change-Id: Iefacf9fa86c20ece2572e6d95d35877a94066fe7
diff --git a/media/mtp/MtpStringBuffer.h b/media/mtp/MtpStringBuffer.h
index cbc8307..e5150df 100644
--- a/media/mtp/MtpStringBuffer.h
+++ b/media/mtp/MtpStringBuffer.h
@@ -19,6 +19,9 @@
#include <stdint.h>
+// Max Character number of a MTP String
+#define MTP_STRING_MAX_CHARACTER_NUMBER 255
+
namespace android {
class MtpDataPacket;
@@ -29,7 +32,7 @@
private:
// mBuffer contains string in UTF8 format
// maximum 3 bytes/character, with 1 extra for zero termination
- uint8_t mBuffer[255 * 3 + 1];
+ uint8_t mBuffer[MTP_STRING_MAX_CHARACTER_NUMBER * 3 + 1];
int mCharCount;
int mByteCount;