Index: media/base/android/java/src/org/chromium/media/MediaDrmBridge.java |
diff --git a/media/base/android/java/src/org/chromium/media/MediaDrmBridge.java b/media/base/android/java/src/org/chromium/media/MediaDrmBridge.java |
index ad7d581c3f61cd895e6ab40ae003ae45d2808426..db0027631e5897cc9422d896e5d6a42105555d1b 100644 |
--- a/media/base/android/java/src/org/chromium/media/MediaDrmBridge.java |
+++ b/media/base/android/java/src/org/chromium/media/MediaDrmBridge.java |
@@ -56,7 +56,7 @@ public class MediaDrmBridge { |
// calls. Indirect calls should not call release() again to avoid |
// duplication (even though it doesn't hurt to call release() twice). |
- private static final String TAG = "MediaDrmBridge"; |
+ private static final String TAG = "cr.media"; |
private static final String SECURITY_LEVEL = "securityLevel"; |
private static final String SERVER_CERTIFICATE = "serviceCertificate"; |
private static final String PRIVACY_MODE = "privacyMode"; |
@@ -211,7 +211,7 @@ public class MediaDrmBridge { |
Log.e(TAG, "Cannot create MediaCrypto Session."); |
return false; |
} |
- Log.d(TAG, "MediaCrypto Session created: " + bytesToHexString(mMediaCryptoSession)); |
+ Log.d(TAG, "MediaCrypto Session created: %s", bytesToHexString(mMediaCryptoSession)); |
// Create MediaCrypto object. |
try { |
@@ -322,7 +322,7 @@ public class MediaDrmBridge { |
} |
String currentSecurityLevel = mMediaDrm.getPropertyString(SECURITY_LEVEL); |
- Log.e(TAG, "Security level: current " + currentSecurityLevel + ", new " + securityLevel); |
+ Log.e(TAG, "Security level: current %s, new %s", currentSecurityLevel, securityLevel); |
if (securityLevel.equals(currentSecurityLevel)) { |
// No need to set the same security level again. This is not just |
// a shortcut! Setting the same security level actually causes an |
@@ -334,12 +334,12 @@ public class MediaDrmBridge { |
mMediaDrm.setPropertyString(SECURITY_LEVEL, securityLevel); |
return true; |
} catch (java.lang.IllegalArgumentException e) { |
- Log.e(TAG, "Failed to set security level " + securityLevel, e); |
+ Log.e(TAG, "Failed to set security level %s", securityLevel, e); |
} catch (java.lang.IllegalStateException e) { |
- Log.e(TAG, "Failed to set security level " + securityLevel, e); |
+ Log.e(TAG, "Failed to set security level %s", securityLevel, e); |
} |
- Log.e(TAG, "Security level " + securityLevel + " not supported!"); |
+ Log.e(TAG, "Security level %s not supported!", securityLevel); |
return false; |
} |
@@ -466,7 +466,7 @@ public class MediaDrmBridge { |
} |
String result = (request != null) ? "successed" : "failed"; |
- Log.d(TAG, "getKeyRequest " + result + "!"); |
+ Log.d(TAG, "getKeyRequest %s!", result); |
return request; |
} |
@@ -590,7 +590,7 @@ public class MediaDrmBridge { |
} |
// Success! |
- Log.d(TAG, "createSession(): Session (" + bytesToHexString(sessionId) + ") created."); |
+ Log.d(TAG, "createSession(): Session (%s) created.", bytesToHexString(sessionId)); |
onPromiseResolvedWithSession(promiseId, sessionId); |
onSessionMessage(sessionId, request); |
mSessionIds.put(ByteBuffer.wrap(sessionId), mime); |
@@ -651,7 +651,7 @@ public class MediaDrmBridge { |
mSessionIds.remove(ByteBuffer.wrap(sessionId)); |
onPromiseResolved(promiseId); |
onSessionClosed(sessionId); |
- Log.d(TAG, "Session " + bytesToHexString(sessionId) + " closed."); |
+ Log.d(TAG, "Session %s closed", bytesToHexString(sessionId)); |
} |
/** |
@@ -685,7 +685,7 @@ public class MediaDrmBridge { |
// TODO(qinmin): remove this exception catch when b/10495563 is fixed. |
Log.e(TAG, "Exception intentionally caught when calling provideKeyResponse()", e); |
} |
- Log.d(TAG, "Key successfully added for session " + bytesToHexString(sessionId)); |
+ Log.d(TAG, "Key successfully added for session %s", bytesToHexString(sessionId)); |
onPromiseResolved(promiseId); |
onSessionKeysChange(sessionId, true, KEY_STATUS_USABLE); |
return; |
@@ -806,7 +806,7 @@ public class MediaDrmBridge { |
} |
private void onPromiseRejected(final long promiseId, final String errorMessage) { |
- Log.e(TAG, "onPromiseRejected: " + errorMessage); |
+ Log.e(TAG, "onPromiseRejected: %s", errorMessage); |
mHandler.post(new Runnable() { |
@Override |
public void run() { |
@@ -854,7 +854,7 @@ public class MediaDrmBridge { |
} |
private void onLegacySessionError(final byte[] sessionId, final String errorMessage) { |
- Log.e(TAG, "onLegacySessionError: " + errorMessage); |
+ Log.e(TAG, "onLegacySessionError: %s", errorMessage); |
mHandler.post(new Runnable() { |
@Override |
public void run() { |
@@ -885,7 +885,7 @@ public class MediaDrmBridge { |
return; |
} |
if (!sessionExists(sessionId)) { |
- Log.e(TAG, "MediaDrmListener: Invalid session " + bytesToHexString(sessionId)); |
+ Log.e(TAG, "MediaDrmListener: Invalid session %s", bytesToHexString(sessionId)); |
return; |
} |
switch(event) { |
@@ -944,7 +944,7 @@ public class MediaDrmBridge { |
protected Void doInBackground(String... urls) { |
mResponseBody = postRequest(urls[0], mDrmRequest); |
if (mResponseBody != null) { |
- Log.d(TAG, "response length=" + mResponseBody.length); |
+ Log.d(TAG, "response length=%d", mResponseBody.length); |
} |
return null; |
} |
@@ -980,7 +980,7 @@ public class MediaDrmBridge { |
} |
return bos.toByteArray(); |
} else { |
- Log.d(TAG, "Server returned HTTP error code " + responseCode); |
+ Log.d(TAG, "Server returned HTTP error code %d", responseCode); |
return null; |
} |
} catch (MalformedURLException e) { |