Loading automotive/vehicle/2.0/default/common/include/vhal_v2_0/VmsUtils.h +1 −1 Original line number Diff line number Diff line Loading @@ -172,7 +172,7 @@ std::unique_ptr<VehiclePropValue> createSubscriptionsRequest(); // should first convert the proto to a byte string (vms_packet) using the // SerializeToString proto API. Then, it use this interface to build the VehicleProperty // by passing publisher and layer information (layer_publisher) and the vms_packet. std::unique_ptr<VehiclePropValue> CreateDataMessageWithLayerPublisherInfo( std::unique_ptr<VehiclePropValue> createDataMessageWithLayerPublisherInfo( const VmsLayerAndPublisher& layer_publisher, const std::string& vms_packet); // Creates a VehiclePropValue containing a message of type Loading automotive/vehicle/2.0/default/common/src/VmsUtils.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -126,7 +126,7 @@ std::unique_ptr<VehiclePropValue> createSubscriptionsRequest() { return result; } std::unique_ptr<VehiclePropValue> CreateDataMessageWithLayerPublisherInfo( std::unique_ptr<VehiclePropValue> createDataMessageWithLayerPublisherInfo( const VmsLayerAndPublisher& layer_publisher, const std::string& vms_packet) { auto result = createBaseVmsMessage(kMessageTypeSize + kLayerAndPublisherSize); result->value.int32Values = hidl_vec<int32_t>{ Loading automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h +11 −0 Original line number Diff line number Diff line Loading @@ -240,6 +240,17 @@ const ConfigDeclaration kVehicleProperties[]{ }, .initialValue = {.floatValues = {0.0f}}}, {.config = { .prop = toInt(VehicleProperty::VEHICLE_SPEED_DISPLAY_UNITS), .access = VehiclePropertyAccess::READ_WRITE, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .configArray = {(int)VehicleUnit::METER_PER_SEC, (int)VehicleUnit::MILES_PER_HOUR, (int)VehicleUnit::KILOMETERS_PER_HOUR}, }, .initialValue = {.int32Values = {(int)VehicleUnit::KILOMETERS_PER_HOUR}}}, {.config = { .prop = toInt(VehicleProperty::INFO_DRIVER_SEAT), Loading automotive/vehicle/2.0/default/tests/VmsUtils_test.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -141,7 +141,7 @@ TEST(VmsUtilsTest, subscriptionsMessage) { TEST(VmsUtilsTest, dataMessage) { const std::string bytes = "aaa"; const VmsLayerAndPublisher layer_and_publisher(VmsLayer(2, 0, 1), 123); auto message = CreateDataMessageWithLayerPublisherInfo(layer_and_publisher, bytes); auto message = createDataMessageWithLayerPublisherInfo(layer_and_publisher, bytes); ASSERT_NE(message, nullptr); EXPECT_TRUE(isValidVmsMessage(*message)); EXPECT_EQ(message->prop, toInt(VehicleProperty::VEHICLE_MAP_SERVICE)); Loading Loading @@ -177,7 +177,7 @@ TEST(VmsUtilsTest, invalidMessageType) { TEST(VmsUtilsTest, parseDataMessage) { const std::string bytes = "aaa"; const VmsLayerAndPublisher layer_and_publisher(VmsLayer(1, 0, 1), 123); auto message = CreateDataMessageWithLayerPublisherInfo(layer_and_publisher, bytes); auto message = createDataMessageWithLayerPublisherInfo(layer_and_publisher, bytes); auto data_str = parseData(*message); ASSERT_FALSE(data_str.empty()); EXPECT_EQ(data_str, bytes); Loading graphics/composer/2.1/utils/hal/include/composer-hal/2.1/Composer.h +5 −6 Original line number Diff line number Diff line Loading @@ -80,7 +80,8 @@ class ComposerImpl : public Interface { Return<void> createClient(IComposer::createClient_cb hidl_cb) override { std::unique_lock<std::mutex> lock(mClientMutex); if (!waitForClientDestroyedLocked(lock)) { bool destroyed = waitForClientDestroyedLocked(lock); if (!destroyed) { hidl_cb(Error::NO_RESOURCES, nullptr); return Void(); } Loading Loading @@ -108,12 +109,10 @@ class ComposerImpl : public Interface { // inverted (create and then destroy). Wait for a brief period to // see if the existing client is destroyed. ALOGD("waiting for previous client to be destroyed"); mClientDestroyedCondition.wait_for( lock, 1s, [this]() -> bool { return mClient.promote() == nullptr; }); if (mClient.promote() != nullptr) { mClientDestroyedCondition.wait_for(lock, 1s, [this]() -> bool { return mClient == nullptr; }); if (mClient != nullptr) { ALOGD("previous client was not destroyed"); } else { mClient.clear(); } } Loading Loading
automotive/vehicle/2.0/default/common/include/vhal_v2_0/VmsUtils.h +1 −1 Original line number Diff line number Diff line Loading @@ -172,7 +172,7 @@ std::unique_ptr<VehiclePropValue> createSubscriptionsRequest(); // should first convert the proto to a byte string (vms_packet) using the // SerializeToString proto API. Then, it use this interface to build the VehicleProperty // by passing publisher and layer information (layer_publisher) and the vms_packet. std::unique_ptr<VehiclePropValue> CreateDataMessageWithLayerPublisherInfo( std::unique_ptr<VehiclePropValue> createDataMessageWithLayerPublisherInfo( const VmsLayerAndPublisher& layer_publisher, const std::string& vms_packet); // Creates a VehiclePropValue containing a message of type Loading
automotive/vehicle/2.0/default/common/src/VmsUtils.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -126,7 +126,7 @@ std::unique_ptr<VehiclePropValue> createSubscriptionsRequest() { return result; } std::unique_ptr<VehiclePropValue> CreateDataMessageWithLayerPublisherInfo( std::unique_ptr<VehiclePropValue> createDataMessageWithLayerPublisherInfo( const VmsLayerAndPublisher& layer_publisher, const std::string& vms_packet) { auto result = createBaseVmsMessage(kMessageTypeSize + kLayerAndPublisherSize); result->value.int32Values = hidl_vec<int32_t>{ Loading
automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h +11 −0 Original line number Diff line number Diff line Loading @@ -240,6 +240,17 @@ const ConfigDeclaration kVehicleProperties[]{ }, .initialValue = {.floatValues = {0.0f}}}, {.config = { .prop = toInt(VehicleProperty::VEHICLE_SPEED_DISPLAY_UNITS), .access = VehiclePropertyAccess::READ_WRITE, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .configArray = {(int)VehicleUnit::METER_PER_SEC, (int)VehicleUnit::MILES_PER_HOUR, (int)VehicleUnit::KILOMETERS_PER_HOUR}, }, .initialValue = {.int32Values = {(int)VehicleUnit::KILOMETERS_PER_HOUR}}}, {.config = { .prop = toInt(VehicleProperty::INFO_DRIVER_SEAT), Loading
automotive/vehicle/2.0/default/tests/VmsUtils_test.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -141,7 +141,7 @@ TEST(VmsUtilsTest, subscriptionsMessage) { TEST(VmsUtilsTest, dataMessage) { const std::string bytes = "aaa"; const VmsLayerAndPublisher layer_and_publisher(VmsLayer(2, 0, 1), 123); auto message = CreateDataMessageWithLayerPublisherInfo(layer_and_publisher, bytes); auto message = createDataMessageWithLayerPublisherInfo(layer_and_publisher, bytes); ASSERT_NE(message, nullptr); EXPECT_TRUE(isValidVmsMessage(*message)); EXPECT_EQ(message->prop, toInt(VehicleProperty::VEHICLE_MAP_SERVICE)); Loading Loading @@ -177,7 +177,7 @@ TEST(VmsUtilsTest, invalidMessageType) { TEST(VmsUtilsTest, parseDataMessage) { const std::string bytes = "aaa"; const VmsLayerAndPublisher layer_and_publisher(VmsLayer(1, 0, 1), 123); auto message = CreateDataMessageWithLayerPublisherInfo(layer_and_publisher, bytes); auto message = createDataMessageWithLayerPublisherInfo(layer_and_publisher, bytes); auto data_str = parseData(*message); ASSERT_FALSE(data_str.empty()); EXPECT_EQ(data_str, bytes); Loading
graphics/composer/2.1/utils/hal/include/composer-hal/2.1/Composer.h +5 −6 Original line number Diff line number Diff line Loading @@ -80,7 +80,8 @@ class ComposerImpl : public Interface { Return<void> createClient(IComposer::createClient_cb hidl_cb) override { std::unique_lock<std::mutex> lock(mClientMutex); if (!waitForClientDestroyedLocked(lock)) { bool destroyed = waitForClientDestroyedLocked(lock); if (!destroyed) { hidl_cb(Error::NO_RESOURCES, nullptr); return Void(); } Loading Loading @@ -108,12 +109,10 @@ class ComposerImpl : public Interface { // inverted (create and then destroy). Wait for a brief period to // see if the existing client is destroyed. ALOGD("waiting for previous client to be destroyed"); mClientDestroyedCondition.wait_for( lock, 1s, [this]() -> bool { return mClient.promote() == nullptr; }); if (mClient.promote() != nullptr) { mClientDestroyedCondition.wait_for(lock, 1s, [this]() -> bool { return mClient == nullptr; }); if (mClient != nullptr) { ALOGD("previous client was not destroyed"); } else { mClient.clear(); } } Loading