From 43b9e3524f90a59e59f4d6a1f0e7f6629e4d029f Mon Sep 17 00:00:00 2001 From: Michael Bestas Date: Sun, 6 Oct 2019 01:34:17 +0300 Subject: power: Clean up and fix set_interactive_override * Remove debug logs and useless comments * Consistent return values * Add back display hints for legacy platforms, they used to live in power-common.c but removed in commit 561cffcbfa66192e839e040d2da3bff2ecf8dcac * Check if set_interactive_override handled hints and print info message if it didn't Change-Id: Iff9f7327ba71c282e34ff3143c45a3f40f72fc92 --- power-msmnile.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'power-msmnile.c') diff --git a/power-msmnile.c b/power-msmnile.c index 965eb9d..d6fcb80 100644 --- a/power-msmnile.c +++ b/power-msmnile.c @@ -53,12 +53,8 @@ int set_interactive_override(int on) { static const char* display_off = "0"; char err_buf[80]; static int init_interactive_hint = 0; - static int set_i_count = 0; int rc = 0; - set_i_count++; - ALOGI("Got set_interactive hint on= %d, count= %d\n", on, set_i_count); - if (init_interactive_hint == 0) { // First time the display is turned off display_fd = TEMP_FAILURE_RETRY(open(SYS_DISPLAY_PWR, O_RDWR)); @@ -68,7 +64,7 @@ int set_interactive_override(int on) { } else init_interactive_hint = 1; } else if (!on) { - /* Display off. */ + /* Display off */ rc = TEMP_FAILURE_RETRY(write(display_fd, display_off, strlen(display_off))); if (rc < 0) { strerror_r(errno, err_buf, sizeof(err_buf)); @@ -82,7 +78,6 @@ int set_interactive_override(int on) { ALOGE("Error writing %s to %s: %s\n", display_on, SYS_DISPLAY_PWR, err_buf); } } - return HINT_HANDLED; } -- cgit v1.2.3