Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c95e7a30 authored by Christopher Ferris's avatar Christopher Ferris Committed by Gerrit Code Review
Browse files

Merge "Remove dependency on android_alarm.h."

parents bba87840 338893e4
Loading
Loading
Loading
Loading
+29 −1
Original line number Diff line number Diff line
@@ -37,11 +37,39 @@
#include <errno.h>
#include <unistd.h>
#include <linux/ioctl.h>
#include <linux/android_alarm.h>
#include <linux/rtc.h>

#include <memory>

//--------------------------------------------------------------------------
// 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 <linux/ioctl.h>

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;