зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1495053 - p1: support setting server certificate in MediaDrm bridge. r=cpearce
Differential Revision: https://phabricator.services.mozilla.com/D7790 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
38c1a64250
Коммит
b691f2d917
|
@ -22,4 +22,6 @@ interface IMediaDrmBridge {
|
|||
oneway void closeSession(int promiseId, String sessionId);
|
||||
|
||||
oneway void release();
|
||||
|
||||
void setServerCertificate(in byte[] cert);
|
||||
}
|
||||
|
|
|
@ -32,4 +32,5 @@ public interface GeckoMediaDrm {
|
|||
void closeSession(int promiseId, String sessionId);
|
||||
void release();
|
||||
MediaCrypto getMediaCrypto();
|
||||
void setServerCertificate(final byte[] cert);
|
||||
}
|
||||
|
|
|
@ -301,6 +301,16 @@ public class GeckoMediaDrmBridgeV21 implements GeckoMediaDrm {
|
|||
return mCrypto;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setServerCertificate(final byte[] cert) {
|
||||
if (DEBUG) Log.d(LOGTAG, "setServerCertificate()");
|
||||
if (mDrm == null) {
|
||||
throw new IllegalStateException("MediaDrm instance doesn't exist !!");
|
||||
}
|
||||
mDrm.setPropertyByteArray("serviceCertificate", cert);
|
||||
return;
|
||||
}
|
||||
|
||||
protected void HandleKeyStatusChangeByDummyKey(String sessionId)
|
||||
{
|
||||
SessionKeyInfo[] keyInfos = new SessionKeyInfo[1];
|
||||
|
|
|
@ -150,4 +150,15 @@ final class RemoteMediaDrmBridge implements GeckoMediaDrm {
|
|||
assertTrue(false);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void setServerCertificate(final byte[] cert) {
|
||||
try {
|
||||
mRemote.setServerCertificate(cert);
|
||||
} catch (Exception e) {
|
||||
Log.e(LOGTAG, "Got exception while setting server certificate.", e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -243,4 +243,14 @@ final class RemoteMediaDrmBridgeStub extends IMediaDrmBridge.Stub implements IBi
|
|||
mCallbacks = null;
|
||||
mStubId = "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void setServerCertificate(final byte[] cert) {
|
||||
try {
|
||||
mBridge.setServerCertificate(cert);
|
||||
} catch (IllegalStateException e) {
|
||||
Log.e(LOGTAG, "Failed to setServerCertificate.", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче