rhodep: Drop OSS fingerprint HAL & interfaces

Change-Id: Ia2675fe3ecf23e28e5abb41b4f13afab1d993340
This commit is contained in:
Anand S 2025-05-13 23:00:36 +05:30
parent 4e7af09709
commit fe4a066897
12 changed files with 0 additions and 392 deletions

View file

@ -38,10 +38,6 @@ PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/audio/default_volume_tables.xml:$(TARGET_COPY_OUT_VENDOR)/etc/default_volume_tables.xml \ $(LOCAL_PATH)/audio/default_volume_tables.xml:$(TARGET_COPY_OUT_VENDOR)/etc/default_volume_tables.xml \
$(LOCAL_PATH)/audio/mixer_paths.xml:$(TARGET_COPY_OUT_VENDOR)/etc/mixer_paths.xml $(LOCAL_PATH)/audio/mixer_paths.xml:$(TARGET_COPY_OUT_VENDOR)/etc/mixer_paths.xml
# Fingerprint
PRODUCT_PACKAGES += \
android.hardware.biometrics.fingerprint@2.3-service.bangkk
# FM # FM
TARGET_HAS_FM := true TARGET_HAS_FM := true

View file

@ -1 +0,0 @@
../../../../build/soong/scripts/system-clang-format

View file

@ -1,23 +0,0 @@
cc_binary {
name: "android.hardware.biometrics.fingerprint@2.3-service.bangkk",
defaults: ["hidl_defaults"],
init_rc: ["android.hardware.biometrics.fingerprint@2.3-service.bangkk.rc"],
vintf_fragments: ["android.hardware.biometrics.fingerprint@2.3-service.bangkk.xml"],
relative_install_path: "hw",
srcs: [
"service.cpp",
"BiometricsFingerprint.cpp",
],
vendor: true,
shared_libs: [
"libbase",
"libhidlbase",
"liblog",
"libutils",
"android.hardware.biometrics.fingerprint@2.1",
"android.hardware.biometrics.fingerprint@2.2",
"android.hardware.biometrics.fingerprint@2.3",
"vendor.egistec.hardware.fingerprint@4.0",
],
header_libs: ["generated_kernel_headers"]
}

View file

