Add ASensorEventQueue_registerSensor and default error value
ASensorEventQueue_registerSensor is new function created in 2016 but
is never exported at NDK level. In this CL the function signature is
formalized and the function name is added to NDK function export
table. Internal class SensorEventQueue is also changed to adapt.
Default error values are also defined.
Test: cts-tradefed run cts --module CtsSensorTestCases \
--test android.hardware.cts.SensorNativeTest
Change-Id: I74dc72e50ea4bae6d2d8944ce6d2e191ed2f495e
diff --git a/libs/sensor/SensorEventQueue.cpp b/libs/sensor/SensorEventQueue.cpp
index 8ba3ebe..6f68fb5 100644
--- a/libs/sensor/SensorEventQueue.cpp
+++ b/libs/sensor/SensorEventQueue.cpp
@@ -135,7 +135,7 @@
}
status_t SensorEventQueue::enableSensor(int32_t handle, int32_t samplingPeriodUs,
- int maxBatchReportLatencyUs, int reservedFlags) const {
+ int64_t maxBatchReportLatencyUs, int reservedFlags) const {
return mSensorEventConnection->enableDisable(handle, true, us2ns(samplingPeriodUs),
us2ns(maxBatchReportLatencyUs), reservedFlags);
}