summaryrefslogtreecommitdiff
path: root/native/android/sensor.cpp
diff options
context:
space:
mode:
authorBrian Stack <bstack@google.com>2019-01-09 13:41:00 -0800
committerBrian Stack <bstack@google.com>2019-01-11 17:30:13 -0800
commit38c97d4ff633122d96ba900c8b86e69d0558cc8a (patch)
tree4d6f202c2bf3d30858c39c59c939694719d8485b /native/android/sensor.cpp
parentbc4bfd6ae1da22305988ee708fd5cc7b7498ba02 (diff)
Introduce ASensor_getHandle API to Sensors NDK
Adds the ASensor_getHandle API to the Sensors NDK which returns a sensors internal sensor handle. Bug: 122366555 Test: Builds, verified function returns correct handle Change-Id: I1358528d2e7ee2918d5f5c2195d51adaa2cc3661
Diffstat (limited to 'native/android/sensor.cpp')
-rw-r--r--native/android/sensor.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/native/android/sensor.cpp b/native/android/sensor.cpp
index 8e5821024cee..c3b2e2526ea8 100644
--- a/native/android/sensor.cpp
+++ b/native/android/sensor.cpp
@@ -342,3 +342,8 @@ int ASensor_getHighestDirectReportRateLevel(ASensor const *sensor) {
RETURN_IF_SENSOR_IS_NULL(ASENSOR_DIRECT_RATE_STOP);
return static_cast<Sensor const *>(sensor)->getHighestDirectReportRateLevel();
}
+
+int ASensor_getHandle(ASensor const* sensor) {
+ RETURN_IF_SENSOR_IS_NULL(ASENSOR_INVALID);
+ return static_cast<Sensor const*>(sensor)->getHandle();
+}