gts4lv-common: Replace prebuilt libsensorndkbridge with a shim
Change-Id: Id94ed43336e84934f42f56c58e506b50af3c59fd
This commit is contained in:
committed by
Bruno Martins
parent
233ffb8ac2
commit
d2f0859d24
@@ -67,6 +67,10 @@ fi
|
||||
|
||||
function blob_fixup() {
|
||||
case "${1}" in
|
||||
vendor/lib/libsensorlistener.so)
|
||||
[ "$2" = "" ] && return 0
|
||||
"${PATCHELF}" --add-needed "libshim_sensorndkbridge.so" "${2}"
|
||||
;;
|
||||
vendor/lib64/hw/android.hardware.health@2.0-impl-2.1-samsung.so)
|
||||
[ "$2" = "" ] && return 0
|
||||
"${PATCHELF}" --replace-needed "libutils.so" "libutils-v30.so" "${2}"
|
||||
|
||||
@@ -315,7 +315,9 @@ PRODUCT_COPY_FILES += \
|
||||
# Sensors
|
||||
PRODUCT_PACKAGES += \
|
||||
android.frameworks.sensorservice@1.0.vendor \
|
||||
android.hardware.sensors-service.samsung-multihal
|
||||
android.hardware.sensors-service.samsung-multihal \
|
||||
libsensorndkbridge \
|
||||
libshim_sensorndkbridge
|
||||
|
||||
# Soong namespaces
|
||||
PRODUCT_SOONG_NAMESPACES += \
|
||||
|
||||
@@ -612,7 +612,6 @@ vendor/etc/sensors/config/veml3328_0.json
|
||||
vendor/etc/sensors/hals.conf
|
||||
vendor/etc/sensors/sns_reg_config
|
||||
vendor/lib/libsensorlistener.so
|
||||
vendor/lib/libsensorndkbridge.so
|
||||
vendor/lib/libsensorslog.so
|
||||
vendor/lib/libsns_device_mode_stub.so
|
||||
vendor/lib/libsns_fastRPC_util.so
|
||||
@@ -624,7 +623,6 @@ vendor/lib/libssc_default_listener.so
|
||||
vendor/lib/sensors.grip.so
|
||||
vendor/lib/sensors.ssc.so
|
||||
vendor/lib64/libnanopb.so
|
||||
vendor/lib64/libsensorndkbridge.so
|
||||
vendor/lib64/libsensorslog.so
|
||||
vendor/lib64/libsns_device_mode_stub.so
|
||||
vendor/lib64/libsns_fastRPC_util.so
|
||||
|
||||
36
shims/libsensorndkbridge/ASensorManager.cpp
Normal file
36
shims/libsensorndkbridge/ASensorManager.cpp
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2024 The LineageOS Project
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <ALooper.h>
|
||||
|
||||
#define LOG_TAG "libshim_sensorndkbridge"
|
||||
#include <android-base/logging.h>
|
||||
|
||||
using android::Mutex;
|
||||
|
||||
static Mutex gLock;
|
||||
|
||||
extern "C" ALooper* ALooper_forCamera() {
|
||||
Mutex::Autolock autoLock(gLock);
|
||||
LOG(VERBOSE) << "ALooper_forCamera";
|
||||
return new ALooper;
|
||||
}
|
||||
|
||||
extern "C" int ALooper_release_forCamera(ALooper* sLooper) {
|
||||
if (sLooper != nullptr) {
|
||||
Mutex::Autolock autoLock(gLock);
|
||||
delete sLooper;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern "C" int ALooper_pollOnce_camera(ALooper* sLooper, int timeoutMillis, int* outFd,
|
||||
int* outEvents, void** outData) {
|
||||
int res = sLooper->pollOnce(timeoutMillis, outFd, outEvents, outData);
|
||||
LOG(VERBOSE) << "ALooper_pollOnce_camera => " << res;
|
||||
return res;
|
||||
}
|
||||
18
shims/libsensorndkbridge/Android.bp
Normal file
18
shims/libsensorndkbridge/Android.bp
Normal file
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// Copyright (C) 2020-2024 The LineageOS Project
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
cc_library_shared {
|
||||
name: "libshim_sensorndkbridge",
|
||||
srcs: ["ASensorManager.cpp"],
|
||||
shared_libs: [
|
||||
"libbase",
|
||||
"libsensorndkbridge",
|
||||
"libutils",
|
||||
],
|
||||
include_dirs: [
|
||||
"frameworks/hardware/interfaces/sensorservice/libsensorndkbridge",
|
||||
],
|
||||
vendor: true,
|
||||
}
|
||||
Reference in New Issue
Block a user