Squashed merge 3 CLs.
1. "Change CdmResponseType from enum into a struct" Merged from http://go/wvgerrit/163199 Bug: 253271674 2. "Log request information when server returns 401" Bug: 260760387 Bug: 186031735 Merged from http://go/wvgerrit/162798 3. "Specify server version on the command line" Bug: 251599048 Merged from http://go/wvgerrit/158897 Test: build android.hardware.drm-service.widevine Test: Netflix and Play Movies & TV Test: build_and_run_all_unit_tests.sh Bug: 253271674 Change-Id: I70c950acce070609ee0343920ec68e66b058bc23
This commit is contained in:
@@ -72,39 +72,39 @@ CdmResponseType ClientIdentification::InitForProvisioningRequest(
|
||||
const std::string& client_token, CryptoSession* crypto_session) {
|
||||
if (crypto_session == nullptr) {
|
||||
LOGE("Crypto session not provided");
|
||||
return PARAMETER_NULL;
|
||||
return CdmResponseType(PARAMETER_NULL);
|
||||
}
|
||||
is_license_request_ = false;
|
||||
client_token_ = client_token;
|
||||
crypto_session_ = crypto_session;
|
||||
return NO_ERROR;
|
||||
return CdmResponseType(NO_ERROR);
|
||||
}
|
||||
|
||||
CdmResponseType ClientIdentification::InitForLicenseRequest(
|
||||
const std::string& client_token, CryptoSession* crypto_session) {
|
||||
if (crypto_session == nullptr) {
|
||||
LOGE("Crypto session not provided");
|
||||
return PARAMETER_NULL;
|
||||
return CdmResponseType(PARAMETER_NULL);
|
||||
}
|
||||
if (client_token.empty()) {
|
||||
LOGE("Client token is empty");
|
||||
return PARAMETER_NULL;
|
||||
return CdmResponseType(PARAMETER_NULL);
|
||||
}
|
||||
is_license_request_ = true;
|
||||
client_token_ = client_token;
|
||||
crypto_session_ = crypto_session;
|
||||
return NO_ERROR;
|
||||
return CdmResponseType(NO_ERROR);
|
||||
}
|
||||
|
||||
CdmResponseType ClientIdentification::InitForOtaKeyboxProvisioning(
|
||||
CryptoSession* crypto_session) {
|
||||
if (crypto_session == nullptr) {
|
||||
LOGE("Crypto session not provided");
|
||||
return PARAMETER_NULL;
|
||||
return CdmResponseType(PARAMETER_NULL);
|
||||
}
|
||||
is_okp_request_ = true;
|
||||
crypto_session_ = crypto_session;
|
||||
return NO_ERROR;
|
||||
return CdmResponseType(NO_ERROR);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -131,7 +131,7 @@ CdmResponseType ClientIdentification::Prepare(
|
||||
video_widevine::ClientIdentification::TokenType token_type;
|
||||
if (!GetProvisioningTokenType(&token_type)) {
|
||||
LOGE("Failed to get provisioning token type");
|
||||
return CLIENT_IDENTIFICATION_TOKEN_ERROR_1;
|
||||
return CdmResponseType(CLIENT_IDENTIFICATION_TOKEN_ERROR_1);
|
||||
}
|
||||
client_id->set_type(token_type);
|
||||
|
||||
@@ -140,8 +140,7 @@ CdmResponseType ClientIdentification::Prepare(
|
||||
CdmResponseType status =
|
||||
crypto_session_->GetProvisioningToken(&token, &additional_token);
|
||||
if (status != NO_ERROR) {
|
||||
LOGE("Failed to get provisioning token: status = %d",
|
||||
static_cast<int>(status));
|
||||
LOGE("Failed to get provisioning token: status = %d", status.Enum());
|
||||
return status;
|
||||
}
|
||||
client_id->set_token(token);
|
||||
@@ -221,7 +220,7 @@ CdmResponseType ClientIdentification::Prepare(
|
||||
|
||||
if (is_okp_request_) {
|
||||
// Capabilities is not important for OTA keybox provisionining.
|
||||
return NO_ERROR;
|
||||
return CdmResponseType(NO_ERROR);
|
||||
}
|
||||
|
||||
ClientCapabilities* client_capabilities =
|
||||
@@ -365,7 +364,7 @@ CdmResponseType ClientIdentification::Prepare(
|
||||
}
|
||||
}
|
||||
|
||||
return NO_ERROR;
|
||||
return CdmResponseType(NO_ERROR);
|
||||
}
|
||||
|
||||
bool ClientIdentification::GetProvisioningTokenType(
|
||||
|
||||
Reference in New Issue
Block a user