Sensor batching. Changes to the native code.

Bug: 10109508
Change-Id: I7333f3aac76125a8226a4c99c901fb904588df04
diff --git a/include/gui/ISensorEventConnection.h b/include/gui/ISensorEventConnection.h
index 749065e..00eecc4 100644
--- a/include/gui/ISensorEventConnection.h
+++ b/include/gui/ISensorEventConnection.h
@@ -36,8 +36,10 @@
     DECLARE_META_INTERFACE(SensorEventConnection);
 
     virtual sp<BitTube> getSensorChannel() const = 0;
-    virtual status_t enableDisable(int handle, bool enabled) = 0;
+    virtual status_t enableDisable(int handle, bool enabled, nsecs_t samplingPeriodNs,
+                                   nsecs_t maxBatchReportLatencyNs, int reservedFlags) = 0;
     virtual status_t setEventRate(int handle, nsecs_t ns) = 0;
+    virtual status_t flushSensor(int handle) = 0;
 };
 
 // ----------------------------------------------------------------------------
diff --git a/include/gui/Sensor.h b/include/gui/Sensor.h
index 9197372..0c81426 100644
--- a/include/gui/Sensor.h
+++ b/include/gui/Sensor.h
@@ -53,7 +53,7 @@
     };
 
             Sensor();
-            Sensor(struct sensor_t const* hwSensor);
+            Sensor(struct sensor_t const* hwSensor, int halVersion = 0);
             ~Sensor();
 
     const String8& getName() const;
@@ -67,6 +67,8 @@
     int32_t getMinDelay() const;
     nsecs_t getMinDelayNs() const;
     int32_t getVersion() const;
+    int32_t getFifoReservedEventCount() const;
+    int32_t getFifoMaxEventCount() const;
 
     // LightFlattenable protocol
     inline bool isFixedSize() const { return false; }
@@ -85,6 +87,8 @@
     float   mPower;
     int32_t mMinDelay;
     int32_t mVersion;
+    int32_t mFifoReservedEventCount;
+    int32_t mFifoMaxEventCount;
 };
 
 // ----------------------------------------------------------------------------
diff --git a/include/gui/SensorEventQueue.h b/include/gui/SensorEventQueue.h
index 759b5cb..8d8493b 100644
--- a/include/gui/SensorEventQueue.h
+++ b/include/gui/SensorEventQueue.h
@@ -68,8 +68,10 @@
     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 us) const;
+    status_t enableSensor(int32_t handle, int32_t samplingPeriodUs, int maxBatchReportLatencyUs,
+                          int reservedFlags) const;
     status_t disableSensor(int32_t handle) const;
+    status_t flushSensor(int32_t handle) const;
 
 private:
     sp<Looper> getLooper() const;