Merge "Fix sensor event in vehicle HAL emulator"
diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.cpp
index e3c83d7..4cdd3f7 100644
--- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.cpp
+++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.cpp
@@ -118,6 +118,7 @@
val.prop = protoVal.prop();
val.areaId = protoVal.area_id();
+ val.timestamp = elapsedRealtimeNano();
// Copy value data if it is set. This automatically handles complex data types if needed.
if (protoVal.has_string_value()) {
@@ -456,7 +457,7 @@
VehiclePropValue* internalPropValue = getVehiclePropValueLocked(propId, areaId);
if (internalPropValue != nullptr) {
internalPropValue->value = propValue.value;
- internalPropValue->timestamp = elapsedRealtimeNano();
+ internalPropValue->timestamp = propValue.timestamp;
status = StatusCode::OK;
}
}