diff options
-rw-r--r-- | Android.mk | 4 | ||||
-rw-r--r-- | Power.cpp | 2 | ||||
-rw-r--r-- | power-common.c | 5 | ||||
-rw-r--r-- | power-feature.h | 33 |
4 files changed, 44 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_POWER_SET_FEATURE_LIB),) + LOCAL_STATIC_LIBRARIES += $(TARGET_POWER_SET_FEATURE_LIB) +endif + ifneq ($(TARGET_TAP_TO_WAKE_NODE),) LOCAL_CFLAGS += -DTAP_TO_WAKE_NODE=\"$(TARGET_TAP_TO_WAKE_NODE)\" endif @@ -33,6 +33,7 @@ #include <log/log.h> #include "Power.h" #include "power-common.h" +#include "power-feature.h" namespace android { namespace hardware { @@ -74,6 +75,7 @@ Return<void> Power::setFeature(Feature feature, bool activate) { default: break; } + set_device_specific_feature(static_cast<feature_t>(feature), activate ? 1 : 0); return Void(); } diff --git a/power-common.c b/power-common.c index 1a03c77..e52881f 100644 --- a/power-common.c +++ b/power-common.c @@ -47,6 +47,7 @@ #include "hint-data.h" #include "performance.h" #include "power-common.h" +#include "power-feature.h" static struct hint_handles handles[NUM_HINTS]; @@ -134,3 +135,7 @@ void set_interactive(int on) ALOGI("Got set_interactive hint"); } + +void __attribute__((weak)) set_device_specific_feature(feature_t UNUSED(feature), int UNUSED(state)) +{ +} diff --git a/power-feature.h b/power-feature.h new file mode 100644 index 0000000..abf0d4e --- /dev/null +++ b/power-feature.h @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2015 The CyanogenMod Project + * Copyright (C) 2019 The LineageOS Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _QCOM_POWER_FEATURE_H +#define _QCOM_POWER_FEATURE_H + +#include <hardware/power.h> + +#ifdef __cplusplus +extern "C" { +#endif + +void set_device_specific_feature(feature_t feature, int state); + +#ifdef __cplusplus +} +#endif + +#endif |