@ -1,159 +0,0 @@
/*
* Copyright (C) 2017 The Android Open Source 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_TAG "android.hardware.biometrics.fingerprint@2.3-service.bangkk"
#include "BiometricsFingerprint.h"
#include <android-base/file.h>
#include <android-base/logging.h>
#include <fcntl.h>
#include <poll.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <chrono>
#include <cmath>
#include <fstream>
#include <thread>
#include <display/drm/sde_drm.h>
enum HBM_STATE { OFF = 0, ON = 2 };
void setHbmState(int state) {
struct panel_param_info param_info;
int32_t node = open("/dev/dri/card0", O_RDWR);
int32_t ret = 0;
if (node < 0) {
LOG(ERROR) << "Failed to get card0!";
return;
}
param_info.param_idx = PARAM_HBM;
param_info.value = state;
ret = ioctl(node, DRM_IOCTL_SET_PANEL_FEATURE, &param_info);
if (ret < 0) {
LOG(ERROR) << "IOCTL call failed with ret = " << ret;
} else {
LOG(INFO) << "HBM state set successfully. New state: " << state;
}
close(node);
}
namespace android {
namespace hardware {
namespace biometrics {
namespace fingerprint {
namespace V2_3 {
namespace implementation {
BiometricsFingerprint::BiometricsFingerprint() {
biometrics_2_1_service = IBiometricsFingerprint_2_1::getService();
rbs_4_0_service = IBiometricsFingerprintRbs::getService();
}
Return<uint64_t> BiometricsFingerprint::setNotify(
const sp<IBiometricsFingerprintClientCallback>& clientCallback) {
return biometrics_2_1_service->setNotify(clientCallback);
}
Return<uint64_t> BiometricsFingerprint::preEnroll() {
return biometrics_2_1_service->preEnroll();
}
Return<RequestStatus> BiometricsFingerprint::enroll(const hidl_array<uint8_t, 69>& hat,
uint32_t gid, uint32_t timeoutSec) {
return biometrics_2_1_service->enroll(hat, gid, timeoutSec);
}
Return<RequestStatus> BiometricsFingerprint::postEnroll() {
return biometrics_2_1_service->postEnroll();
}
Return<uint64_t> BiometricsFingerprint::getAuthenticatorId() {
return biometrics_2_1_service->getAuthenticatorId();
}
Return<RequestStatus> BiometricsFingerprint::cancel() {
setHbmState(OFF);
return biometrics_2_1_service->cancel();
}
Return<RequestStatus> BiometricsFingerprint::enumerate() {
return biometrics_2_1_service->enumerate();
}
Return<RequestStatus> BiometricsFingerprint::remove(uint32_t gid, uint32_t fid) {
return biometrics_2_1_service->remove(gid, fid);
}
Return<RequestStatus> BiometricsFingerprint::setActiveGroup(uint32_t gid,
const hidl_string& storePath) {
return biometrics_2_1_service->setActiveGroup(gid, storePath);
}
Return<RequestStatus> BiometricsFingerprint::authenticate(uint64_t operationId, uint32_t gid) {
setHbmState(OFF);
return biometrics_2_1_service->authenticate(operationId, gid);
}
Return<bool> BiometricsFingerprint::isUdfps(uint32_t) {
return true;
}
Return<void> BiometricsFingerprint::onFingerDown(uint32_t, uint32_t, float, float) {
setHbmState(ON);
extraApiWrapper(101);
std::thread([this]() {
std::this_thread::sleep_for(std::chrono::milliseconds(200));
BiometricsFingerprint::onFingerUp();
}).detach();
return Void();
}
Return<void> BiometricsFingerprint::onFingerUp() {
setHbmState(OFF);
extraApiWrapper(102);
return Void();
}
Return<void> BiometricsFingerprint::extraApiWrapper(int cidValue) {
int cid[1] = {cidValue};
// Create a std::vector<uint8_t> to store the data from 'cid'
std::vector<uint8_t> cid_data(reinterpret_cast<uint8_t*>(cid),
reinterpret_cast<uint8_t*>(cid) + sizeof(cid));
// Create the hidl_vec<uint8_t> from the std::vector<uint8_t>
::android::hardware::hidl_vec<uint8_t> hidl_cid = cid_data;
// Call extra_api with the correct input buffer and an empty lambda callback
rbs_4_0_service->extra_api(7, hidl_cid, [](const ::android::hardware::hidl_vec<uint8_t>&) {});
return Void();
}
} // namespace implementation
} // namespace V2_3
} // namespace fingerprint
} // namespace biometrics
} // namespace hardware
} // namespace android

View file

@ -1,79 +0,0 @@
/*
* Copyright (C) 2017 The Android Open Source 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.
*/
#ifndef ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_3_BIOMETRICSFINGERPRINT_H
#define ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_3_BIOMETRICSFINGERPRINT_H
#include <android/hardware/biometrics/fingerprint/2.3/IBiometricsFingerprint.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
#include <vendor/egistec/hardware/fingerprint/4.0/IBiometricsFingerprintRbs.h>
namespace android {
namespace hardware {
namespace biometrics {
namespace fingerprint {
namespace V2_3 {
namespace implementation {
using IBiometricsFingerprint_2_1 =
::android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint;
using ::android::sp;
using ::android::hardware::hidl_array;
using ::android::hardware::hidl_memory;
using ::android::hardware::hidl_string;
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprintClientCallback;
using ::android::hardware::biometrics::fingerprint::V2_1::RequestStatus;
using ::vendor::egistec::hardware::fingerprint::V4_0::IBiometricsFingerprintRbs;
struct BiometricsFingerprint : public IBiometricsFingerprint {
BiometricsFingerprint();
// Methods from ::V2_1::IBiometricsFingerprint follow.
Return<uint64_t> setNotify(
const sp<IBiometricsFingerprintClientCallback>& clientCallback) override;
Return<uint64_t> preEnroll() override;
Return<RequestStatus> enroll(const hidl_array<uint8_t, 69>& hat, uint32_t gid,
uint32_t timeoutSec) override;
Return<RequestStatus> postEnroll() override;
Return<uint64_t> getAuthenticatorId() override;
Return<RequestStatus> cancel() override;
Return<RequestStatus> enumerate() override;
Return<RequestStatus> remove(uint32_t gid, uint32_t fid) override;
Return<RequestStatus> setActiveGroup(uint32_t gid, const hidl_string& storePath) override;
Return<RequestStatus> authenticate(uint64_t operationId, uint32_t gid) override;
// ::V2_3::IBiometricsFingerprint follow.
Return<bool> isUdfps(uint32_t sensorId) override;
Return<void> onFingerDown(uint32_t x, uint32_t y, float minor, float major) override;
Return<void> onFingerUp() override;
Return<void> extraApiWrapper(int cidValue);
private:
sp<IBiometricsFingerprint_2_1> biometrics_2_1_service;
sp<IBiometricsFingerprintRbs> rbs_4_0_service;
};
} // namespace implementation
} // namespace V2_3
} // namespace fingerprint
} // namespace biometrics
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_3_BIOMETRICSFINGERPRINT_H

View file

@ -1,7 +0,0 @@
service vendor.fps_hal.bangkk /vendor/bin/hw/android.hardware.biometrics.fingerprint@2.3-service.bangkk
# "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 uhid

View file

@ -1,23 +0,0 @@
<manifest version="1.0" type="device">
<hal format="hidl">
<name>android.hardware.biometrics.fingerprint</name>
<transport>hwbinder</transport>
<version>2.1</version>
<version>2.3</version>
<interface>
<name>IBiometricsFingerprint</name>
<instance>default</instance>
</interface>
<fqname>@2.1::IBiometricsFingerprint/default</fqname>
<fqname>@2.3::IBiometricsFingerprint/default</fqname>
</hal>
<hal format="hidl">
<name>vendor.egistec.hardware.fingerprint</name>
<transport>hwbinder</transport>
<version>4.0</version>
<interface>
<name>IBiometricsFingerprintRbs</name>
<instance>default</instance>
</interface>
</hal>
</manifest>

View file

@ -1,15 +0,0 @@
// This file is autogenerated by hidl-gen -Landroidbp.
hidl_interface {
name: "vendor.egistec.hardware.fingerprint@4.0",
root: "vendor.egistec.hardware.fingerprint",
system_ext_specific: true,
srcs: [
"IBiometricsFingerprintRbs.hal",
"IBiometricsFingerprintRbsCallback.hal",
],
interfaces: [
"android.hidl.base@1.0",
],
gen_java: true,
}

View file

@ -1,14 +0,0 @@
/*
* SPDX-FileCopyrightText: The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
package vendor.egistec.hardware.fingerprint@4.0;
import vendor.egistec.hardware.fingerprint@4.0::IBiometricsFingerprintRbsCallback;
interface IBiometricsFingerprintRbs {
extra_api(int32_t pid, vec<uint8_t> in_buffer) generates (vec<uint8_t> out_buffer);
set_on_callback_proc(IBiometricsFingerprintRbsCallback clientCallback) generates (int32_t ret);
cancel() generates (int32_t ret);
};

View file

@ -1,10 +0,0 @@
/*
* SPDX-FileCopyrightText: The LineageOS Project
* SPDX-License-Identifier: Apache-2.0
*/
package vendor.egistec.hardware.fingerprint@4.0;
interface IBiometricsFingerprintRbsCallback {
oneway ipc_callback(int32_t event_id, int32_t value1, int32_t value2, vec<uint8_t> buffer, int32_t buffer_size);
};

View file

@ -1,9 +0,0 @@
//
// SPDX-FileCopyrightText: The LineageOS Project
// SPDX-License-Identifier: Apache-2.0
//
hidl_package_root {
name: "vendor.egistec.hardware.fingerprint",
path: "device/motorola/bangkk/fingerprint/interfaces",
}

View file

@ -1,48 +0,0 @@
/*
* Copyright (C) 2017 The Android Open Source 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_TAG "android.hardware.biometrics.fingerprint@2.3-service.bangkk"
#include <android-base/logging.h>
#include <hidl/HidlTransportSupport.h>
#include "BiometricsFingerprint.h"
using android::hardware::configureRpcThreadpool;
using android::hardware::joinRpcThreadpool;
using android::hardware::biometrics::fingerprint::V2_3::IBiometricsFingerprint;
using android::hardware::biometrics::fingerprint::V2_3::implementation::BiometricsFingerprint;
using android::OK;
using android::status_t;
int main() {
android::sp<IBiometricsFingerprint> service = new BiometricsFingerprint();
configureRpcThreadpool(1, true);
status_t status = service->registerAsService();
if (status != OK) {
LOG(ERROR) << "Cannot register Biometrics 2.3 HAL service.";
return 1;
}
LOG(INFO) << "Biometrics 2.3 HAL service ready.";
joinRpcThreadpool();
LOG(ERROR) << "Biometrics 2.3 HAL service failed to join thread pool.";
return 1;
}