Commit f72a11ce authored by John Rummell's avatar John Rummell Committed by Commit Bot

Keep track of origin ID for logging

Adds |mOrigin| to keep track of the origin ID used.

Also removes some unnecessary logging, especially of errors when
a security level is not supported.

Bug: 917527
Test: Installed Chrome and looked at the adb log
Change-Id: Icb930af9b96da42d4ce1c675639ada4cb5cfc8ce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1802697Reviewed-by: default avatarXiaohan Wang <xhwang@chromium.org>
Commit-Queue: John Rummell <jrummell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708041}
parent 07e56877
...@@ -112,6 +112,9 @@ public class MediaDrmBridge { ...@@ -112,6 +112,9 @@ public class MediaDrmBridge {
// Whether the current MediaDrmBridge instance is waiting for provisioning response. // Whether the current MediaDrmBridge instance is waiting for provisioning response.
private boolean mProvisioningPending; private boolean mProvisioningPending;
// Current 'ORIGIN" setting.
private String mOrigin;
// Boolean to track if 'ORIGIN' is set in MediaDrm. // Boolean to track if 'ORIGIN' is set in MediaDrm.
private boolean mOriginSet; private boolean mOriginSet;
...@@ -486,7 +489,7 @@ public class MediaDrmBridge { ...@@ -486,7 +489,7 @@ public class MediaDrmBridge {
*/ */
private boolean setOrigin(String origin) { private boolean setOrigin(String origin) {
assert Build.VERSION.SDK_INT >= Build.VERSION_CODES.M; assert Build.VERSION.SDK_INT >= Build.VERSION_CODES.M;
Log.i(TAG, "Set origin: %s", origin); Log.d(TAG, "Set origin: %s", origin);
if (!isWidevine()) { if (!isWidevine()) {
Log.d(TAG, "Property " + ORIGIN + " isn't supported"); Log.d(TAG, "Property " + ORIGIN + " isn't supported");
...@@ -498,6 +501,7 @@ public class MediaDrmBridge { ...@@ -498,6 +501,7 @@ public class MediaDrmBridge {
try { try {
mMediaDrm.setPropertyString(ORIGIN, origin); mMediaDrm.setPropertyString(ORIGIN, origin);
mOrigin = origin;
mOriginSet = true; mOriginSet = true;
return true; return true;
} catch (java.lang.IllegalArgumentException e) { } catch (java.lang.IllegalArgumentException e) {
...@@ -533,7 +537,7 @@ public class MediaDrmBridge { ...@@ -533,7 +537,7 @@ public class MediaDrmBridge {
return false; return false;
} }
Log.i(TAG, "Security level: current %s, new %s", currentSecurityLevel, securityLevel); Log.d(TAG, "Security level: current %s, new %s", currentSecurityLevel, securityLevel);
if (securityLevel.equals(currentSecurityLevel)) { if (securityLevel.equals(currentSecurityLevel)) {
// No need to set the same security level again. This is not just // No need to set the same security level again. This is not just
// a shortcut! Setting the same security level actually causes an // a shortcut! Setting the same security level actually causes an
...@@ -545,9 +549,7 @@ public class MediaDrmBridge { ...@@ -545,9 +549,7 @@ public class MediaDrmBridge {
mMediaDrm.setPropertyString(SECURITY_LEVEL, securityLevel); mMediaDrm.setPropertyString(SECURITY_LEVEL, securityLevel);
return true; return true;
} catch (java.lang.IllegalArgumentException e) { } catch (java.lang.IllegalArgumentException e) {
Log.e(TAG, "Failed to set security level %s", securityLevel, e);
} catch (java.lang.IllegalStateException e) { } catch (java.lang.IllegalStateException e) {
Log.e(TAG, "Failed to set security level %s", securityLevel, e);
} }
Log.e(TAG, "Security level %s not supported!", securityLevel); Log.e(TAG, "Security level %s not supported!", securityLevel);
...@@ -1204,6 +1206,7 @@ public class MediaDrmBridge { ...@@ -1204,6 +1206,7 @@ public class MediaDrmBridge {
return false; return false;
} }
Log.i(TAG, "Provisioning origin ID %s", mOriginSet ? mOrigin : "<none>");
MediaDrmBridgeJni.get().onProvisionRequest(mNativeMediaDrmBridge, MediaDrmBridge.this, MediaDrmBridgeJni.get().onProvisionRequest(mNativeMediaDrmBridge, MediaDrmBridge.this,
request.getDefaultUrl(), request.getData()); request.getDefaultUrl(), request.getData());
return true; return true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment