summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPrashant Malani <pmalani@google.com>2015-08-20 17:19:05 -0700
committerThe Android Automerger <android-build@google.com>2015-09-03 10:44:24 -0700
commite8293118b93ff33ce6a686b6d7c500ae9adb2bc9 (patch)
tree006be4ac795d81e403ffb781d5aa0ad746bd68e3
parent8ff104ac854146247f833d41ba821d731a03526e (diff)
downloadframeworks_native-e8293118b93ff33ce6a686b6d7c500ae9adb2bc9.zip
frameworks_native-e8293118b93ff33ce6a686b6d7c500ae9adb2bc9.tar.gz
frameworks_native-e8293118b93ff33ce6a686b6d7c500ae9adb2bc9.tar.bz2
Add body sensors app op for custom sensorsandroid-cts-6.0_r1android-6.0.0_r1
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
-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) {