Merge "Fix compilation error on emerald-dev" into cw-e-dev
diff --git a/6515/libsensors_iio/InputEventReader.cpp b/6515/libsensors_iio/InputEventReader.cpp
index 968e32e..5ec3e6c 100755
--- a/6515/libsensors_iio/InputEventReader.cpp
+++ b/6515/libsensors_iio/InputEventReader.cpp
@@ -20,6 +20,7 @@
 #include <errno.h>
 #include <unistd.h>
 #include <poll.h>
+#include <string.h>
 
 #include <sys/cdefs.h>
 #include <sys/types.h>
diff --git a/6515/libsensors_iio/MPLSensor.cpp b/6515/libsensors_iio/MPLSensor.cpp
index 1061598..0ef2c95 100644
--- a/6515/libsensors_iio/MPLSensor.cpp
+++ b/6515/libsensors_iio/MPLSensor.cpp
@@ -117,20 +117,6 @@
                          mAccelBiasApplied(false),
                          mPendingMask(0),
                          mSensorMask(0),
-                         mMplFeatureActiveMask(0),
-                         mFeatureActiveMask(0),
-                         mDmpOn(0),
-                         mPedUpdate(0),
-                         mPressureUpdate(0),
-                         mQuatSensorTimestamp(0),
-                         mStepSensorTimestamp(0),
-                         mLastStepCount(-1),
-                         mLeftOverBufferSize(0),
-                         mInitial6QuatValueAvailable(0),
-                         mFlushBatchSet(0),
-                         mSkipReadEvents(0),
-                         mDataMarkerDetected(0),
-                         mEmptyDataMarkerDetected(0),
                          mGyroBatchRate(0),
                          mAccelBatchRate(0),
                          mCompassBatchRate(0),
@@ -144,7 +130,20 @@
                          mResetRate(0),
                          mDataInterrupt(0),
                          mFirstBatchCall(1),
-                         mEnableCalled(1) {
+                         mEnableCalled(1),
+                         mMplFeatureActiveMask(0),
+                         mFeatureActiveMask(0),
+                         mDmpOn(0),
+                         mPedUpdate(0),
+                         mPressureUpdate(0),
+                         mQuatSensorTimestamp(0),
+                         mStepSensorTimestamp(0),
+                         mLastStepCount(-1),
+                         mLeftOverBufferSize(0),
+                         mInitial6QuatValueAvailable(0),
+                         mSkipReadEvents(0),
+                         mDataMarkerDetected(0),
+                         mEmptyDataMarkerDetected(0) {
     VFUNC_LOG;
 
     inv_error_t rv;
@@ -5760,7 +5759,11 @@
 
     LOGV_IF(PROCESS_VERBOSE,
             "HAL:batch after applying upper and lower limit: %llu ns, (%.2f Hz)",
-			period_ns, 1000000000.f / period_ns);
+            period_ns, 1000000000.f / period_ns);
+
+    LOGV_IF(PROCESS_VERBOSE,
+            "HAL:batch after applying upper and lower limit: %llu ns, (%.2f Hz)",
+            period_ns, 1000000000.f / period_ns);
 
     switch (what) {
     case Gyro:
@@ -6544,7 +6547,7 @@
 #ifdef ENABLE_PRESSURE
     int64_t pressureRate;
 #endif
-    int64_t quatRate;
+    int64_t quatRate = 0;
 
     int mplGyroRate;
     int mplAccelRate;
diff --git a/6515/libsensors_iio/SensorBase.cpp b/6515/libsensors_iio/SensorBase.cpp
index f1d00fb..16057ff 100755
--- a/6515/libsensors_iio/SensorBase.cpp
+++ b/6515/libsensors_iio/SensorBase.cpp
@@ -24,6 +24,7 @@
 #include <sys/select.h>
 #include <cutils/log.h>
 #include <linux/input.h>
+#include <string.h>
 
 #include <cutils/properties.h>
 
diff --git a/6515/libsensors_iio/sensors_mpl.cpp b/6515/libsensors_iio/sensors_mpl.cpp
index 7e7b06b..c55e86c 100755
--- a/6515/libsensors_iio/sensors_mpl.cpp
+++ b/6515/libsensors_iio/sensors_mpl.cpp
@@ -81,6 +81,14 @@
         open: open_sensors
 };
 
+static int sensors_set_operation_mode(unsigned int mode)
+{
+    LOGI("%s", __FUNCTION__);
+    LOGI("%s: stub function: ignoring mode request (%d)", __FUNCTION__,
+                 mode);
+    return 0;
+}
+
 struct sensors_module_t HAL_MODULE_INFO_SYM = {
         common: {
                 tag: HARDWARE_MODULE_TAG,
@@ -94,6 +102,7 @@
                 reserved: {0}
         },
         get_sensors_list: sensors__get_sensors_list,
+        set_operation_mode: sensors_set_operation_mode
 };
 
 struct sensors_poll_context_t {