summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Stultz <john.stultz@linaro.org>2016-07-28 12:35:31 -0700
committerRobert Foss <robert.foss@collabora.com>2017-08-08 10:21:24 +0200
commit206913dff81fdb1193ed519e23d7dfcd03f8c82d (patch)
tree0fbcbafa4002481ecb7891a415cacc6b43b9f7e1
parent1afdc3f44380fd5fde6352317743e9059da6e22d (diff)
downloadandroid-frameworks-base-206913dff81fdb1193ed519e23d7dfcd03f8c82d.tar.gz
android-frameworks-base-206913dff81fdb1193ed519e23d7dfcd03f8c82d.tar.xz
Zygote: Add CAP_WAKE_ALARM to system_server to properly support timerfd alarmsandroid-etnaviv
The when the timerfd alarm logic was added to the kernel, an oversight was made and the interface does not check for the CAP_WAKE_ALARM permissions as required via other kernel methods to trigger an alarm timer. In v4.8-rc kernels, the change 2895a5e5b3a ("timerfd: Reject ALARM timerfds without CAP_WAKE_ALARM") was added by Eric Caruso <ejcaruso@google.com>. After this change (which may be backported to -stable), the AlarmManager will fail on the first timerfd_create call, and will not be able to set the time or handle other necessary functions. The solution here is to add CAP_WAKE_ALARM to the system_server process. Change-Id: Ifdb16f3ef42711e553f727165de3922d484b5be4 Signed-off-by: John Stultz <john.stultz@linaro.org> (cherry picked from commit 5733f387be6cef3836ed06ed897ab43897eb470d)
-rw-r--r--core/java/com/android/internal/os/ZygoteInit.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/java/com/android/internal/os/ZygoteInit.java b/core/java/com/android/internal/os/ZygoteInit.java
index 6829961..34ff176 100644
--- a/core/java/com/android/internal/os/ZygoteInit.java
+++ b/core/java/com/android/internal/os/ZygoteInit.java
@@ -643,7 +643,8 @@ public class ZygoteInit {
OsConstants.CAP_SYS_NICE,
OsConstants.CAP_SYS_RESOURCE,
OsConstants.CAP_SYS_TIME,
- OsConstants.CAP_SYS_TTY_CONFIG
+ OsConstants.CAP_SYS_TTY_CONFIG,
+ OsConstants.CAP_WAKE_ALARM
);
/* Containers run without this capability, so avoid setting it in that case */
if (!SystemProperties.getBoolean(PROPERTY_RUNNING_IN_CONTAINER, false)) {