[sensor] patch from IM department
authorHyunjin Park <hj.na.park@samsung.com>
Thu, 3 Mar 2016 10:23:15 +0000 (19:23 +0900)
committerHyunjin Park <hj.na.park@samsung.com>
Fri, 4 Mar 2016 01:33:20 +0000 (10:33 +0900)
-------------------------------------
[Sensor] Fixed the proximity sensor value

[model] Z3
[binary_type] AP
[customer] N/A
[issue#] N/A
[problem] Proximity sensor sends FAR status when any object is close to the sensor and NEAR status when nothing overlays it. The status is inverted.
[cause] Logic error in web device api plugin.
[solution] Fixed that the Proximity sensor sends NEAR status when any object is close to the sensor and FAR status when nothing overlays it.
[team] AdvancedWearable
[request] N/A
[horizontal_expansion] N/A

Change-Id: Ide485d61fe99ca87d1f81de572b5bb21963f3eab

src/sensor/sensor_service.cc

index 5cc056f0952849be03310f8bd38241b426282aa9..bc076bb2c062315d8cce1582ba89d0172b439fb9 100644 (file)
@@ -86,8 +86,7 @@ void ReportSensorData(sensor_type_e sensor_type, sensor_event_s* sensor_event,
       break;
     }
     case SENSOR_PROXIMITY: {
-      const int state = static_cast<int>(sensor_event->values[0]);
-      (*out)["proximityState"] = picojson::value(state ? "NEAR" : "FAR");
+      (*out)["proximityState"] = picojson::value(SENSOR_PROXIMITY_NEAR == state ? "NEAR" : "FAR");
       break;
     }
     case SENSOR_ULTRAVIOLET: {