summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinay Verma <vvinay@codeaurora.org>2018-09-14 11:25:46 +0530
committerMichael Bestas <mkbestas@lineageos.org>2019-10-23 01:12:56 +0300
commit9a3da74f9ce4b124a2bc8c9ddb001afbbb3d662d (patch)
treefab740f7ba9ddb854698996603c5f11a35e7c4a6
parentc0c5b02c1fb92a59f3a285ad6183e28e4bad107a (diff)
downloadvendor_qcom_opensource_power-9a3da74f9ce4b124a2bc8c9ddb001afbbb3d662d.tar.gz
vendor_qcom_opensource_power-9a3da74f9ce4b124a2bc8c9ddb001afbbb3d662d.tar.bz2
vendor_qcom_opensource_power-9a3da74f9ce4b124a2bc8c9ddb001afbbb3d662d.zip
Reduce hwbinder buffer size for power HAL
Set hwbinder buffer size to 16KB for 32 bit architecture. Change-Id: I4272a12853269dd6363f58a5bb81caa09cc47e9a CRs-Fixed: 2315283
-rw-r--r--Android.mk5
-rw-r--r--service.cpp7
2 files changed, 12 insertions, 0 deletions
diff --git a/Android.mk b/Android.mk
index 7f3cdb8..645c0a2 100644
--- a/Android.mk
+++ b/Android.mk
@@ -13,6 +13,7 @@ LOCAL_SHARED_LIBRARIES := \
libbase \
libhidlbase \
libhidltransport \
+ libhwbinder \
libutils \
android.hardware.power@1.2
@@ -126,6 +127,10 @@ ifeq ($(TARGET_USES_INTERACTION_BOOST),true)
LOCAL_CFLAGS += -DINTERACTION_BOOST
endif
+ifeq ($(TARGET_ARCH),arm)
+ LOCAL_CFLAGS += -DARCH_ARM_32
+endif
+
LOCAL_MODULE := android.hardware.power@1.2-service-qti
LOCAL_INIT_RC := android.hardware.power@1.2-service-qti.rc
LOCAL_MODULE_TAGS := optional
diff --git a/service.cpp b/service.cpp
index c8100b9..85f84d1 100644
--- a/service.cpp
+++ b/service.cpp
@@ -31,6 +31,9 @@
#include <hardware/power.h>
#include <hidl/HidlTransportSupport.h>
+#ifdef ARCH_ARM_32
+#include <hwbinder/ProcessState.h>
+#endif
#include <log/log.h>
#include "Power.h"
@@ -47,6 +50,10 @@ using android::hardware::power::V1_2::IPower;
using android::hardware::power::V1_2::implementation::Power;
int main() {
+#ifdef ARCH_ARM_32
+ android::hardware::ProcessState::initWithMmapSize((size_t)16384);
+#endif
+
status_t status;
android::sp<IPower> service = nullptr;