From 54f2ac6994ffe6a12f54aa1404150af0640c1a60 Mon Sep 17 00:00:00 2001 From: Steve Paik Date: Fri, 26 Jan 2018 11:10:45 -0800 Subject: [PATCH] Fix missing copies of status member variable Bug: 72348165 Test: Status appears in Embedded Kitchen Sink Change-Id: Ia6a672fa44f0c1d5a7fe04234897d73b3f45e939 --- automotive/vehicle/2.0/default/common/src/VehicleObjectPool.cpp | 1 + automotive/vehicle/2.0/default/common/src/VehicleUtils.cpp | 1 + .../vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp | 1 + 3 files changed, 3 insertions(+) diff --git a/automotive/vehicle/2.0/default/common/src/VehicleObjectPool.cpp b/automotive/vehicle/2.0/default/common/src/VehicleObjectPool.cpp index 3f98a94091..40dd56e73d 100644 --- a/automotive/vehicle/2.0/default/common/src/VehicleObjectPool.cpp +++ b/automotive/vehicle/2.0/default/common/src/VehicleObjectPool.cpp @@ -47,6 +47,7 @@ VehiclePropValuePool::RecyclableType VehiclePropValuePool::obtain( dest->prop = src.prop; dest->areaId = src.areaId; + dest->status = src.status; dest->timestamp = src.timestamp; copyVehicleRawValue(&dest->value, src.value); diff --git a/automotive/vehicle/2.0/default/common/src/VehicleUtils.cpp b/automotive/vehicle/2.0/default/common/src/VehicleUtils.cpp index 34a63806aa..5b6816ee21 100644 --- a/automotive/vehicle/2.0/default/common/src/VehicleUtils.cpp +++ b/automotive/vehicle/2.0/default/common/src/VehicleUtils.cpp @@ -114,6 +114,7 @@ void shallowCopyHidlStr(hidl_string* dest, const hidl_string& src) { void shallowCopy(VehiclePropValue* dest, const VehiclePropValue& src) { dest->prop = src.prop; dest->areaId = src.areaId; + dest->status = src.status; dest->timestamp = src.timestamp; shallowCopyHidlVec(&dest->value.int32Values, src.value.int32Values); shallowCopyHidlVec(&dest->value.int64Values, src.value.int64Values); 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 16d2b0b52f..5118b18888 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 @@ -363,6 +363,7 @@ void EmulatedVehicleHal::onFakeValueGenerated(int32_t propId, float value) { updatedPropValue->prop = propId; updatedPropValue->areaId = 0; // Add area support if necessary. updatedPropValue->timestamp = elapsedRealtimeNano(); + updatedPropValue->status = VehiclePropertyStatus::AVAILABLE; mPropStore->writeValue(*updatedPropValue); auto changeMode = mPropStore->getConfigOrDie(propId)->changeMode; if (VehiclePropertyChangeMode::ON_CHANGE == changeMode) {