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);
 }
diff --git a/libs/sensor/include/sensor/SensorEventQueue.h b/libs/sensor/include/sensor/SensorEventQueue.h
index 84b6ab2..a03c7ee 100644
--- a/libs/sensor/include/sensor/SensorEventQueue.h
+++ b/libs/sensor/include/sensor/SensorEventQueue.h
@@ -84,7 +84,7 @@
     status_t setEventRate(Sensor const* sensor, nsecs_t ns) const;
 
     // these are here only to support SensorManager.java
-    status_t enableSensor(int32_t handle, int32_t samplingPeriodUs, int maxBatchReportLatencyUs,
+    status_t enableSensor(int32_t handle, int32_t samplingPeriodUs, int64_t maxBatchReportLatencyUs,
                           int reservedFlags) const;
     status_t disableSensor(int32_t handle) const;
     status_t flush() const;