OSDN Git Service

Initialize native Sensor object correctly
authorPeng Xu <pengxu@google.com>
Tue, 25 Jul 2017 00:50:53 +0000 (17:50 -0700)
committerPeng Xu <pengxu@google.com>
Tue, 25 Jul 2017 00:50:53 +0000 (17:50 -0700)
This CL gives default values for all fields in Sensor native
object.

Bug: 37640915
Test: added local logging to verify all native sensor objects are
      initialized correctly.

Change-Id: I4076756249788f56960c74629cb800f1b2bae79f

libs/sensor/Sensor.cpp

index 0a537a3..a0e368c 100644 (file)
@@ -38,7 +38,8 @@ Sensor::Sensor(struct sensor_t const* hwSensor, int halVersion) :
         Sensor(*hwSensor, uuid_t(), halVersion) {
 }
 
-Sensor::Sensor(struct sensor_t const& hwSensor, const uuid_t& uuid, int halVersion) {
+Sensor::Sensor(struct sensor_t const& hwSensor, const uuid_t& uuid, int halVersion) :
+        Sensor("") {
     mName = hwSensor.name;
     mVendor = hwSensor.vendor;
     mVersion = hwSensor.version;