From 20d59bd21b454405f19ca8d5b485197766ce586e Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Mon, 24 Jan 2022 19:45:59 +0000 Subject: [PATCH] Make class SetTimerSlackAction easier to maintain Unify the Darwin and Linux class declarations. Move all #ifdefs for this class into the .cpp file. This patch does not change any functionality. Bug: 213617178 Test: Booted Android in Cuttlefish. Change-Id: I6a3cedc75c2dbf8aa062edda76cae9959767a763 Signed-off-by: Bart Van Assche --- libprocessgroup/task_profiles.cpp | 6 ++++++ libprocessgroup/task_profiles.h | 14 -------------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/libprocessgroup/task_profiles.cpp b/libprocessgroup/task_profiles.cpp index 74ba7f61a..7fe984bae 100644 --- a/libprocessgroup/task_profiles.cpp +++ b/libprocessgroup/task_profiles.cpp @@ -183,6 +183,12 @@ bool SetTimerSlackAction::ExecuteForTask(int tid) const { return true; } +#else + +bool SetTimerSlackAction::ExecuteForTask(int) const { + return true; +}; + #endif bool SetAttributeAction::ExecuteForProcess(uid_t, pid_t pid) const { diff --git a/libprocessgroup/task_profiles.h b/libprocessgroup/task_profiles.h index 1aaa196ba..2b2eda009 100644 --- a/libprocessgroup/task_profiles.h +++ b/libprocessgroup/task_profiles.h @@ -73,9 +73,6 @@ class SetClampsAction : public ProfileAction { int clamp_; }; -// To avoid issues in sdk_mac build -#if defined(__ANDROID__) - class SetTimerSlackAction : public ProfileAction { public: SetTimerSlackAction(unsigned long slack) noexcept : slack_(slack) {} @@ -88,17 +85,6 @@ class SetTimerSlackAction : public ProfileAction { static bool IsTimerSlackSupported(int tid); }; -#else - -class SetTimerSlackAction : public ProfileAction { - public: - SetTimerSlackAction(unsigned long) noexcept {} - - virtual bool ExecuteForTask(int) const { return true; } -}; - -#endif - // Set attribute profile element class SetAttributeAction : public ProfileAction { public: