From eb5a728efa775c5a43ca60d0947b23b73060bc76 Mon Sep 17 00:00:00 2001 From: Shaikh Shadul Date: Tue, 14 Aug 2018 19:12:01 +0530 Subject: [PATCH] msm8974-common: sensors: Tune binder buffer for sensors HIDL Setting custom binder buffer size for sensors HIDL service. Change-Id: I83ebdc77ed7aec0e25a975097358440681ca5f11 --- sensors/Android.bp | 7 +++++++ sensors/service.cpp | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/sensors/Android.bp b/sensors/Android.bp index 839a9ad..323380f 100644 --- a/sensors/Android.bp +++ b/sensors/Android.bp @@ -46,6 +46,7 @@ cc_library_shared { cc_binary { name: "android.hardware.sensors@1.0-service.samsung8974", + defaults: ["hidl_defaults"], relative_install_path: "hw", vendor: true, init_rc: ["android.hardware.sensors@1.0-service.samsung8974.rc"], @@ -59,6 +60,12 @@ cc_binary { "libutils", "libhidlbase", "libhidltransport", + "libhwbinder", "android.hardware.sensors@1.0", ], + arch: { + arm: { + cflags: ["-DARCH_ARM_32"], + }, + }, } diff --git a/sensors/service.cpp b/sensors/service.cpp index 65f6d81..72f32fd 100644 --- a/sensors/service.cpp +++ b/sensors/service.cpp @@ -18,11 +18,17 @@ #include #include +#ifdef ARCH_ARM_32 +#include +#endif using android::hardware::sensors::V1_0::ISensors; using android::hardware::defaultPassthroughServiceImplementation; int main() { +#ifdef ARCH_ARM_32 + android::hardware::ProcessState::initWithMmapSize((size_t)8192); +#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.