Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 530d7d9c authored by Manish Singh's avatar Manish Singh
Browse files

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
parent b80bfcbd
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -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());