Limit access to head tracker sensor
Lock down access to only internal system usage and CTS due to privacy
considerations.
Bug: 224619073
Test: run SensorHeadTrackerTest with and without "cmd unrestrict-ht"
Change-Id: I0bd37472e058c550de8d0098caa0bd439d8f12a5
diff --git a/services/sensorservice/SensorEventConnection.cpp b/services/sensorservice/SensorEventConnection.cpp
index 6948895..f06f947 100644
--- a/services/sensorservice/SensorEventConnection.cpp
+++ b/services/sensorservice/SensorEventConnection.cpp
@@ -162,7 +162,8 @@
Mutex::Autolock _l(mConnectionLock);
sp<SensorInterface> si = mService->getSensorInterfaceFromHandle(handle);
if (si == nullptr ||
- !canAccessSensor(si->getSensor(), "Add to SensorEventConnection: ", mOpPackageName) ||
+ !mService->canAccessSensor(si->getSensor(), "Add to SensorEventConnection: ",
+ mOpPackageName) ||
mSensorInfo.count(handle) > 0) {
return false;
}