mirror of
https://github.com/androidx/media.git
synced 2025-05-08 08:00:49 +08:00
Check for null listeners in deprecated paths in DefaultDrmSessionManager.
The previous API allowed to pass in null to the constructors although variants without listeners exist. That's why we need to handle these null values. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=191577891
This commit is contained in:
parent
631e1db7f9
commit
7c65b94578
@ -121,7 +121,9 @@ public class DefaultDrmSessionManager<T extends ExoMediaCrypto> implements DrmSe
|
||||
throws UnsupportedDrmException {
|
||||
DefaultDrmSessionManager<FrameworkMediaCrypto> drmSessionManager =
|
||||
newWidevineInstance(callback, optionalKeyRequestParameters);
|
||||
if (eventHandler != null && eventListener != null) {
|
||||
drmSessionManager.addListener(eventHandler, eventListener);
|
||||
}
|
||||
return drmSessionManager;
|
||||
}
|
||||
|
||||
@ -152,7 +154,9 @@ public class DefaultDrmSessionManager<T extends ExoMediaCrypto> implements DrmSe
|
||||
throws UnsupportedDrmException {
|
||||
DefaultDrmSessionManager<FrameworkMediaCrypto> drmSessionManager =
|
||||
newPlayReadyInstance(callback, customData);
|
||||
if (eventHandler != null && eventListener != null) {
|
||||
drmSessionManager.addListener(eventHandler, eventListener);
|
||||
}
|
||||
return drmSessionManager;
|
||||
}
|
||||
|
||||
@ -192,7 +196,9 @@ public class DefaultDrmSessionManager<T extends ExoMediaCrypto> implements DrmSe
|
||||
throws UnsupportedDrmException {
|
||||
DefaultDrmSessionManager<FrameworkMediaCrypto> drmSessionManager =
|
||||
newFrameworkInstance(uuid, callback, optionalKeyRequestParameters);
|
||||
if (eventHandler != null && eventListener != null) {
|
||||
drmSessionManager.addListener(eventHandler, eventListener);
|
||||
}
|
||||
return drmSessionManager;
|
||||
}
|
||||
|
||||
@ -230,8 +236,10 @@ public class DefaultDrmSessionManager<T extends ExoMediaCrypto> implements DrmSe
|
||||
Handler eventHandler,
|
||||
DefaultDrmSessionEventListener eventListener) {
|
||||
this(uuid, mediaDrm, callback, optionalKeyRequestParameters);
|
||||
if (eventHandler != null && eventListener != null) {
|
||||
addListener(eventHandler, eventListener);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param uuid The UUID of the drm scheme.
|
||||
@ -268,8 +276,10 @@ public class DefaultDrmSessionManager<T extends ExoMediaCrypto> implements DrmSe
|
||||
DefaultDrmSessionEventListener eventListener,
|
||||
boolean multiSession) {
|
||||
this(uuid, mediaDrm, callback, optionalKeyRequestParameters, multiSession);
|
||||
if (eventHandler != null && eventListener != null) {
|
||||
addListener(eventHandler, eventListener);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param uuid The UUID of the drm scheme.
|
||||
@ -316,8 +326,10 @@ public class DefaultDrmSessionManager<T extends ExoMediaCrypto> implements DrmSe
|
||||
optionalKeyRequestParameters,
|
||||
multiSession,
|
||||
initialDrmRequestRetryCount);
|
||||
if (eventHandler != null && eventListener != null) {
|
||||
addListener(eventHandler, eventListener);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param uuid The UUID of the drm scheme.
|
||||
|
Loading…
x
Reference in New Issue
Block a user