diff options
Diffstat (limited to 'sensors')
-rw-r--r-- | sensors/1.0/default/Android.bp | 7 | ||||
-rw-r--r-- | sensors/1.0/default/android.hardware.sensors@1.0-service.rc | 2 | ||||
-rw-r--r-- | sensors/1.0/default/service.cpp | 20 |
3 files changed, 28 insertions, 1 deletions
diff --git a/sensors/1.0/default/Android.bp b/sensors/1.0/default/Android.bp index 2e4e1b015c..b2d3c49cf2 100644 --- a/sensors/1.0/default/Android.bp +++ b/sensors/1.0/default/Android.bp @@ -55,6 +55,7 @@ cc_binary { relative_install_path: "hw", vendor: true, init_rc: ["android.hardware.sensors@1.0-service.rc"], + defaults: ["hidl_defaults"], srcs: ["service.cpp"], shared_libs: [ @@ -65,5 +66,11 @@ cc_binary { "libutils", "libhidlbase", "android.hardware.sensors@1.0", + "libhwbinder", ], + arch: { + arm: { + cflags: ["-DARCH_ARM_32"], + }, + }, } diff --git a/sensors/1.0/default/android.hardware.sensors@1.0-service.rc b/sensors/1.0/default/android.hardware.sensors@1.0-service.rc index 1af6d0b08c..e029bb8f72 100644 --- a/sensors/1.0/default/android.hardware.sensors@1.0-service.rc +++ b/sensors/1.0/default/android.hardware.sensors@1.0-service.rc @@ -2,6 +2,6 @@ service vendor.sensors-hal-1-0 /vendor/bin/hw/android.hardware.sensors@1.0-servi interface android.hardware.sensors@1.0::ISensors default class hal user system - group system wakelock uhid context_hub + group system wakelock uhid input context_hub capabilities BLOCK_SUSPEND rlimit rtprio 10 10 diff --git a/sensors/1.0/default/service.cpp b/sensors/1.0/default/service.cpp index 65f6d816a1..c413d1a0e0 100644 --- a/sensors/1.0/default/service.cpp +++ b/sensors/1.0/default/service.cpp @@ -19,10 +19,30 @@ #include <android/hardware/sensors/1.0/ISensors.h> #include <hidl/LegacySupport.h> +#ifdef ARCH_ARM_32 +#include <hwbinder/ProcessState.h> +#include <cutils/properties.h> +#endif + using android::hardware::sensors::V1_0::ISensors; using android::hardware::defaultPassthroughServiceImplementation; +#ifdef ARCH_ARM_32 +//default h/w binder memsize for sensors is 8 KB +#define DEFAULT_SENSORS_HW_BINDER_MEM_SIZE_KB 8 +size_t getHWBinderMmapSize() { + int32_t value = DEFAULT_SENSORS_HW_BINDER_MEM_SIZE_KB; + + value = property_get_int32("persist.vendor.sensor.hw.binder.size", value); + ALOGD("Init hw binder with mem size = %d", value); + return 1024 * value; +} +#endif + int main() { +#ifdef ARCH_ARM_32 + android::hardware::ProcessState::initWithMmapSize((size_t)getHWBinderMmapSize()); +#endif /* Sensors framework service needs at least two threads. * One thread blocks on a "poll" * The second thread is needed for all other HAL methods. |