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

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

Snap for 4565898 from ea0856ff to pi-release

Change-Id: Id5bda82425928af2c6131e81c54a1302d93e9b47
parents c51089bb ea0856ff
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
#include <functional>
#include <list>

#include <VtsHalHidlTargetTestEnvBase.h>
#include <gtest/gtest.h>

namespace android {
@@ -33,13 +34,13 @@ namespace utility {
 * Avoid destroying static objects after main return.
 * Post main return destruction leads to incorrect gtest timing measurements as
 * well as harder debuging if anything goes wrong during destruction. */
class Environment : public ::testing::Environment {
class Environment : public ::testing::VtsHalHidlTargetTestEnvBase {
   public:
    using TearDownFunc = std::function<void()>;
    void registerTearDown(TearDownFunc&& tearDown) { tearDowns.push_back(std::move(tearDown)); }

   private:
    void TearDown() override {
    void HidlTearDown() override {
        // Call the tear downs in reverse order of insertion
        for (auto& tearDown : tearDowns) {
            tearDown();
+10 −3
Original line number Diff line number Diff line
@@ -88,8 +88,13 @@ using ::android::hardware::audio::common::V2_0::ThreadInfo;

using namespace ::android::hardware::audio::common::test::utility;

class AudioHidlTestEnvironment : public ::Environment {
   public:
    virtual void registerTestServices() override { registerTestService<IDevicesFactory>(); }
};

// Instance to register global tearDown
static Environment* environment;
static AudioHidlTestEnvironment* environment;

class HidlTest : public ::testing::VtsHalHidlTargetTestBase {
   protected:
@@ -109,7 +114,8 @@ class AudioHidlTest : public HidlTest {

        if (devicesFactory == nullptr) {
            environment->registerTearDown([] { devicesFactory.clear(); });
            devicesFactory = ::testing::VtsHalHidlTargetTestBase::getService<IDevicesFactory>();
            devicesFactory = ::testing::VtsHalHidlTargetTestBase::getService<IDevicesFactory>(
                environment->getServiceName<IDevicesFactory>("default"));
        }
        ASSERT_TRUE(devicesFactory != nullptr);
    }
@@ -1265,9 +1271,10 @@ TEST_F(BoolAccessorPrimaryHidlTest, setGetHac) {
//////////////////////////////////////////////////////////////////////////////

int main(int argc, char** argv) {
    environment = new Environment;
    environment = new AudioHidlTestEnvironment;
    ::testing::AddGlobalTestEnvironment(environment);
    ::testing::InitGoogleTest(&argc, argv);
    environment->init(&argc, argv);
    int status = RUN_ALL_TESTS();
    return status;
}
+2 −0
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ hidl_interface {
        "VehiclePropertyChangeMode",
        "VehiclePropertyGroup",
        "VehiclePropertyOperation",
        "VehiclePropertyStatus",
        "VehiclePropertyType",
        "VehicleRadioConstants",
        "VehicleTurnSignal",
@@ -66,6 +67,7 @@ hidl_interface {
        "VmsMessageWithLayerAndPublisherIdIntegerValuesIndex",
        "VmsMessageWithLayerIntegerValuesIndex",
        "VmsOfferingMessageIntegerValuesIndex",
        "VmsPublisherInformationIntegerValuesIndex",
        "VmsSubscriptionsStateIntegerValuesIndex",
        "Wheel",
    ],
+4 −8
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ public:
    }

    void addOrUpdateSubscription(const SubscribeOptions &opts);
    bool isSubscribed(int32_t propId, int32_t areaId, SubscribeFlags flags);
    bool isSubscribed(int32_t propId, SubscribeFlags flags);
    std::vector<int32_t> getSubscribedProperties() const;

private:
@@ -87,8 +87,7 @@ public:
    /**
     * Constructs SubscriptionManager
     *
     * @param onPropertyUnsubscribed - this callback function will be called when there are no
     *                                    more client subscribed to particular property.
     * @param onPropertyUnsubscribed - called when no more clients are subscribed to the property.
     */
    SubscriptionManager(const OnPropertyUnsubscribed& onPropertyUnsubscribed)
            : mOnPropertyUnsubscribed(onPropertyUnsubscribed),
@@ -115,9 +114,7 @@ public:
            const std::vector<recyclable_ptr<VehiclePropValue>>& propValues,
            SubscribeFlags flags) const;

    std::list<sp<HalClient>> getSubscribedClients(int32_t propId,
                                                  int32_t area,
                                                  SubscribeFlags flags) const;
    std::list<sp<HalClient>> getSubscribedClients(int32_t propId, SubscribeFlags flags) const;
    /**
     * If there are no clients subscribed to given properties than callback function provided
     * in the constructor will be called.
@@ -125,7 +122,6 @@ public:
    void unsubscribe(ClientId clientId, int32_t propId);
private:
    std::list<sp<HalClient>> getSubscribedClientsLocked(int32_t propId,
                                                        int32_t area,
                                                        SubscribeFlags flags) const;

    bool updateHalEventSubscriptionLocked(const SubscribeOptions& opts, SubscribeOptions* out);
+1 −4
Original line number Diff line number Diff line
@@ -48,17 +48,14 @@ public:

    /**
     * Subscribe to HAL property events. This method might be called multiple
     * times for the same vehicle property to update subscribed areas or sample
     * rate.
     * times for the same vehicle property to update sample rate.
     *
     * @param property to subscribe
     * @param areas a bitwise vehicle areas or 0 for all supported areas
     * @param sampleRate sample rate in Hz for properties that support sample
     *                   rate, e.g. for properties with
     *                   VehiclePropertyChangeMode::CONTINUOUS
     */
    virtual StatusCode subscribe(int32_t property,
                                 int32_t areas,
                                 float sampleRate) = 0;

    /**
Loading