Loading automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp +0 −11 Original line number Original line Diff line number Diff line Loading @@ -272,17 +272,6 @@ static bool isDiagnosticProperty(VehiclePropConfig propConfig) { return false; return false; } } // determine if it's running inside Android Emulator static bool isInEmulator() { char propValue[PROP_VALUE_MAX]; bool isEmulator = (__system_property_get("ro.kernel.qemu", propValue) != 0); if (!isEmulator) { isEmulator = (__system_property_get("ro.hardware", propValue) != 0) && (!strcmp(propValue, "ranchu") || !strcmp(propValue, "goldfish")); } return isEmulator; } // Parse supported properties list and generate vector of property values to hold current values. // Parse supported properties list and generate vector of property values to hold current values. void EmulatedVehicleHal::onCreate() { void EmulatedVehicleHal::onCreate() { static constexpr bool shouldUpdateStatus = true; static constexpr bool shouldUpdateStatus = true; Loading automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleEmulator.cpp +5 −1 Original line number Original line Diff line number Diff line Loading @@ -44,7 +44,7 @@ VehicleEmulator::VehicleEmulator(EmulatedVehicleHalIface* hal) : mHal{hal} { mSocketComm = std::make_unique<SocketComm>(this); mSocketComm = std::make_unique<SocketComm>(this); mSocketComm->start(); mSocketComm->start(); if (android::base::GetBoolProperty("ro.kernel.qemu", false)) { if (isInEmulator()) { ALOGI("Starting PipeComm"); ALOGI("Starting PipeComm"); mPipeComm = std::make_unique<PipeComm>(this); mPipeComm = std::make_unique<PipeComm>(this); mPipeComm->start(); mPipeComm->start(); Loading Loading @@ -226,6 +226,10 @@ void VehicleEmulator::populateProtoVehiclePropValue(vhal_proto::VehiclePropValue return proto_msg_converter::toProto(protoVal, *val); return proto_msg_converter::toProto(protoVal, *val); } } bool isInEmulator() { return android::base::GetBoolProperty("ro.boot.qemu", false); } } // impl } // impl } // namespace V2_0 } // namespace V2_0 Loading automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleEmulator.h +3 −0 Original line number Original line Diff line number Diff line Loading @@ -95,6 +95,9 @@ private: std::unique_ptr<PipeComm> mPipeComm; std::unique_ptr<PipeComm> mPipeComm; }; }; // determine if it's running inside Android Emulator bool isInEmulator(); } // impl } // impl } // namespace V2_0 } // namespace V2_0 Loading Loading
automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp +0 −11 Original line number Original line Diff line number Diff line Loading @@ -272,17 +272,6 @@ static bool isDiagnosticProperty(VehiclePropConfig propConfig) { return false; return false; } } // determine if it's running inside Android Emulator static bool isInEmulator() { char propValue[PROP_VALUE_MAX]; bool isEmulator = (__system_property_get("ro.kernel.qemu", propValue) != 0); if (!isEmulator) { isEmulator = (__system_property_get("ro.hardware", propValue) != 0) && (!strcmp(propValue, "ranchu") || !strcmp(propValue, "goldfish")); } return isEmulator; } // Parse supported properties list and generate vector of property values to hold current values. // Parse supported properties list and generate vector of property values to hold current values. void EmulatedVehicleHal::onCreate() { void EmulatedVehicleHal::onCreate() { static constexpr bool shouldUpdateStatus = true; static constexpr bool shouldUpdateStatus = true; Loading
automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleEmulator.cpp +5 −1 Original line number Original line Diff line number Diff line Loading @@ -44,7 +44,7 @@ VehicleEmulator::VehicleEmulator(EmulatedVehicleHalIface* hal) : mHal{hal} { mSocketComm = std::make_unique<SocketComm>(this); mSocketComm = std::make_unique<SocketComm>(this); mSocketComm->start(); mSocketComm->start(); if (android::base::GetBoolProperty("ro.kernel.qemu", false)) { if (isInEmulator()) { ALOGI("Starting PipeComm"); ALOGI("Starting PipeComm"); mPipeComm = std::make_unique<PipeComm>(this); mPipeComm = std::make_unique<PipeComm>(this); mPipeComm->start(); mPipeComm->start(); Loading Loading @@ -226,6 +226,10 @@ void VehicleEmulator::populateProtoVehiclePropValue(vhal_proto::VehiclePropValue return proto_msg_converter::toProto(protoVal, *val); return proto_msg_converter::toProto(protoVal, *val); } } bool isInEmulator() { return android::base::GetBoolProperty("ro.boot.qemu", false); } } // impl } // impl } // namespace V2_0 } // namespace V2_0 Loading
automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleEmulator.h +3 −0 Original line number Original line Diff line number Diff line Loading @@ -95,6 +95,9 @@ private: std::unique_ptr<PipeComm> mPipeComm; std::unique_ptr<PipeComm> mPipeComm; }; }; // determine if it's running inside Android Emulator bool isInEmulator(); } // impl } // impl } // namespace V2_0 } // namespace V2_0 Loading