summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorMatt Filetto <matt.filetto@gmail.com>2015-12-20 20:22:04 -0800
committerEthan Chen <intervigil@gmail.com>2015-12-21 08:54:18 -0800
commitb17c928090764a0bdefefa17ae31326e02b55d62 (patch)
treed8ffa2c5aed2dedf89c732e7734daaff66074481 /libs
parentcbd3e07921a7e7525d88c7606b1b8aeb32441804 (diff)
downloadframeworks_native-b17c928090764a0bdefefa17ae31326e02b55d62.zip
frameworks_native-b17c928090764a0bdefefa17ae31326e02b55d62.tar.gz
frameworks_native-b17c928090764a0bdefefa17ae31326e02b55d62.tar.bz2
sensor: Skip additional permission request checks
* Some legacy Samsung HALs supporting BODY_SENSOR types are incompatible with the new permission checks added in M. Extend the NO_SENSOR_PERMISSION_CHECK flags to cover more of the actual checks. Change-Id: Id2b9b57d8151b0998d9233e0a6541e8c88e06af7
Diffstat (limited to 'libs')
-rw-r--r--libs/gui/Sensor.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/gui/Sensor.cpp b/libs/gui/Sensor.cpp
index e62c585..e423a8e 100644
--- a/libs/gui/Sensor.cpp
+++ b/libs/gui/Sensor.cpp
@@ -118,9 +118,11 @@ Sensor::Sensor(struct sensor_t const* hwSensor, int halVersion)
break;
case SENSOR_TYPE_HEART_RATE: {
mStringType = SENSOR_STRING_TYPE_HEART_RATE;
+#ifndef NO_SENSOR_PERMISSION_CHECK
mRequiredPermission = SENSOR_PERMISSION_BODY_SENSORS;
AppOpsManager appOps;
mRequiredAppOp = appOps.permissionToOpCode(String16(SENSOR_PERMISSION_BODY_SENSORS));
+#endif
mFlags |= SENSOR_FLAG_ON_CHANGE_MODE;
} break;
case SENSOR_TYPE_LIGHT:
@@ -221,6 +223,7 @@ Sensor::Sensor(struct sensor_t const* hwSensor, int halVersion)
if (halVersion > SENSORS_DEVICE_API_VERSION_1_0 && hwSensor->stringType) {
mStringType = hwSensor->stringType;
}
+#ifndef NO_SENSOR_PERMISSION_CHECK
if (halVersion > SENSORS_DEVICE_API_VERSION_1_0 && hwSensor->requiredPermission) {
mRequiredPermission = hwSensor->requiredPermission;
if (!strcmp(mRequiredPermission, SENSOR_PERMISSION_BODY_SENSORS)) {
@@ -228,6 +231,7 @@ Sensor::Sensor(struct sensor_t const* hwSensor, int halVersion)
mRequiredAppOp = appOps.permissionToOpCode(String16(SENSOR_PERMISSION_BODY_SENSORS));
}
}
+#endif
if (halVersion >= SENSORS_DEVICE_API_VERSION_1_3) {
mFlags = static_cast<uint32_t>(hwSensor->flags);