Skip to content

ANDROID: ag x86: disable wake alarms #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: gloria-20231223
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions fs/timerfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,15 @@ SYSCALL_DEFINE2(timerfd_create, int, clockid, int, flags)
BUILD_BUG_ON(TFD_CLOEXEC != O_CLOEXEC);
BUILD_BUG_ON(TFD_NONBLOCK != O_NONBLOCK);

// disabling alarms for android on x86 platforms
// doing it in a way that won't cause errors in frameworks/base/apex/jobscheduler/service/jni/com_android_server_alarm_AlarmManagerService.cpp
if(clockid == CLOCK_REALTIME_ALARM){
clockid = CLOCK_REALTIME;
}
if(clockid == CLOCK_BOOTTIME_ALARM){
clockid = CLOCK_BOOTTIME;
}

if ((flags & ~TFD_CREATE_FLAGS) ||
(clockid != CLOCK_MONOTONIC &&
clockid != CLOCK_REALTIME &&
Expand Down
6 changes: 6 additions & 0 deletions kernel/time/posix-timers.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,12 @@ static int common_timer_create(struct k_itimer *new_timer)
static int do_timer_create(clockid_t which_clock, struct sigevent *event,
timer_t __user *created_timer_id)
{
if(which_clock == CLOCK_REALTIME_ALARM){
which_clock = CLOCK_REALTIME;
}
if(which_clock == CLOCK_BOOTTIME_ALARM){
which_clock = CLOCK_BOOTTIME;
}
const struct k_clock *kc = clockid_to_kclock(which_clock);
struct k_itimer *new_timer;
int error, new_timer_id;
Expand Down