wayne-common: biometric: Detect fingerprint from cmdline

* Cleanup fingerprint logic
This commit is contained in:
Isaac Chen 2018-10-23 00:47:53 +08:00
parent 1f768a77be
commit f89bf07b99
2 changed files with 2 additions and 25 deletions

View file

@ -221,7 +221,7 @@ fingerprint_device_t* getDeviceForVendor(const char *class_name)
if (!strcmp(class_name, "fpc")) { if (!strcmp(class_name, "fpc")) {
err = load("/system/vendor/lib64/hw/fingerprint.fpc.so", &hw_module); err = load("/system/vendor/lib64/hw/fingerprint.fpc.so", &hw_module);
} else if (!strcmp(class_name, "goodix")) { } else if (!strcmp(class_name, "gdx")) {
err = load("/system/vendor/lib64/hw/fingerprint.goodix.so", &hw_module); err = load("/system/vendor/lib64/hw/fingerprint.goodix.so", &hw_module);
} else { } else {
ALOGE("No fingerprint module class specified."); ALOGE("No fingerprint module class specified.");
@ -271,7 +271,7 @@ fingerprint_device_t* getFingerprintDevice()
fingerprint_device_t *fp_device; fingerprint_device_t *fp_device;
char class_name[PROPERTY_VALUE_MAX]; char class_name[PROPERTY_VALUE_MAX];
property_get("ro.boot.fingerprint", property_get("ro.boot.fpsensor",
class_name, NULL); class_name, NULL);
fp_device = getDeviceForVendor(class_name); fp_device = getDeviceForVendor(class_name);

View file

@ -54,28 +54,6 @@ char const *heapsize;
char const *heapminfree; char const *heapminfree;
char const *heapmaxfree; char const *heapmaxfree;
static void init_finger_print_properties()
{
std::ifstream fin;
std::string buf;
std::string product = GetProperty("ro.product.name", "");
if (product.find("wayne") == std::string::npos)
return;
fin.open("/proc/cmdline");
while (std::getline(fin, buf, ' '))
if (buf.find("fpsensor") != std::string::npos)
break;
fin.close();
if (buf.find("fpc") != std::string::npos) {
property_set("ro.boot.fingerprint", "fpc");
} else {
property_set("ro.boot.fingerprint", "goodix");
}
}
static void init_alarm_boot_properties() static void init_alarm_boot_properties()
{ {
char const *boot_reason_file = "/proc/sys/kernel/boot_reason"; char const *boot_reason_file = "/proc/sys/kernel/boot_reason";
@ -137,7 +115,6 @@ void vendor_load_properties()
{ {
init_alarm_boot_properties(); init_alarm_boot_properties();
check_device(); check_device();
init_finger_print_properties();
property_set("dalvik.vm.heapstartsize", heapstartsize); property_set("dalvik.vm.heapstartsize", heapstartsize);
property_set("dalvik.vm.heapgrowthlimit", heapgrowthlimit); property_set("dalvik.vm.heapgrowthlimit", heapgrowthlimit);