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
This commit is contained in:
Manish Singh
2021-01-19 21:30:31 +00:00
parent b80bfcbdbe
commit 530d7d9cdb

View File

@@ -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());