Revert "gts3l-common: power: Merge power-ext function in the power HAL and apply ours"

This reverts commit a00f867501.
This commit is contained in:
Deokgyu Yang 2022-02-23 01:15:58 +09:00
parent 494b52d87a
commit 42a28d69cf
5 changed files with 21 additions and 9 deletions

View file

@ -157,6 +157,7 @@ TARGET_PROVIDES_KEYMASTER := true
# Power
TARGET_USES_INTERACTION_BOOST := true
TARGET_POWERHAL_SET_INTERACTIVE_EXT := $(COMMON_PATH)/power_ext/power_ext.c
# Properties
TARGET_SYSTEM_PROP += $(COMMON_PATH)/system.prop

View file

@ -24,7 +24,6 @@ cc_binary {
srcs: [
"service.cpp",
"Power.cpp",
"power-ext.c",
"power-helper.c",
"metadata-parser.c",
"utils.c",

View file

@ -350,9 +350,6 @@ void power_set_interactive(int on)
struct video_encode_metadata_t video_encode_metadata;
int rc = 0;
/* Invoke the extension */
power_set_interactive_ext(on);
if (set_interactive_override(on) == HINT_HANDLED) {
return;
}

View file

@ -81,9 +81,6 @@ void power_hint(power_hint_t hint, void *data);
void power_set_interactive(int on);
int extract_platform_stats(uint64_t *list);
// Get an extension function
extern void power_set_interactive_ext(int on);
#ifdef __cplusplus
}
#endif

View file

@ -21,13 +21,31 @@
#define LOG_TAG "PowerHAL_TR_Ext"
#include <utils/Log.h>
#include "utils.h"
#define TOUCHKEY_POWER "/sys/class/input/input6/enabled"
#define SPEN_POWER "/sys/class/input/input3/enabled"
#define TSP_POWER "/sys/class/input/input2/enabled"
#define LCD_POWER "/sys/class/power_supply/battery/lcd"
static void sysfs_write(char *path, char *s) {
char buf[80];
int len;
int fd = open(path, O_WRONLY);
if (fd < 0) {
strerror_r(errno, buf, sizeof(buf));
ALOGE("Error opening %s: %s\n", path, buf);
return;
}
len = write(fd, s, strlen(s));
if (len < 0) {
strerror_r(errno, buf, sizeof(buf));
ALOGE("Error writing to %s: %s\n", path, buf);
}
close(fd);
}
void power_set_interactive_ext(int on) {
ALOGD("%s: %s input devices", __func__, on ? "enabling" : "disabling");
sysfs_write(TSP_POWER, on ? "1" : "0");