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/SensorService.cpp b/services/sensorservice/SensorService.cpp
index 9a37ff1..3fbd61e 100644
--- a/services/sensorservice/SensorService.cpp
+++ b/services/sensorservice/SensorService.cpp
@@ -1691,13 +1691,13 @@
     return (packageName.contains(mWhiteListedPackage.string()));
 }
 
-bool SensorService::isOperationRestricted(const String16& opPackageName) {
+bool SensorService::isOperationPermitted(const String16& opPackageName) {
     Mutex::Autolock _l(mLock);
-    if (mCurrentOperatingMode != RESTRICTED) {
+    if (mCurrentOperatingMode == RESTRICTED) {
         String8 package(opPackageName);
-        return !isWhiteListedPackage(package);
+        return isWhiteListedPackage(package);
     }
-    return false;
+    return true;
 }
 
 void SensorService::UidPolicy::registerSelf() {