Extract logic of storing values to separate class
Also rename DefaultVehicleHal to EmulatedVehicleHal and
extract emulator related code to VehicleEmulator class
Test: mm -j32 ; verified Car Service worked
Change-Id: I34361fdec6f94629cf7ef6c35ff56ef9ce78b855
diff --git a/automotive/vehicle/2.0/default/VehicleService.cpp b/automotive/vehicle/2.0/default/VehicleService.cpp
index 95057cc..e6d292e 100644
--- a/automotive/vehicle/2.0/default/VehicleService.cpp
+++ b/automotive/vehicle/2.0/default/VehicleService.cpp
@@ -21,14 +21,16 @@
#include <iostream>
#include <vhal_v2_0/VehicleHalManager.h>
-#include <vhal_v2_0/DefaultVehicleHal.h>
+#include <vhal_v2_0/EmulatedVehicleHal.h>
using namespace android;
using namespace android::hardware;
using namespace android::hardware::automotive::vehicle::V2_0;
int main(int /* argc */, char* /* argv */ []) {
- auto hal = std::make_unique<impl::DefaultVehicleHal>();
+ auto store = std::make_unique<VehiclePropertyStore>();
+ auto hal = std::make_unique<impl::EmulatedVehicleHal>(store.get());
+ auto emulator = std::make_unique<impl::VehicleEmulator>(hal.get());
auto service = std::make_unique<VehicleHalManager>(hal.get());
configureRpcThreadpool(1, true /* callerWillJoin */);