Commit 03f3747b authored by Jeff Brown's avatar Jeff Brown
Browse files

Delete unused function.

set_last_user_activity_timeout() is no longer used or useful.
It opens a sysfs node that no longer exists that used to
be published by a daemon that is no longer even compiled
and that is about to be deleted.  It used to be called
by the power manager with a huge value whose purpose was
essentially to disable the timeout feature altogether.

Long live dead code!

Bug: 6435382
Change-Id: If8f97a66f4e963a11e1c6b67ad97b41b2613043e
parent 7465678e
......@@ -33,9 +33,6 @@ enum {
int acquire_wake_lock(int lock, const char* id);
int release_wake_lock(const char* id);
// set how long to stay awake after the last user activity in seconds
int set_last_user_activity_timeout(int64_t delay);
#if __cplusplus
} // extern "C"
......
......@@ -46,8 +46,6 @@ const char * const NEW_PATHS[] = {
"/sys/power/wake_unlock",
};
const char * const AUTO_OFF_TIMEOUT_DEV = "/sys/android_power/auto_off_timeout";
//XXX static pthread_once_t g_initialized = THREAD_ONCE_INIT;
static int g_initialized = 0;
static int g_fds[OUR_FD_COUNT];
......@@ -125,22 +123,3 @@ release_wake_lock(const char* id)
ssize_t len = write(g_fds[RELEASE_WAKE_LOCK], id, strlen(id));
return len >= 0;
}
int
set_last_user_activity_timeout(int64_t delay)
{
// ALOGI("set_last_user_activity_timeout delay=%d\n", ((int)(delay)));
int fd = open(AUTO_OFF_TIMEOUT_DEV, O_RDWR);
if (fd >= 0) {
char buf[32];
ssize_t len;
len = snprintf(buf, sizeof(buf), "%d", ((int)(delay)));
buf[sizeof(buf) - 1] = '\0';
len = write(fd, buf, len);
close(fd);
return 0;
} else {
return errno;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment