Merge "Don't try to open non-existant file"
This commit is contained in:
committed by
Android (Google) Code Review
commit
f8d114ad11
@@ -714,8 +714,16 @@ class Adapter {
|
||||
return false;
|
||||
}
|
||||
ssize_t size = file_system.FileSize(filename);
|
||||
if (size <= 0) {
|
||||
LOGW("Could not find %s. Falling Back to L3.", filename.c_str());
|
||||
level1_.Terminate();
|
||||
metrics->OemCryptoDynamicAdapterMetrics::SetInitializationMode(
|
||||
wvcdm::metrics::
|
||||
OEMCrypto_INITIALIZED_USING_L3_COULD_NOT_OPEN_FACTORY_KEYBOX);
|
||||
return false;
|
||||
}
|
||||
wvcdm::File* file = file_system.Open(filename, file_system.kReadOnly);
|
||||
if (size <= 0 || !file) {
|
||||
if (!file) {
|
||||
LOGW("Could not open %s. Falling Back to L3.", filename.c_str());
|
||||
level1_.Terminate();
|
||||
metrics->OemCryptoDynamicAdapterMetrics::SetInitializationMode(
|
||||
|
||||
Reference in New Issue
Block a user