summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Kondik <steve@cyngn.com>2015-10-19 14:43:39 -0700
committerMichael Bestas <mkbestas@lineageos.org>2019-10-23 01:12:56 +0300
commite0a09037f41da6fa2da8dbbbf03117765b4ae714 (patch)
tree06f24e161f17810fc1da52a2c13683e4f2cc3794
parentd1cd53fa2c28f13d929979b2930dedf69b6a9aff (diff)
downloadvendor_qcom_opensource_power-e0a09037f41da6fa2da8dbbbf03117765b4ae714.tar.gz
vendor_qcom_opensource_power-e0a09037f41da6fa2da8dbbbf03117765b4ae714.tar.bz2
vendor_qcom_opensource_power-e0a09037f41da6fa2da8dbbbf03117765b4ae714.zip
power: Add support for tap-to-wake feature control
Change-Id: I545902b29f4828c127bc32def6e30b67ce4a3aa7
-rw-r--r--Android.mk4
-rw-r--r--Power.cpp10
2 files changed, 14 insertions, 0 deletions
diff --git a/Android.mk b/Android.mk
index 8086fab..a633927 100644
--- a/Android.mk
+++ b/Android.mk
@@ -72,6 +72,10 @@ ifeq ($(call is-board-platform-in-list,msmnile), true)
LOCAL_SRC_FILES += power-msmnile.c
endif
+ifneq ($(TARGET_TAP_TO_WAKE_NODE),)
+ LOCAL_CFLAGS += -DTAP_TO_WAKE_NODE=\"$(TARGET_TAP_TO_WAKE_NODE)\"
+endif
+
ifeq ($(TARGET_USES_INTERACTION_BOOST),true)
LOCAL_CFLAGS += -DINTERACTION_BOOST
endif
diff --git a/Power.cpp b/Power.cpp
index 11e0c21..ebdc60a 100644
--- a/Power.cpp
+++ b/Power.cpp
@@ -29,6 +29,7 @@
#define LOG_TAG "QTI PowerHAL"
+#include <android-base/file.h>
#include <log/log.h>
#include "Power.h"
#include "power-common.h"
@@ -64,6 +65,15 @@ Return<void> Power::powerHint(PowerHint_1_0 hint, int32_t data) {
}
Return<void> Power::setFeature(Feature feature, bool activate) {
+ switch (feature) {
+#ifdef TAP_TO_WAKE_NODE
+ case Feature::POWER_FEATURE_DOUBLE_TAP_TO_WAKE:
+ ::android::base::WriteStringToFile(activate ? "1" : "0", TAP_TO_WAKE_NODE);
+ break;
+#endif
+ default:
+ break;
+ }
return Void();
}