mirror of
https://github.com/LineageOS/android_device_xiaomi_whyred.git
synced 2025-10-03 01:39:16 +02:00
whyred: Goodix fp hal is present as fingerprint.default.so
So load it directly and specify class as fpc for fpc hal.
This commit is contained in:
parent
1f37c1a0ad
commit
464157cfd0
3 changed files with 14 additions and 9 deletions
|
@ -27,6 +27,7 @@ cc_binary {
|
||||||
"libhwbinder",
|
"libhwbinder",
|
||||||
"liblog",
|
"liblog",
|
||||||
"libutils",
|
"libutils",
|
||||||
|
"libcutils",
|
||||||
"android.hardware.biometrics.fingerprint@2.1",
|
"android.hardware.biometrics.fingerprint@2.1",
|
||||||
],
|
],
|
||||||
proprietary: true,
|
proprietary: true,
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
#define LOG_TAG "android.hardware.biometrics.fingerprint@2.1-service.xiaomi_sdm660"
|
#define LOG_TAG "android.hardware.biometrics.fingerprint@2.1-service.xiaomi_sdm660"
|
||||||
|
#define FP_SENSOR_PROP "ro.boot.fpsensor"
|
||||||
|
|
||||||
#include <hardware/hw_auth_token.h>
|
#include <hardware/hw_auth_token.h>
|
||||||
|
|
||||||
|
@ -24,6 +25,7 @@
|
||||||
|
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <cutils/properties.h>
|
||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
namespace hardware {
|
namespace hardware {
|
||||||
|
@ -215,8 +217,17 @@ fingerprint_device_t* getDeviceForVendor(const char *class_name)
|
||||||
{
|
{
|
||||||
const hw_module_t *hw_module = nullptr;
|
const hw_module_t *hw_module = nullptr;
|
||||||
int err;
|
int err;
|
||||||
|
char fp_vendor[PROPERTY_VALUE_MAX];
|
||||||
|
|
||||||
|
property_get(FP_SENSOR_PROP, fp_vendor, "fpc");
|
||||||
|
ALOGE("Fp vendor is %s",fp_vendor);
|
||||||
|
|
||||||
|
if (!strcmp(fp_vendor, "fpc")) {
|
||||||
|
err = hw_get_module_by_class(FINGERPRINT_HARDWARE_MODULE_ID, "fpc", &hw_module);
|
||||||
|
} else {
|
||||||
|
err = hw_get_module(FINGERPRINT_HARDWARE_MODULE_ID, &hw_module);
|
||||||
|
}
|
||||||
|
|
||||||
err = hw_get_module_by_class(FINGERPRINT_HARDWARE_MODULE_ID, class_name, &hw_module);
|
|
||||||
if (err) {
|
if (err) {
|
||||||
ALOGE("Failed to get fingerprint module: class %s, error %d", class_name, err);
|
ALOGE("Failed to get fingerprint module: class %s, error %d", class_name, err);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
@ -266,13 +277,6 @@ fingerprint_device_t* getFingerprintDevice()
|
||||||
return fp_device;
|
return fp_device;
|
||||||
}
|
}
|
||||||
|
|
||||||
fp_device = getDeviceForVendor("goodix");
|
|
||||||
if (fp_device == nullptr) {
|
|
||||||
ALOGE("Failed to load goodix fingerprint module");
|
|
||||||
} else {
|
|
||||||
return fp_device;
|
|
||||||
}
|
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define LOG_TAG "android.hardware.biometrics.fingerprint@2.1-service.xiaomi_msm8998"
|
#define LOG_TAG "android.hardware.biometrics.fingerprint@2.1-service.xiaomi_sdm660"
|
||||||
|
|
||||||
#include <android/log.h>
|
#include <android/log.h>
|
||||||
#include <hidl/HidlTransportSupport.h>
|
#include <hidl/HidlTransportSupport.h>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue