Class FakeExoMediaDrm.Builder
- java.lang.Object
-
- com.google.android.exoplayer2.testutil.FakeExoMediaDrm.Builder
-
- Enclosing class:
- FakeExoMediaDrm
public static class FakeExoMediaDrm.Builder extends Object
Builder forFakeExoMediaDrm
instances.
-
-
Constructor Summary
Constructors Constructor Description Builder()
Constructs an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FakeExoMediaDrm
build()
Returns aFakeExoMediaDrm
instance with an initial reference count of 1.FakeExoMediaDrm.Builder
setEnforceValidKeyResponses(boolean enforceValidKeyResponses)
Sets whether key responses passed toFakeExoMediaDrm.provideKeyResponse(byte[], byte[])
should be checked for validity (i.e.FakeExoMediaDrm.Builder
setMaxConcurrentSessions(int maxConcurrentSessions)
Sets the maximum number of concurrent sessions theFakeExoMediaDrm
will support.FakeExoMediaDrm.Builder
setProvisionsRequired(int provisionsRequired)
Sets how many successful provisioning round trips are needed for theFakeExoMediaDrm
to be provisioned.FakeExoMediaDrm.Builder
throwNotProvisionedExceptionFromGetKeyRequest()
Configures theFakeExoMediaDrm
to throw anyNotProvisionedException
fromFakeExoMediaDrm.getKeyRequest(byte[], List, int, HashMap)
instead of the default behaviour of throwing fromFakeExoMediaDrm.openSession()
.
-
-
-
Method Detail
-
setEnforceValidKeyResponses
@CanIgnoreReturnValue public FakeExoMediaDrm.Builder setEnforceValidKeyResponses(boolean enforceValidKeyResponses)
Sets whether key responses passed toFakeExoMediaDrm.provideKeyResponse(byte[], byte[])
should be checked for validity (i.e. that they came from aFakeExoMediaDrm.LicenseServer
).Defaults to true.
-
setProvisionsRequired
@CanIgnoreReturnValue public FakeExoMediaDrm.Builder setProvisionsRequired(int provisionsRequired)
Sets how many successful provisioning round trips are needed for theFakeExoMediaDrm
to be provisioned.An unprovisioned
FakeExoMediaDrm
will throwNotProvisionedException
from methods that declare it until enough valid provisioning responses are passed toFakeExoMediaDrm.provideProvisionResponse(byte[])
.Defaults to 0 (i.e. device is already provisioned).
-
throwNotProvisionedExceptionFromGetKeyRequest
@CanIgnoreReturnValue public FakeExoMediaDrm.Builder throwNotProvisionedExceptionFromGetKeyRequest()
Configures theFakeExoMediaDrm
to throw anyNotProvisionedException
fromFakeExoMediaDrm.getKeyRequest(byte[], List, int, HashMap)
instead of the default behaviour of throwing fromFakeExoMediaDrm.openSession()
.
-
setMaxConcurrentSessions
@CanIgnoreReturnValue public FakeExoMediaDrm.Builder setMaxConcurrentSessions(int maxConcurrentSessions)
Sets the maximum number of concurrent sessions theFakeExoMediaDrm
will support.If this is exceeded then subsequent calls to
FakeExoMediaDrm.openSession()
will throwResourceBusyException
.Defaults to
Integer.MAX_VALUE
.
-
build
public FakeExoMediaDrm build()
Returns aFakeExoMediaDrm
instance with an initial reference count of 1. The caller is responsible for callingFakeExoMediaDrm.release()
when they no longer need the instance.
-
-