Fix inverted logic in isOperationRestricted
SensorService::isOperationRestricted incorrectly returned 'true'
whenever the Sensor Service was in normal mode and an application was
not whitelisted. This patch corrects the logic and updates the
function's name to be isOperationPermitted to avoid confusion.
Bug: 128028800
Test: CTS Direct Channel tests pass
Change-Id: Ia1684be54c1c7c0db81d8fcb2780fd2583a35537
diff --git a/services/sensorservice/SensorDirectConnection.cpp b/services/sensorservice/SensorDirectConnection.cpp
index 538d728..cd0ea5d 100644
--- a/services/sensorservice/SensorDirectConnection.cpp
+++ b/services/sensorservice/SensorDirectConnection.cpp
@@ -100,7 +100,7 @@
return NO_ERROR;
}
- if (mService->isOperationRestricted(mOpPackageName)) {
+ if (!mService->isOperationPermitted(mOpPackageName)) {
return PERMISSION_DENIED;
}