a71-common: Replace prebuilt libsensorndkbridge with a shim
Change-Id: Id94ed43336e84934f42f56c58e506b50af3c59fd
This commit is contained in:
committed by
Haky86
parent
0927f4effb
commit
523d2d59c4
@@ -383,6 +383,8 @@ PRODUCT_COPY_FILES += \
|
|||||||
# Sensors
|
# Sensors
|
||||||
PRODUCT_PACKAGES += \
|
PRODUCT_PACKAGES += \
|
||||||
android.hardware.sensors-service.samsung-multihal \
|
android.hardware.sensors-service.samsung-multihal \
|
||||||
|
libsensorndkbridge \
|
||||||
|
libshim_sensorndkbridge \
|
||||||
sensors.samsung \
|
sensors.samsung \
|
||||||
|
|
||||||
PRODUCT_COPY_FILES += \
|
PRODUCT_COPY_FILES += \
|
||||||
|
|||||||
@@ -34,6 +34,10 @@ function blob_fixup() {
|
|||||||
xxd -p -c0 "${2}" | sed "s/600e40f9820c805224008052e10315aa080040f9e30314aa/600e40f9820c805224008052e10315aa080040f9030080d2/g" | xxd -r -p > "${2}".patched
|
xxd -p -c0 "${2}" | sed "s/600e40f9820c805224008052e10315aa080040f9e30314aa/600e40f9820c805224008052e10315aa080040f9030080d2/g" | xxd -r -p > "${2}".patched
|
||||||
mv "${2}".patched "${2}"
|
mv "${2}".patched "${2}"
|
||||||
;;
|
;;
|
||||||
|
vendor/lib*/libsensorlistener.so)
|
||||||
|
[ "$2" = "" ] && return 0
|
||||||
|
"${PATCHELF}" --add-needed "libshim_sensorndkbridge.so" "${2}"
|
||||||
|
;;
|
||||||
vendor/lib64/hw/gatekeeper.mdfpp.so|vendor/lib64/libkeymaster_helper.so|vendor/lib64/libskeymaster4device.so)
|
vendor/lib64/hw/gatekeeper.mdfpp.so|vendor/lib64/libkeymaster_helper.so|vendor/lib64/libskeymaster4device.so)
|
||||||
"${PATCHELF}" --replace-needed "libcrypto.so" "libcrypto-v33.so" "${2}"
|
"${PATCHELF}" --replace-needed "libcrypto.so" "libcrypto-v33.so" "${2}"
|
||||||
;;
|
;;
|
||||||
|
|||||||
@@ -633,7 +633,6 @@ vendor/lib64/libsecnativefeature.so
|
|||||||
|
|
||||||
# Sensors
|
# Sensors
|
||||||
vendor/lib/libsensorlistener.so
|
vendor/lib/libsensorlistener.so
|
||||||
vendor/lib/libsensorndkbridge.so
|
|
||||||
vendor/lib/libsensorslog.so
|
vendor/lib/libsensorslog.so
|
||||||
vendor/lib/libsns_device_mode_stub.so
|
vendor/lib/libsns_device_mode_stub.so
|
||||||
vendor/lib/libsns_fastRPC_util.so
|
vendor/lib/libsns_fastRPC_util.so
|
||||||
@@ -646,7 +645,6 @@ vendor/lib/libssc_default_listener.so
|
|||||||
vendor/lib/sensors.ssc.so
|
vendor/lib/sensors.ssc.so
|
||||||
vendor/lib64/libnanopb.so
|
vendor/lib64/libnanopb.so
|
||||||
vendor/lib64/libsensorlistener.so
|
vendor/lib64/libsensorlistener.so
|
||||||
vendor/lib64/libsensorndkbridge.so
|
|
||||||
vendor/lib64/libsensorslog.so
|
vendor/lib64/libsensorslog.so
|
||||||
vendor/lib64/libsns_device_mode_stub.so
|
vendor/lib64/libsns_device_mode_stub.so
|
||||||
vendor/lib64/libsns_fastRPC_util.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