Downgrade Non-Critical Errors to Warnings
We are getting a lot of noise from Android bug-filers who are concerned about several non-critical errors that show up when using Widevine CDM on some devices or in some use cases. To mitigate this, we are downgrading these errors to warnings. Some of these errors pertained to our legacy support. To make sure an error IS logged if problems with legacy support become critical, a new error has been added to that code path. Bug: 15136575 Change-Id: Id28bcf507f277a5d2f35a14da71bba2b118a54fe
This commit is contained in:
@@ -8,7 +8,7 @@ namespace wvcdm {
|
||||
|
||||
bool BufferReader::Read1(uint8_t* v) {
|
||||
if (!HasBytes(1)) {
|
||||
LOGE("BufferReader::Read1 : Failure while parsing: Not enough bytes (1)");
|
||||
LOGW("BufferReader::Read1 : Failure while parsing: Not enough bytes (1)");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ bool BufferReader::Read1(uint8_t* v) {
|
||||
// Internal implementation of multi-byte reads
|
||||
template<typename T> bool BufferReader::Read(T* v) {
|
||||
if (!HasBytes(sizeof(T))) {
|
||||
LOGE("BufferReader::Read<T> : Failure during parse: Not enough bytes (%u)",
|
||||
LOGW("BufferReader::Read<T> : Failure during parse: Not enough bytes (%u)",
|
||||
sizeof(T));
|
||||
return false;
|
||||
}
|
||||
@@ -42,7 +42,7 @@ bool BufferReader::Read8s(int64_t* v) { return Read(v); }
|
||||
|
||||
bool BufferReader::ReadString(std::string* str, int count) {
|
||||
if (!HasBytes(count)) {
|
||||
LOGE("BufferReader::ReadString : Parse Failure: Not enough bytes (%d)",
|
||||
LOGW("BufferReader::ReadString : Parse Failure: Not enough bytes (%d)",
|
||||
count);
|
||||
return false;
|
||||
}
|
||||
@@ -54,7 +54,7 @@ bool BufferReader::ReadString(std::string* str, int count) {
|
||||
|
||||
bool BufferReader::ReadVec(std::vector<uint8_t>* vec, int count) {
|
||||
if (!HasBytes(count)) {
|
||||
LOGE("BufferReader::ReadVec : Parse Failure: Not enough bytes (%d)", count);
|
||||
LOGW("BufferReader::ReadVec : Parse Failure: Not enough bytes (%d)", count);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ bool BufferReader::ReadVec(std::vector<uint8_t>* vec, int count) {
|
||||
|
||||
bool BufferReader::SkipBytes(int bytes) {
|
||||
if (!HasBytes(bytes)) {
|
||||
LOGE("BufferReader::SkipBytes : Parse Failure: Not enough bytes (%d)",
|
||||
LOGW("BufferReader::SkipBytes : Parse Failure: Not enough bytes (%d)",
|
||||
bytes);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ WVCryptoFactory::WVCryptoFactory()
|
||||
mLegacyLibraryHandle = dlopen("libdrmdecrypt.so", RTLD_NOW);
|
||||
|
||||
if (mLegacyLibraryHandle == NULL) {
|
||||
ALOGE("Unable to locate libdrmdecrypt.so");
|
||||
ALOGW("Unable to locate libdrmdecrypt.so");
|
||||
} else {
|
||||
typedef CryptoFactory* (*CreateCryptoFactoryFunc)();
|
||||
|
||||
@@ -34,13 +34,13 @@ WVCryptoFactory::WVCryptoFactory()
|
||||
"createCryptoFactory");
|
||||
|
||||
if (legacyCreateCryptoFactory == NULL) {
|
||||
ALOGE("Unable to find legacy symbol 'createCryptoFactory'.");
|
||||
ALOGW("Unable to find legacy symbol 'createCryptoFactory'.");
|
||||
dlclose(mLegacyLibraryHandle);
|
||||
mLegacyLibraryHandle = NULL;
|
||||
} else {
|
||||
mLegacyFactory = legacyCreateCryptoFactory();
|
||||
if (mLegacyFactory == NULL) {
|
||||
ALOGE("Legacy createCryptoFactory() failed.");
|
||||
ALOGW("Legacy createCryptoFactory() failed.");
|
||||
dlclose(mLegacyLibraryHandle);
|
||||
mLegacyLibraryHandle = NULL;
|
||||
}
|
||||
@@ -74,6 +74,9 @@ status_t WVCryptoFactory::createPlugin(const uint8_t uuid[16], const void* data,
|
||||
// 0 size means they want an old-style Widevine plugin
|
||||
if (size == 0) {
|
||||
if (mLegacyFactory == NULL) {
|
||||
ALOGE("Legacy crypto factory loading failed. Cannot create legacy "
|
||||
"plugin. Look for warnings about this that were logged earlier, "
|
||||
"during CryptoFactory instantiation.");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user