commit | 47a9378d4decf802a1715653f1aef8b8a97d5aa5 | [log] [tgz] |
---|---|---|
author | Kai <kwangsudo@google.com> | Wed Feb 26 13:00:16 2020 -0800 |
committer | Kai Wang <kwangsudo@google.com> | Tue Mar 17 22:46:06 2020 +0000 |
tree | 3ca03d23684564d404dbd53534c5d9d22d29c026 | |
parent | 2056c2da3b331de226d1e78ad15be21fdbba846c [diff] |
Add timestamp for continuously property. Bug: 148960132 Test: 1. apply google vhal to device 2. atest CtsCarTestCases:CarPropertyManagerTest Change-Id: Ib6690b5e242287958017c87632f56a546d418674
diff --git a/automotive/vehicle/2.0/default/common/src/VehiclePropertyStore.cpp b/automotive/vehicle/2.0/default/common/src/VehiclePropertyStore.cpp index 24b777c..6087bfa 100644 --- a/automotive/vehicle/2.0/default/common/src/VehiclePropertyStore.cpp +++ b/automotive/vehicle/2.0/default/common/src/VehiclePropertyStore.cpp
@@ -58,6 +58,8 @@ return false; } // update the propertyValue. + // The timestamp in propertyStore should only be updated by the server side. It indicates + // the time when the event is generated by the server. valueToUpdate->timestamp = propValue.timestamp; valueToUpdate->value = propValue.value; if (updateStatus) {
diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp index 692c7f7..7ffa8ba 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp
@@ -127,7 +127,9 @@ *outStatus = v != nullptr ? StatusCode::OK : StatusCode::INVALID_ARG; break; } - + if (v.get()) { + v->timestamp = elapsedRealtimeNano(); + } return v; } @@ -284,6 +286,7 @@ } if (v.get()) { + v->timestamp = elapsedRealtimeNano(); doHalEvent(std::move(v)); } }