From 8eb9e51a418796811b552ee3cf7958b84df01b01 Mon Sep 17 00:00:00 2001 From: mattis fjallstrom Date: Fri, 12 Feb 2016 18:17:54 -0800 Subject: At Olio, where we don't allow outside applications, anything that tries to set a wakelock is allowed to do so. We remove the permission checks since they return incorrect values. Change-Id: Ia8f1929bd0dbbfd8ac56c63a09f689c32aefd0ef --- kernel/power/wakelock.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/kernel/power/wakelock.c b/kernel/power/wakelock.c index 8f50de394d2..ee83a3c5047 100644 --- a/kernel/power/wakelock.c +++ b/kernel/power/wakelock.c @@ -189,21 +189,26 @@ int pm_wake_lock(const char *buf) size_t len; int ret = 0; - if (!capable(CAP_BLOCK_SUSPEND)) +#if 0 /* OLIO our watch is entirely controlled by us, no need for this */ + if (!capable(CAP_BLOCK_SUSPEND)) { + printk ("OLIO %s error return 1, lock %s\n", __FUNCTION__, buf); return -EPERM; + } +#endif while (*str && !isspace(*str)) str++; len = str - buf; - if (!len) + if (!len) { return -EINVAL; - + } if (*str && *str != '\n') { /* Find out if there's a valid timeout string appended. */ ret = kstrtou64(skip_spaces(str), 10, &timeout_ns); - if (ret) + if (ret) { return -EINVAL; + } } mutex_lock(&wakelocks_lock); @@ -235,8 +240,10 @@ int pm_wake_unlock(const char *buf) size_t len; int ret = 0; +#if 0 /* OLIO our watch is entirely controlled by us, no need for this */ if (!capable(CAP_BLOCK_SUSPEND)) return -EPERM; +#endif len = strlen(buf); if (!len) -- cgit v1.2.3-70-g09d2