sdm660-common: power-libperfmgr: Add support for tap-to-wake feature control

Signed-off-by: Subhajeet Muhuri <kenny3fcb@gmail.com>
Change-Id: Ideb02c659d64cdde4ee2f46c2631f7b42d003b05
This commit is contained in:
Steve Kondik 2015-10-19 14:43:39 -07:00 committed by OdSazib
parent b5e7add355
commit 1bb29d8296
No known key found for this signature in database
GPG key ID: 0954440B60470871

View file

@ -29,6 +29,10 @@
#include <utils/Log.h>
#include <utils/Trace.h>
#ifndef TAP_TO_WAKE_NODE
#define TAP_TO_WAKE_NODE "/sys/touchpanel/double_tap"
#endif
namespace android {
namespace hardware {
namespace power {
@ -136,8 +140,16 @@ Return<void> Power::powerHint(PowerHint_1_0 hint, int32_t data) {
return Void();
}
Return<void> Power::setFeature(Feature /*feature*/, bool /*activate*/) {
// Nothing to do
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();
}