power: Add support for tap-to-wake feature control
Change-Id: I545902b29f4828c127bc32def6e30b67ce4a3aa7
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::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();
}