diff options
author | Steve Kondik <steve@cyngn.com> | 2015-10-19 14:43:39 -0700 |
---|---|---|
committer | Michael Bestas <mkbestas@lineageos.org> | 2019-10-23 01:12:56 +0300 |
commit | e0a09037f41da6fa2da8dbbbf03117765b4ae714 (patch) | |
tree | 06f24e161f17810fc1da52a2c13683e4f2cc3794 | |
parent | d1cd53fa2c28f13d929979b2930dedf69b6a9aff (diff) | |
download | vendor_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.mk | 4 | ||||
-rw-r--r-- | Power.cpp | 10 |
2 files changed, 14 insertions, 0 deletions
@@ -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 @@ -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(); } |