sanders: update fingerprint configs to match vendor changes
* Remove custom fp hal/service * Build android.hardware.biometrics.fingerprint@2.1 * Update init related configs and props
This commit is contained in:
@@ -191,8 +191,7 @@ PRODUCT_PACKAGES += \
|
|||||||
|
|
||||||
# Fingerprint
|
# Fingerprint
|
||||||
PRODUCT_PACKAGES += \
|
PRODUCT_PACKAGES += \
|
||||||
android.hardware.biometrics.fingerprint@2.1-service_32 \
|
android.hardware.biometrics.fingerprint@2.1
|
||||||
fingerprint.msm8953
|
|
||||||
|
|
||||||
# FM
|
# FM
|
||||||
PRODUCT_PACKAGES += \
|
PRODUCT_PACKAGES += \
|
||||||
|
|||||||
@@ -1,36 +0,0 @@
|
|||||||
#
|
|
||||||
# Copyright (C) 2017 The LineageOS Project
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
#
|
|
||||||
|
|
||||||
LOCAL_PATH := $(call my-dir)
|
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
|
||||||
|
|
||||||
LOCAL_SRC_FILES := \
|
|
||||||
FingerprintWrapper.cpp
|
|
||||||
|
|
||||||
LOCAL_SHARED_LIBRARIES := \
|
|
||||||
libhardware liblog
|
|
||||||
|
|
||||||
LOCAL_MODULE_RELATIVE_PATH := hw
|
|
||||||
LOCAL_MODULE := fingerprint.msm8953
|
|
||||||
LOCAL_MODULE_TAGS := optional
|
|
||||||
LOCAL_32_BIT_ONLY := true
|
|
||||||
LOCAL_VENDOR_MODULE := true
|
|
||||||
|
|
||||||
include $(BUILD_SHARED_LIBRARY)
|
|
||||||
|
|
||||||
include $(call all-makefiles-under,$(LOCAL_PATH))
|
|
||||||
|
|
||||||
@@ -1,196 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2017, The LineageOS Project
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
//#define LOG_NDEBUG 0
|
|
||||||
#define LOG_TAG "FingerprintWrapper"
|
|
||||||
|
|
||||||
#include <cutils/log.h>
|
|
||||||
|
|
||||||
#include <hardware/hardware.h>
|
|
||||||
#include <hardware/fingerprint.h>
|
|
||||||
#include <utils/threads.h>
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
fingerprint_device_t base;
|
|
||||||
union {
|
|
||||||
fingerprint_device_t *device;
|
|
||||||
hw_device_t *hw_device;
|
|
||||||
} vendor;
|
|
||||||
} device_t;
|
|
||||||
|
|
||||||
static android::Mutex vendor_mutex;
|
|
||||||
|
|
||||||
static union {
|
|
||||||
const fingerprint_module_t *module;
|
|
||||||
const hw_module_t *hw_module;
|
|
||||||
} vendor;
|
|
||||||
|
|
||||||
static bool ensure_vendor_module_is_loaded(void)
|
|
||||||
{
|
|
||||||
android::Mutex::Autolock lock(vendor_mutex);
|
|
||||||
|
|
||||||
if (!vendor.module) {
|
|
||||||
int rv = hw_get_module_by_class("fingerprint", "vendor", &vendor.hw_module);
|
|
||||||
if (rv) {
|
|
||||||
ALOGE("failed to open vendor module, error %d", rv);
|
|
||||||
vendor.module = NULL;
|
|
||||||
} else {
|
|
||||||
ALOGI("loaded vendor module: %s version %x", vendor.module->common.name,
|
|
||||||
vendor.module->common.module_api_version);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return vendor.module != NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int set_notify(struct fingerprint_device *dev, fingerprint_notify_t notify)
|
|
||||||
{
|
|
||||||
device_t *device = (device_t *) dev;
|
|
||||||
|
|
||||||
return device->vendor.device->set_notify(device->vendor.device, notify);
|
|
||||||
}
|
|
||||||
|
|
||||||
static uint64_t pre_enroll(struct fingerprint_device *dev)
|
|
||||||
{
|
|
||||||
device_t *device = (device_t *) dev;
|
|
||||||
|
|
||||||
return device->vendor.device->pre_enroll(device->vendor.device);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int enroll(struct fingerprint_device *dev, const hw_auth_token_t *hat, uint32_t gid,
|
|
||||||
uint32_t timeout_sec)
|
|
||||||
{
|
|
||||||
device_t *device = (device_t *) dev;
|
|
||||||
|
|
||||||
return device->vendor.device->enroll(device->vendor.device, hat, gid, timeout_sec);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int post_enroll(struct fingerprint_device *dev)
|
|
||||||
{
|
|
||||||
device_t *device = (device_t *) dev;
|
|
||||||
|
|
||||||
return device->vendor.device->post_enroll(device->vendor.device);
|
|
||||||
}
|
|
||||||
|
|
||||||
static uint64_t get_authenticator_id(struct fingerprint_device *dev)
|
|
||||||
{
|
|
||||||
device_t *device = (device_t *) dev;
|
|
||||||
|
|
||||||
return device->vendor.device->get_authenticator_id(device->vendor.device);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int cancel(struct fingerprint_device *dev)
|
|
||||||
{
|
|
||||||
device_t *device = (device_t *) dev;
|
|
||||||
|
|
||||||
return device->vendor.device->cancel(device->vendor.device);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int enumerate(struct fingerprint_device *dev)
|
|
||||||
{
|
|
||||||
device_t *device = (device_t *) dev;
|
|
||||||
|
|
||||||
return device->vendor.device->enumerate(device->vendor.device);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int remove(struct fingerprint_device *dev, uint32_t gid, uint32_t fid)
|
|
||||||
{
|
|
||||||
device_t *device = (device_t *) dev;
|
|
||||||
|
|
||||||
return device->vendor.device->remove(device->vendor.device, gid, fid);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int set_active_group(struct fingerprint_device *dev, uint32_t gid, const char *store_path)
|
|
||||||
{
|
|
||||||
device_t *device = (device_t *) dev;
|
|
||||||
|
|
||||||
return device->vendor.device->set_active_group(device->vendor.device, gid, store_path);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int authenticate(struct fingerprint_device *dev, uint64_t operation_id, uint32_t gid)
|
|
||||||
{
|
|
||||||
device_t *device = (device_t *) dev;
|
|
||||||
|
|
||||||
return device->vendor.device->authenticate(device->vendor.device, operation_id, gid);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int device_close(hw_device_t *hw_device)
|
|
||||||
{
|
|
||||||
device_t *device = (device_t *) hw_device;
|
|
||||||
int rv = device->base.common.close(device->vendor.hw_device);
|
|
||||||
free(device);
|
|
||||||
return rv;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int device_open(const hw_module_t *module, const char *name, hw_device_t **device_out)
|
|
||||||
{
|
|
||||||
int rv;
|
|
||||||
device_t *device;
|
|
||||||
|
|
||||||
if (!ensure_vendor_module_is_loaded()) {
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
device = (device_t *) calloc(sizeof(*device), 1);
|
|
||||||
if (!device) {
|
|
||||||
ALOGE("%s: Failed to allocate memory", __func__);
|
|
||||||
return -ENOMEM;
|
|
||||||
}
|
|
||||||
|
|
||||||
rv = vendor.module->common.methods->open(vendor.hw_module, name, &device->vendor.hw_device);
|
|
||||||
if (rv) {
|
|
||||||
ALOGE("%s: failed to open, error %d\n", __func__, rv);
|
|
||||||
free(device);
|
|
||||||
return rv;
|
|
||||||
}
|
|
||||||
|
|
||||||
device->base.common.tag = HARDWARE_DEVICE_TAG;
|
|
||||||
device->base.common.version = FINGERPRINT_MODULE_API_VERSION_2_1;
|
|
||||||
device->base.common.module = (hw_module_t *) module;
|
|
||||||
device->base.common.close = device_close;
|
|
||||||
|
|
||||||
device->base.set_notify = set_notify;
|
|
||||||
device->base.pre_enroll = pre_enroll;
|
|
||||||
device->base.enroll = enroll;
|
|
||||||
device->base.post_enroll = post_enroll;
|
|
||||||
device->base.get_authenticator_id = get_authenticator_id;
|
|
||||||
device->base.cancel = cancel;
|
|
||||||
device->base.enumerate = enumerate;
|
|
||||||
device->base.remove = remove;
|
|
||||||
device->base.set_active_group = set_active_group;
|
|
||||||
device->base.authenticate = authenticate;
|
|
||||||
|
|
||||||
*device_out = (hw_device_t *) device;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct hw_module_methods_t module_methods = {
|
|
||||||
.open = device_open
|
|
||||||
};
|
|
||||||
|
|
||||||
fingerprint_module_t HAL_MODULE_INFO_SYM = {
|
|
||||||
.common = {
|
|
||||||
.tag = HARDWARE_MODULE_TAG,
|
|
||||||
.module_api_version = FINGERPRINT_MODULE_API_VERSION_2_1,
|
|
||||||
.hal_api_version = HARDWARE_HAL_API_VERSION,
|
|
||||||
.id = FINGERPRINT_HARDWARE_MODULE_ID,
|
|
||||||
.name = "Lineage Fingerprint Wrapper",
|
|
||||||
.author = "The LineageOS Project",
|
|
||||||
.methods = &module_methods,
|
|
||||||
.dso = NULL, /* remove compilation warnings */
|
|
||||||
.reserved = {0}, /* remove compilation warnings */
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
LOCAL_PATH := $(call my-dir)
|
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
|
||||||
LOCAL_MODULE := android.hardware.biometrics.fingerprint@2.1-service_32
|
|
||||||
LOCAL_INIT_RC := android.hardware.biometrics.fingerprint@2.1-service_32.rc
|
|
||||||
LOCAL_PROPRIETARY_MODULE := true
|
|
||||||
LOCAL_32_BIT_ONLY := true
|
|
||||||
LOCAL_MODULE_RELATIVE_PATH := hw
|
|
||||||
LOCAL_VENDOR_MODULE := true
|
|
||||||
LOCAL_SRC_FILES := \
|
|
||||||
../../../../../hardware/interfaces/biometrics/fingerprint/2.1/default/BiometricsFingerprint.cpp \
|
|
||||||
../../../../../hardware/interfaces/biometrics/fingerprint/2.1/default/service.cpp
|
|
||||||
|
|
||||||
LOCAL_SHARED_LIBRARIES := \
|
|
||||||
libcutils \
|
|
||||||
liblog \
|
|
||||||
libhidlbase \
|
|
||||||
libhidltransport \
|
|
||||||
libhardware \
|
|
||||||
libutils \
|
|
||||||
android.hardware.biometrics.fingerprint@2.1
|
|
||||||
|
|
||||||
include $(BUILD_EXECUTABLE)
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
service fps_hal /vendor/bin/hw/android.hardware.biometrics.fingerprint@2.1-service_32
|
|
||||||
# "class hal" causes a race condition on some devices due to files created
|
|
||||||
# in /data. As a workaround, postpone startup until later in boot once
|
|
||||||
# /data is mounted.
|
|
||||||
class late_start
|
|
||||||
user system
|
|
||||||
group system input
|
|
||||||
@@ -135,7 +135,7 @@ on post-fs-data
|
|||||||
|
|
||||||
# Required by FingerPrint Cards (FPC) via init so we don't need to give qseecomd or fingerprintd permissions to create them
|
# Required by FingerPrint Cards (FPC) via init so we don't need to give qseecomd or fingerprintd permissions to create them
|
||||||
mkdir /data/fpc 0700 system system
|
mkdir /data/fpc 0700 system system
|
||||||
mkdir /data/.fps 0770 system input
|
mkdir /data/.fps 0770 system fingerp
|
||||||
|
|
||||||
#Folder for hardware properties
|
#Folder for hardware properties
|
||||||
mkdir /data/hardware_revisions 0755 system system
|
mkdir /data/hardware_revisions 0755 system system
|
||||||
|
|||||||
@@ -301,12 +301,6 @@ on post-fs-data
|
|||||||
mkdir /data/misc/dts 0770 media audio
|
mkdir /data/misc/dts 0770 media audio
|
||||||
mkdir /data/misc/hbtp 0750 system system
|
mkdir /data/misc/hbtp 0750 system system
|
||||||
|
|
||||||
#Create directories for Fingerprint
|
|
||||||
mkdir /data/misc/stargate 0770 system system
|
|
||||||
mkdir /data/misc/stargate/bg_estimation 0770 system system
|
|
||||||
mkdir /data/misc/stargate/calib_test 0770 system system
|
|
||||||
mkdir /data/misc/stargate/database 0770 system system
|
|
||||||
|
|
||||||
mkdir /data/vendor/misc 01771 system system
|
mkdir /data/vendor/misc 01771 system system
|
||||||
|
|
||||||
# Create directory used by display clients
|
# Create directory used by display clients
|
||||||
|
|||||||
@@ -85,6 +85,10 @@ PRODUCT_PROPERTY_OVERRIDES += \
|
|||||||
persist.dpm.feature=0 \
|
persist.dpm.feature=0 \
|
||||||
persist.sys.cnd.iwlan=1
|
persist.sys.cnd.iwlan=1
|
||||||
|
|
||||||
|
#property to enable fingerprint
|
||||||
|
PRODUCT_PROPERTY_OVERRIDES += \
|
||||||
|
persist.qfp=false
|
||||||
|
|
||||||
# core_ctrl
|
# core_ctrl
|
||||||
PRODUCT_PROPERTY_OVERRIDES += \
|
PRODUCT_PROPERTY_OVERRIDES += \
|
||||||
ro.vendor.qti.core_ctl_min_cpu=2 \
|
ro.vendor.qti.core_ctl_min_cpu=2 \
|
||||||
|
|||||||
Reference in New Issue
Block a user