Added Fingerprint Virtual HAL AIDL extension
Bug: 326227403
Test: atest android.hardware.biometrics.fingerprint.* -c
Change-Id: I967c009c99f8dc279f89c21a59cf0462d9590296
diff --git a/biometrics/common/config/Config.cpp b/biometrics/common/config/Config.cpp
index 01ae864..a13bdf0 100644
--- a/biometrics/common/config/Config.cpp
+++ b/biometrics/common/config/Config.cpp
@@ -34,7 +34,7 @@
else if (value == "false")
res.emplace(false);
else
- LOG(ERROR) << "ERROR: invalid bool " << value;
+ LOG(FATAL) << "ERROR: invalid bool " << value;
return res;
}
@@ -48,7 +48,11 @@
OptInt32 res;
if (!value.empty()) {
std::int32_t val;
- if (ParseInt(value, &val)) res.emplace(val);
+ if (ParseInt(value, &val)) {
+ res.emplace(val);
+ } else {
+ LOG(FATAL) << "ERROR: Could not parse " << value << " as Int32";
+ }
}
return res;
}
@@ -59,6 +63,8 @@
std::int64_t val = std::strtoull(value.c_str(), nullptr, 10);
if (val != 0LL or (val == 0LL && value == "0")) {
res.emplace(val);
+ } else {
+ LOG(FATAL) << "ERROR: Could not parse " << value << " as Int64";
}
}
return res;
@@ -87,7 +93,7 @@
bool Config::setParam(const std::string& name, const std::string& value) {
auto it = mMap.find(name);
if (it == mMap.end()) {
- LOG(ERROR) << "ERROR: setParam unknown config name " << name;
+ LOG(FATAL) << "ERROR: setParam unknown config name " << name;
return false;
}
LOG(INFO) << "setParam name=" << name << "=" << value;
@@ -102,7 +108,7 @@
ConfigValue Config::getInternal(const std::string& name) {
ConfigValue res;
- auto data = mMap[name];
+ auto& data = mMap[name];
switch (mSource) {
case ConfigSourceType::SOURCE_SYSPROP:
res = data.getter();
@@ -111,10 +117,10 @@
res = data.value;
break;
case ConfigSourceType::SOURCE_FILE:
- LOG(WARNING) << "Unsupported";
+ UNIMPLEMENTED(ERROR) << " File-based config is not supported yet";
break;
default:
- LOG(ERROR) << " wrong srouce type " << (int)mSource;
+ LOG(FATAL) << "Wrong srouce type " << (int)mSource;
break;
}
@@ -127,7 +133,7 @@
bool Config::setInternal(const std::string& name, const ConfigValue& val) {
bool res = false;
- auto data = mMap[name];
+ auto& data = mMap[name];
switch (mSource) {
case ConfigSourceType::SOURCE_SYSPROP:
@@ -138,10 +144,10 @@
res = true;
break;
case ConfigSourceType::SOURCE_FILE:
- LOG(WARNING) << "Unsupported";
+ UNIMPLEMENTED(ERROR) << " File-based config is not supported yet";
break;
default:
- LOG(ERROR) << " wrong srouce type " << (int)mSource;
+ LOG(FATAL) << "Wrong srouce type " << (int)mSource;
break;
}