Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dfc7039d authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5681502 from 8ebd752b to qt-c2f2-release

Change-Id: I596cea6af79311170d3aa6a27114dcd583f257e9
parents eea4e0b4 8ebd752b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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
+1 −1
Original line number Diff line number Diff line
@@ -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>{
+11 −0
Original line number Diff line number Diff line
@@ -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),
+2 −2
Original line number Diff line number Diff line
@@ -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));
@@ -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);
+5 −6
Original line number Diff line number Diff line
@@ -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();
        }
@@ -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