OSDN Git Service

Set default values for FifoMaxEventCount and ReservedEventCount.
authorAravind Akella <aakella@google.com>
Tue, 13 May 2014 00:14:56 +0000 (17:14 -0700)
committerAravind Akella <aakella@google.com>
Tue, 13 May 2014 00:15:59 +0000 (17:15 -0700)
Change-Id: I4f610c2912ffe1697d1ffb99c556d1c88578466e

libs/gui/Sensor.cpp

index 6f1a3f2..8f63870 100644 (file)
@@ -54,6 +54,9 @@ Sensor::Sensor(struct sensor_t const* hwSensor, int halVersion)
     if (halVersion >= SENSORS_DEVICE_API_VERSION_1_1) {
         mFifoReservedEventCount = hwSensor->fifoReservedEventCount;
         mFifoMaxEventCount = hwSensor->fifoMaxEventCount;
+    } else {
+        mFifoReservedEventCount = 0;
+        mFifoMaxEventCount = 0;
     }
 
     // Ensure existing sensors have correct string type and required