From 338893e47ed8e2a913e5def987469647809cdbc6 Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Mon, 18 Jul 2016 16:58:52 -0700 Subject: [PATCH] Remove dependency on android_alarm.h. android_alarm.h no longer exists in upstream android kernels. Since it's only used by the AlarmManagerService, copy in the parts of the file that are needed into that one file. Bug: 30072483 Change-Id: I5c994dfa2ad261da48a67e5c35dc4b6618b82aa1 --- ...com_android_server_AlarmManagerService.cpp | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/services/core/jni/com_android_server_AlarmManagerService.cpp b/services/core/jni/com_android_server_AlarmManagerService.cpp index 407c0726e5212..8f6f6136a49ab 100644 --- a/services/core/jni/com_android_server_AlarmManagerService.cpp +++ b/services/core/jni/com_android_server_AlarmManagerService.cpp @@ -37,11 +37,39 @@ #include #include #include -#include #include #include +//-------------------------------------------------------------------------- +// The android_alarm.h header has been deleted from the kernel headers. +// Add only the parts still needed, this should be deleted in the future. +#include + +enum android_alarm_type { + ANDROID_ALARM_RTC_WAKEUP, + ANDROID_ALARM_RTC, + ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP, + ANDROID_ALARM_ELAPSED_REALTIME, + ANDROID_ALARM_SYSTEMTIME, + ANDROID_ALARM_TYPE_COUNT, +}; + +enum android_alarm_return_flags { + ANDROID_ALARM_RTC_WAKEUP_MASK = 1U << ANDROID_ALARM_RTC_WAKEUP, + ANDROID_ALARM_RTC_MASK = 1U << ANDROID_ALARM_RTC, + ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP_MASK = 1U << ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP, + ANDROID_ALARM_ELAPSED_REALTIME_MASK = 1U << ANDROID_ALARM_ELAPSED_REALTIME, + ANDROID_ALARM_SYSTEMTIME_MASK = 1U << ANDROID_ALARM_SYSTEMTIME, + ANDROID_ALARM_TIME_CHANGE_MASK = 1U << 16 +}; + +#define ALARM_IOW(c,type,size) _IOW('a', (c) | ((type) << 4), size) +#define ANDROID_ALARM_WAIT _IO('a', 1) +#define ANDROID_ALARM_SET(type) ALARM_IOW(2, type, struct timespec) +#define ANDROID_ALARM_SET_RTC _IOW('a', 5, struct timespec) +//-------------------------------------------------------------------------- + namespace android { static const size_t N_ANDROID_TIMERFDS = ANDROID_ALARM_TYPE_COUNT + 1;