summaryrefslogtreecommitdiffstats
path: root/libs/gui
diff options
context:
space:
mode:
authorPrashant Malani <pmalani@google.com>2015-08-20 17:19:05 -0700
committerAravind Akella <aakella@google.com>2015-09-03 04:03:25 +0000
commite35c7d65bb3c226fe3c5fc5e3933f64f0963eaeb (patch)
tree006be4ac795d81e403ffb781d5aa0ad746bd68e3 /libs/gui
parent80402da0dec36a585a014a8ca974e28ef9034722 (diff)
downloadframeworks_native-e35c7d65bb3c226fe3c5fc5e3933f64f0963eaeb.zip
frameworks_native-e35c7d65bb3c226fe3c5fc5e3933f64f0963eaeb.tar.gz
frameworks_native-e35c7d65bb3c226fe3c5fc5e3933f64f0963eaeb.tar.bz2
Add body sensors app op for custom sensors
If the custom sensor requires the BODY SENSOR permission, we should add the body sensors app op for the custom sensor Bug: 23396558 Change-Id: I132917d1bca12c76c8a9fb146e00951cba3e6d7a
Diffstat (limited to 'libs/gui')
-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 2545eec..4b3603e 100644
--- a/libs/gui/Sensor.cpp
+++ b/libs/gui/Sensor.cpp
@@ -223,6 +223,10 @@ Sensor::Sensor(struct sensor_t const* hwSensor, int halVersion)
}
if (halVersion > SENSORS_DEVICE_API_VERSION_1_0 && hwSensor->requiredPermission) {
mRequiredPermission = hwSensor->requiredPermission;
+ if (!strcmp(mRequiredPermission, SENSOR_PERMISSION_BODY_SENSORS)) {
+ AppOpsManager appOps;
+ mRequiredAppOp = appOps.permissionToOpCode(String16(SENSOR_PERMISSION_BODY_SENSORS));
+ }
}
if (halVersion >= SENSORS_DEVICE_API_VERSION_1_3) {