mirror of
https://github.com/S3NEO/android_device_samsung_msm8226-common.git
synced 2024-11-06 21:55:45 +00:00
msm8226-common: update sensor multihal
This commit is contained in:
parent
dc94678fd9
commit
5c6b188b5d
5 changed files with 14 additions and 106 deletions
3
Android.bp
Normal file
3
Android.bp
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
subdirs = [
|
||||||
|
"sensors",
|
||||||
|
]
|
|
@ -1,3 +0,0 @@
|
||||||
# Binder API version
|
|
||||||
# This does not work
|
|
||||||
#TARGET_USES_64_BIT_BINDER := true
|
|
|
@ -1,10 +1,9 @@
|
||||||
|
|
||||||
cc_library_static {
|
cc_library_static {
|
||||||
name: "multihal-samsung8226",
|
name: "multihal-samsung8226",
|
||||||
vendor: true,
|
vendor: true,
|
||||||
srcs: [
|
srcs: [
|
||||||
"multihal.cpp",
|
"multihal.cpp",
|
||||||
"SensorEventQueue.cpp",
|
"SensorEventQueue.cpp"
|
||||||
],
|
],
|
||||||
header_libs: [
|
header_libs: [
|
||||||
"libhardware_headers",
|
"libhardware_headers",
|
||||||
|
@ -13,102 +12,9 @@ cc_library_static {
|
||||||
"liblog",
|
"liblog",
|
||||||
"libcutils",
|
"libcutils",
|
||||||
"libutils",
|
"libutils",
|
||||||
"libdl",
|
"libdl"
|
||||||
],
|
],
|
||||||
export_include_dirs: ["."],
|
export_include_dirs: ["."],
|
||||||
cflags: [
|
|
||||||
"-Wall",
|
|
||||||
"-Werror",
|
|
||||||
],
|
|
||||||
}
|
|
||||||
|
|
||||||
cc_library_shared {
|
|
||||||
name: "android.hardware.sensors@1.0-impl.samsung8226",
|
|
||||||
defaults: ["hidl_defaults"],
|
|
||||||
proprietary: true,
|
|
||||||
relative_install_path: "hw",
|
|
||||||
srcs: ["Sensors.cpp"],
|
|
||||||
shared_libs: [
|
|
||||||
"liblog",
|
|
||||||
"libcutils",
|
|
||||||
"libhardware",
|
|
||||||
"libbase",
|
|
||||||
"libutils",
|
|
||||||
"libhidlbase",
|
|
||||||
"libhidltransport",
|
|
||||||
"android.hardware.sensors@1.0",
|
|
||||||
],
|
|
||||||
static_libs: [
|
|
||||||
"android.hardware.sensors@1.0-convert",
|
|
||||||
"multihal-samsung8226",
|
|
||||||
],
|
|
||||||
local_include_dirs: ["include/sensors"],
|
|
||||||
}
|
|
||||||
|
|
||||||
cc_binary {
|
|
||||||
name: "android.hardware.sensors@1.0-service.samsung8226",
|
|
||||||
defaults: ["hidl_defaults"],
|
|
||||||
relative_install_path: "hw",
|
|
||||||
vendor: true,
|
|
||||||
init_rc: ["android.hardware.sensors@1.0-service.samsung8226.rc"],
|
|
||||||
srcs: ["service.cpp"],
|
|
||||||
|
|
||||||
shared_libs: [
|
|
||||||
"liblog",
|
|
||||||
"libcutils",
|
|
||||||
"libdl",
|
|
||||||
"libbase",
|
|
||||||
"libutils",
|
|
||||||
"libhidlbase",
|
|
||||||
"libhidltransport",
|
|
||||||
"libhwbinder",
|
|
||||||
"android.hardware.sensors@1.0",
|
|
||||||
],
|
|
||||||
arch: {
|
|
||||||
cc_library_static {
|
|
||||||
name: "multihal-samsung8226",
|
|
||||||
vendor: true,
|
|
||||||
srcs: [
|
|
||||||
"multihal.cpp",
|
|
||||||
"SensorEventQueue.cpp",
|
|
||||||
],
|
|
||||||
header_libs: [
|
|
||||||
"libhardware_headers",
|
|
||||||
],
|
|
||||||
shared_libs: [
|
|
||||||
"liblog",
|
|
||||||
"libcutils",
|
|
||||||
"libutils",
|
|
||||||
"libdl",
|
|
||||||
],
|
|
||||||
export_include_dirs: ["."],
|
|
||||||
cflags: [
|
|
||||||
"-Wall",
|
|
||||||
"-Werror",
|
|
||||||
],
|
|
||||||
}
|
|
||||||
|
|
||||||
cc_library_shared {
|
|
||||||
name: "android.hardware.sensors@1.0-impl.samsung8226",
|
|
||||||
defaults: ["hidl_defaults"],
|
|
||||||
proprietary: true,
|
|
||||||
relative_install_path: "hw",
|
|
||||||
srcs: ["Sensors.cpp"],
|
|
||||||
shared_libs: [
|
|
||||||
"liblog",
|
|
||||||
"libcutils",
|
|
||||||
"libhardware",
|
|
||||||
"libbase",
|
|
||||||
"libutils",
|
|
||||||
"libhidlbase",
|
|
||||||
"libhidltransport",
|
|
||||||
"android.hardware.sensors@1.0",
|
|
||||||
],
|
|
||||||
static_libs: [
|
|
||||||
"android.hardware.sensors@1.0-convert",
|
|
||||||
"multihal-samsung8226",
|
|
||||||
],
|
|
||||||
local_include_dirs: ["include/sensors"],
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cc_binary {
|
cc_binary {
|
||||||
|
@ -135,9 +41,4 @@ cc_binary {
|
||||||
cflags: ["-DARCH_ARM_32"],
|
cflags: ["-DARCH_ARM_32"],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
|
||||||
arm: {
|
|
||||||
cflags: ["-DARCH_ARM_32"],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
service sensors-hal-1-0 /vendor/bin/hw/android.hardware.sensors@1.0-service.samsung8226
|
service sensors-hal-1-0 /vendor/bin/hw/android.hardware.sensors@1.0-service.samsung8226
|
||||||
class hal
|
class hal
|
||||||
user root
|
user system
|
||||||
group system input wakelock
|
group system input wakelock
|
||||||
capabilities BLOCK_SUSPEND SYS_NICE
|
capabilities BLOCK_SUSPEND
|
||||||
|
rlimit rtprio 10 10
|
||||||
|
|
|
@ -18,11 +18,17 @@
|
||||||
|
|
||||||
#include <android/hardware/sensors/1.0/ISensors.h>
|
#include <android/hardware/sensors/1.0/ISensors.h>
|
||||||
#include <hidl/LegacySupport.h>
|
#include <hidl/LegacySupport.h>
|
||||||
|
#ifdef ARCH_ARM_32
|
||||||
|
#include <hwbinder/ProcessState.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
using android::hardware::sensors::V1_0::ISensors;
|
using android::hardware::sensors::V1_0::ISensors;
|
||||||
using android::hardware::defaultPassthroughServiceImplementation;
|
using android::hardware::defaultPassthroughServiceImplementation;
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
#ifdef ARCH_ARM_32
|
||||||
|
android::hardware::ProcessState::initWithMmapSize((size_t)8192);
|
||||||
|
#endif
|
||||||
/* Sensors framework service needs at least two threads.
|
/* Sensors framework service needs at least two threads.
|
||||||
* One thread blocks on a "poll"
|
* One thread blocks on a "poll"
|
||||||
* The second thread is needed for all other HAL methods.
|
* The second thread is needed for all other HAL methods.
|
||||||
|
|
Loading…
Reference in a new issue