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

Commit 24f44f2b authored by Robert Shih's avatar Robert Shih Committed by Android (Google) Code Review
Browse files

Merge "MediaPlayer2: create one MediaDrm per DRM scheme"

parents 9b4d5c22 9d9b1075
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -4482,6 +4482,7 @@ public class MediaPlayer2 implements AutoCloseable
    };

    // Modular DRM
    private final Map<UUID, MediaDrm> mDrmObjs = new HashMap<>();
    private class DrmHandle {

        static final int PROVISION_TIMEOUT_MS = 60000;
@@ -4594,7 +4595,13 @@ public class MediaPlayer2 implements AutoCloseable
            Log.v(TAG, "prepareDrm_createDrmStep: UUID: " + uuid);

            try {
                mDrmObj = new MediaDrm(uuid);
                mDrmObj = mDrmObjs.computeIfAbsent(uuid, scheme -> {
                    try {
                        return new MediaDrm(scheme);
                    } catch (UnsupportedSchemeException e) {
                        throw new IllegalArgumentException(e);
                    }
                });
                Log.v(TAG, "prepareDrm_createDrmStep: Created mDrmObj=" + mDrmObj);
            } catch (Exception e) { // UnsupportedSchemeException
                Log.e(TAG, "prepareDrm_createDrmStep: MediaDrm failed with " + e);