From 4c6c06470f4998506d59de0a6488f40d50ca4154 Mon Sep 17 00:00:00 2001 From: aavit Date: Thu, 20 Mar 2014 11:25:31 +0100 Subject: Compilation fixes for Android 4.4 Change-Id: I2017665372e190f9d12841820714457967ff3a3a Reviewed-by: Gatis Paeglis --- src/doppelganger/schedulingpolicyservice.cpp | 11 ++++++++++- src/doppelganger/schedulingpolicyservice.h | 5 +++++ 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'src/doppelganger') diff --git a/src/doppelganger/schedulingpolicyservice.cpp b/src/doppelganger/schedulingpolicyservice.cpp index a7a3f17..365e97a 100644 --- a/src/doppelganger/schedulingpolicyservice.cpp +++ b/src/doppelganger/schedulingpolicyservice.cpp @@ -49,7 +49,7 @@ status_t SchedulingPolicyService::onTransact(uint32_t code, const Parcel &data, int32_t pid = data.readInt32(); int32_t tid = data.readInt32(); int32_t prio = data.readInt32(); - int res = requestPriority(pid, tid, prio); + int res = requestPriority_helper(pid, tid, prio); reply->writeNoException(); reply->writeInt32(res); return NO_ERROR; @@ -59,7 +59,16 @@ status_t SchedulingPolicyService::onTransact(uint32_t code, const Parcel &data, } } +#if Q_ANDROID_VERSION_MAJOR == 4 && Q_ANDROID_VERSION_MINOR < 3 int SchedulingPolicyService::requestPriority(int32_t pid, int32_t tid, int32_t prio) +#else +int SchedulingPolicyService::requestPriority(int32_t pid, int32_t tid, int32_t prio, bool) +#endif +{ + return requestPriority_helper(pid, tid, prio); +} + +int SchedulingPolicyService::requestPriority_helper(int32_t pid, int32_t tid, int32_t prio) { if (prio < PRIORITY_MIN || prio > PRIORITY_MAX) return PERMISSION_DENIED; diff --git a/src/doppelganger/schedulingpolicyservice.h b/src/doppelganger/schedulingpolicyservice.h index ef56dcd..f544561 100644 --- a/src/doppelganger/schedulingpolicyservice.h +++ b/src/doppelganger/schedulingpolicyservice.h @@ -30,10 +30,15 @@ public: android::status_t onTransact(uint32_t code, const android::Parcel &data, android::Parcel *reply, uint32_t flags); +#if Q_ANDROID_VERSION_MAJOR == 4 && Q_ANDROID_VERSION_MINOR < 3 int requestPriority(int32_t pid, int32_t tid, int32_t prio); +#else + int requestPriority(int32_t pid, int32_t tid, int32_t prio, bool); +#endif private: SchedulingPolicyService(); + int requestPriority_helper(int32_t pid, int32_t tid, int32_t prio); }; #endif // SCHEDULINGPOLICYSERVICE_H -- cgit v1.2.3