--- a/mobile/android/base/java/org/mozilla/gecko/media/GeckoMediaDrmBridgeV21.java
+++ b/mobile/android/base/java/org/mozilla/gecko/media/GeckoMediaDrmBridgeV21.java
@@ -137,17 +137,16 @@ public class GeckoMediaDrmBridgeV21 impl
if (mProvisioningPromiseId > 0 && mCrypto == null) {
if (DEBUG) Log.d(LOGTAG, "Pending createSession because it's provisioning !");
savePendingCreateSessionData(createSessionToken, promiseId,
initData, initDataType);
return;
}
ByteBuffer sessionId = null;
- String strSessionId = null;
try {
boolean hasMediaCrypto = ensureMediaCryptoCreated();
if (!hasMediaCrypto) {
onRejectPromise(promiseId, "MediaCrypto intance is not created !");
return;
}
sessionId = openSession();
@@ -165,19 +164,18 @@ public class GeckoMediaDrmBridgeV21 impl
onSessionCreated(createSessionToken,
promiseId,
sessionId.array(),
request.getData());
onSessionMessage(sessionId.array(),
LICENSE_REQUEST_INITIAL,
request.getData());
mSessionMIMETypes.put(sessionId, initDataType);
- strSessionId = new String(sessionId.array());
mSessionIds.add(sessionId);
- if (DEBUG) Log.d(LOGTAG, " StringID : " + strSessionId + " is put into mSessionIds ");
+ if (DEBUG) Log.d(LOGTAG, " StringID : " + new String(sessionId.array()) + " is put into mSessionIds ");
} catch (android.media.NotProvisionedException e) {
if (DEBUG) Log.d(LOGTAG, "Device not provisioned:" + e.getMessage());
if (sessionId != null) {
// The promise of this createSession will be either resolved
// or rejected after provisioning.
mDrm.closeSession(sessionId.array());
}
savePendingCreateSessionData(createSessionToken, promiseId,
@@ -366,30 +364,29 @@ public class GeckoMediaDrmBridgeV21 impl
}
ByteBuffer session = ByteBuffer.wrap(sessionArray);
if (!sessionExists(session)) {
if (DEBUG) Log.d(LOGTAG, "MediaDrmListener: Invalid session.");
return;
}
// On L, these events are treated as exceptions and handled correspondingly.
// Leaving this code block for logging message.
- String sessionId = new String(session.array());
switch (event) {
case MediaDrm.EVENT_PROVISION_REQUIRED:
if (DEBUG) Log.d(LOGTAG, "MediaDrm.EVENT_PROVISION_REQUIRED");
break;
case MediaDrm.EVENT_KEY_REQUIRED:
if (DEBUG) Log.d(LOGTAG, "MediaDrm.EVENT_KEY_REQUIRED");
// No need to handle here if we're not in privacy mode.
break;
case MediaDrm.EVENT_KEY_EXPIRED:
- if (DEBUG) Log.d(LOGTAG, "MediaDrm.EVENT_KEY_EXPIRED, sessionId=" + sessionId);
+ if (DEBUG) Log.d(LOGTAG, "MediaDrm.EVENT_KEY_EXPIRED, sessionId=" + new String(session.array()));
break;
case MediaDrm.EVENT_VENDOR_DEFINED:
- if (DEBUG) Log.d(LOGTAG, "MediaDrm.EVENT_VENDOR_DEFINED, sessionId=" + sessionId);
+ if (DEBUG) Log.d(LOGTAG, "MediaDrm.EVENT_VENDOR_DEFINED, sessionId=" + new String(session.array()));
break;
default:
if (DEBUG) Log.d(LOGTAG, "Invalid DRM event " + event);
return;
}
}
}
@@ -587,19 +584,18 @@ public class GeckoMediaDrmBridgeV21 impl
if (mCryptoSessionId == null) {
if (DEBUG) Log.d(LOGTAG, "Cannot open session for MediaCrypto");
return false;
}
if (MediaCrypto.isCryptoSchemeSupported(mSchemeUUID)) {
final byte [] cryptoSessionId = mCryptoSessionId.array();
mCrypto = new MediaCrypto(mSchemeUUID, cryptoSessionId);
- String strCryptoSessionId = new String(cryptoSessionId);
mSessionIds.add(mCryptoSessionId);
- if (DEBUG) Log.d(LOGTAG, "MediaCrypto successfully created! - SId " + INVALID_SESSION_ID + ", " + strCryptoSessionId);
+ if (DEBUG) Log.d(LOGTAG, "MediaCrypto successfully created! - SId " + INVALID_SESSION_ID + ", " + new String(cryptoSessionId));
return true;
} else {
if (DEBUG) Log.d(LOGTAG, "Cannot create MediaCrypto for unsupported scheme.");
return false;
}
} catch (android.media.MediaCryptoException e) {
if (DEBUG) Log.d(LOGTAG, "Cannot create MediaCrypto:" + e.getMessage());
release();