OSDN Git Service

[DO NOT MERGE ANYWHERE] Fix bodysensor permission
authorNick Vaccaro <nvaccaro@google.com>
Wed, 23 Nov 2016 16:44:15 +0000 (08:44 -0800)
committerNick Vaccaro <nvaccaro@google.com>
Wed, 23 Nov 2016 16:44:15 +0000 (08:44 -0800)
Bug: 33094188
Change-Id: I1d91e855163954666a18b2f8daadb2639b946b24

services/sensorservice/SensorService.cpp

index 99da2c4..614a9b1 100644 (file)
@@ -868,7 +868,7 @@ void SensorService::makeUuidsIntoIdsForSensorList(Vector<Sensor> &sensorList) co
     }
 }
 
-Vector<Sensor> SensorService::getSensorList(const String16& opPackageName) {
+Vector<Sensor> SensorService::getSensorList(const String16& /* opPackageName */) {
     char value[PROPERTY_VALUE_MAX];
     property_get("debug.sensors", value, "0");
     const Vector<Sensor>& initialSensorList = (atoi(value)) ?
@@ -876,14 +876,7 @@ Vector<Sensor> SensorService::getSensorList(const String16& opPackageName) {
     Vector<Sensor> accessibleSensorList;
     for (size_t i = 0; i < initialSensorList.size(); i++) {
         Sensor sensor = initialSensorList[i];
-        if (canAccessSensor(sensor, "getSensorList", opPackageName)) {
-            accessibleSensorList.add(sensor);
-        } else {
-            ALOGI("Skipped sensor %s because it requires permission %s and app op %d",
-                  sensor.getName().string(),
-                  sensor.getRequiredPermission().string(),
-                  sensor.getRequiredAppOp());
-        }
+        accessibleSensorList.add(sensor);
     }
     makeUuidsIntoIdsForSensorList(accessibleSensorList);
     return accessibleSensorList;