From 0b067c6ecdfee4fb784d9370d00adb48a321bc3f Mon Sep 17 00:00:00 2001 From: Peng Xu Date: Wed, 20 Sep 2017 18:59:12 -0700 Subject: Revert "Remove UID requirement for set sched_fifo for sensor thread" This reverts commit 76dc595d2a268792900663dac756c691374bae85. Bug: 37291237 Test: compiles and 2016, 2017 device works with other CLs in this topic. --- services/schedulerservice/SchedulingPolicyService.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/services/schedulerservice/SchedulingPolicyService.cpp b/services/schedulerservice/SchedulingPolicyService.cpp index 1f6ed57913..a1106cf49b 100644 --- a/services/schedulerservice/SchedulingPolicyService.cpp +++ b/services/schedulerservice/SchedulingPolicyService.cpp @@ -17,6 +17,8 @@ #include "SchedulingPolicyService.h" +#include // for AID_CAMERASERVER + #include #include #include @@ -28,8 +30,9 @@ namespace V1_0 { namespace implementation { bool SchedulingPolicyService::isAllowed() { - // TODO(b/37291237) - return true; + using ::android::hardware::IPCThreadState; + + return IPCThreadState::self()->getCallingUid() == AID_CAMERASERVER; } Return SchedulingPolicyService::requestPriority(int32_t pid, int32_t tid, int32_t priority) { -- cgit v1.2.3-59-g8ed1b