diff options
author | Manish Singh <psych@google.com> | 2021-01-19 21:30:31 +0000 |
---|---|---|
committer | Manish Singh <psych@google.com> | 2021-01-20 19:34:56 +0000 |
commit | 530d7d9cdbad2e2adaec8f1660738392771b48dd (patch) | |
tree | bc37be383db0581df519c2f89e3071d7813baede /media/java/android/mtp/MtpDatabase.java | |
parent | b80bfcbdbef94e86f7dd7e8ee7714f2f0129c395 (diff) |
Add unsupported mime types in media capabilities
Since ApplicationMediaCapabilities now provides the option to add
unsupported mime types, we add the unsupported types to the bundle for
the case when we want transcoding to happen in MTP.
Test: manual
BUG=158466651
Change-Id: I1266c0753e43b84ec4f5bd181386f5c6aeb477d3
Diffstat (limited to 'media/java/android/mtp/MtpDatabase.java')
-rwxr-xr-x | media/java/android/mtp/MtpDatabase.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/media/java/android/mtp/MtpDatabase.java b/media/java/android/mtp/MtpDatabase.java index 4f27b197273c..6141b7fc7463 100755 --- a/media/java/android/mtp/MtpDatabase.java +++ b/media/java/android/mtp/MtpDatabase.java @@ -769,10 +769,12 @@ public class MtpDatabase implements AutoCloseable { try { Log.i(TAG, "openFile with transcode support: " + path); - // TODO(b/158466651): Pass the |transcode| variable as flag to openFile - Bundle bundle = null; - if (!transcode) { - bundle = new Bundle(); + Bundle bundle = new Bundle(); + if (transcode) { + bundle.putParcelable(MediaStore.EXTRA_MEDIA_CAPABILITIES, + new ApplicationMediaCapabilities.Builder().addUnsupportedVideoMimeType( + MediaFormat.MIMETYPE_VIDEO_HEVC).build()); + } else { bundle.putParcelable(MediaStore.EXTRA_MEDIA_CAPABILITIES, new ApplicationMediaCapabilities.Builder().addSupportedVideoMimeType( MediaFormat.MIMETYPE_VIDEO_HEVC).build()); |