summaryrefslogtreecommitdiff
path: root/media/java/android/mtp/MtpDatabase.java
diff options
context:
space:
mode:
authorJames Wei <jameswei@google.com>2018-08-15 22:23:12 +0800
committerJames Wei <jameswei@google.com>2018-10-22 02:16:28 +0000
commitf7f608ccc3f820654b603d882b8bae3dd3e09b33 (patch)
treee5da932a3c8113208b23ca190ea3fbd036d75442 /media/java/android/mtp/MtpDatabase.java
parent9aac06cc132f41cf27b67eecdff0d3abf6a258f9 (diff)
MTP: media info can not be retrieved via MTP
Under the new MtpStorageManager design of Android P, media info like MP3 Track title, album and artist, Genre, etc can not be retrieved via MTP by Windows Media Player, Linux Rhythmbox and BMW Car Kit Bug: 112635346 Test: Windows Media Player Test: Linux Rhythmbox Change-Id: Ibbdaff52a24fa36c6090e799323b767dd5692207 (cherry picked from commit 7784da12b9b3394beb791b16befcd33075668270)
Diffstat (limited to 'media/java/android/mtp/MtpDatabase.java')
-rwxr-xr-xmedia/java/android/mtp/MtpDatabase.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/media/java/android/mtp/MtpDatabase.java b/media/java/android/mtp/MtpDatabase.java
index e67b100d840d..474b671c0c2b 100755
--- a/media/java/android/mtp/MtpDatabase.java
+++ b/media/java/android/mtp/MtpDatabase.java
@@ -538,8 +538,13 @@ public class MtpDatabase implements AutoCloseable {
MtpPropertyGroup propertyGroup;
for (MtpStorageManager.MtpObject obj : objs) {
if (property == 0xffffffff) {
+ if (format == 0 && handle != 0 && handle != 0xffffffff) {
+ // return properties based on the object's format
+ format = obj.getFormat();
+ }
// Get all properties supported by this object
- propertyGroup = mPropertyGroupsByFormat.get(obj.getFormat());
+ // format should be the same between get & put
+ propertyGroup = mPropertyGroupsByFormat.get(format);
if (propertyGroup == null) {
int[] propertyList = getSupportedObjectProperties(format);
propertyGroup = new MtpPropertyGroup(mMediaProvider, mVolumeName,