frameworks/base
修訂 | c66a38c66e1d92550c0b5c91139d2b75ab522d6e (tree) |
---|---|
時間 | 2016-11-22 12:24:35 |
作者 | John Stultz <john.stultz@lina...> |
Commiter | Chih-Wei Huang |
Zygote: Add CAP_WAKE_ALARM to system_server to properly support timerfd alarms
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>
@@ -518,7 +518,8 @@ public class ZygoteInit { | ||
518 | 518 | OsConstants.CAP_SYS_NICE, |
519 | 519 | OsConstants.CAP_SYS_RESOURCE, |
520 | 520 | OsConstants.CAP_SYS_TIME, |
521 | - OsConstants.CAP_SYS_TTY_CONFIG | |
521 | + OsConstants.CAP_SYS_TTY_CONFIG, | |
522 | + OsConstants.CAP_WAKE_ALARM | |
522 | 523 | ); |
523 | 524 | /* Hardcoded command line to start the system server */ |
524 | 525 | String args[] = { |