Loading services/vibratorservice/VibratorManagerHalWrapper.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ constexpr int32_t SINGLE_VIBRATOR_ID = 0; const constexpr char* MISSING_VIBRATOR_MESSAGE_PREFIX = "No vibrator with id="; HalResult<void> LegacyManagerHalWrapper::ping() { auto pingFn = [](std::shared_ptr<HalWrapper> hal) { return hal->ping(); }; auto pingFn = [](HalWrapper* hal) { return hal->ping(); }; return mController->doWithRetry<void>(pingFn, "ping"); } Loading services/vibratorservice/include/vibratorservice/VibratorHalController.h +4 −5 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ namespace vibrator { std::shared_ptr<HalWrapper> connectHal(std::shared_ptr<CallbackScheduler> scheduler); template <typename T> using HalFunction = std::function<T(std::shared_ptr<HalWrapper>)>; using HalFunction = std::function<T(HalWrapper*)>; // Controller for Vibrator HAL handle. // This relies on a given Connector to connect to the underlying Vibrator HAL service and reconnects Loading Loading @@ -64,8 +64,7 @@ public: */ Info getInfo() { static Info sDefaultInfo = InfoCache().get(); return apply<Info>([](std::shared_ptr<HalWrapper> hal) { return hal->getInfo(); }, sDefaultInfo, "getInfo"); return apply<Info>([](HalWrapper* hal) { return hal->getInfo(); }, sDefaultInfo, "getInfo"); } /* Calls given HAL function, applying automatic retries to reconnect with the HAL when the Loading Loading @@ -103,7 +102,7 @@ private: } for (int i = 0; i < MAX_RETRIES; i++) { T result = halFn(hal); T result = halFn(hal.get()); if (result.checkAndLogFailure(functionName)) { tryReconnect(); } else { Loading @@ -111,7 +110,7 @@ private: } } return halFn(hal); return halFn(hal.get()); } }; Loading services/vibratorservice/test/VibratorHalControllerTest.cpp +4 −6 Original line number Diff line number Diff line Loading @@ -40,11 +40,9 @@ using namespace android; using namespace std::chrono_literals; using namespace testing; static const auto ON_FN = [](std::shared_ptr<vibrator::HalWrapper> hal) { return hal->on(10ms, []() {}); }; static const auto OFF_FN = [](std::shared_ptr<vibrator::HalWrapper> hal) { return hal->off(); }; static const auto PING_FN = [](std::shared_ptr<vibrator::HalWrapper> hal) { return hal->ping(); }; static const auto ON_FN = [](vibrator::HalWrapper* hal) { return hal->on(10ms, []() {}); }; static const auto OFF_FN = [](vibrator::HalWrapper* hal) { return hal->off(); }; static const auto PING_FN = [](vibrator::HalWrapper* hal) { return hal->ping(); }; // ------------------------------------------------------------------------------------------------- Loading Loading @@ -233,7 +231,7 @@ TEST_F(VibratorHalControllerTest, TestScheduledCallbackSurvivesReconnection) { std::unique_ptr<int32_t> callbackCounter = std::make_unique<int32_t>(); auto callback = vibrator::TestFactory::createCountingCallback(callbackCounter.get()); auto onFn = [&](std::shared_ptr<vibrator::HalWrapper> hal) { return hal->on(10ms, callback); }; auto onFn = [&](vibrator::HalWrapper* hal) { return hal->on(10ms, callback); }; ASSERT_TRUE(mController->doWithRetry<void>(onFn, "on").isOk()); ASSERT_TRUE(mController->doWithRetry<void>(PING_FN, "ping").isFailed()); mMockHal.reset(); Loading services/vibratorservice/test/VibratorHalWrapperAidlTest.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -644,7 +644,6 @@ TEST_F(VibratorHalWrapperAidlTest, TestPerformPwleEffect) { .Times(Exactly(2)) .WillOnce(Return(Status::fromExceptionCode(Status::Exception::EX_SECURITY))) .WillRepeatedly(DoAll(TriggerCallbackInArg1(), Return(Status()))); ; } std::unique_ptr<int32_t> callbackCounter = std::make_unique<int32_t>(); Loading services/vibratorservice/test/VibratorManagerHalWrapperAidlTest.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ using android::hardware::vibrator::PrimitivePwle; using namespace android; using namespace testing; static const auto OFF_FN = [](std::shared_ptr<vibrator::HalWrapper> hal) { return hal->off(); }; static const auto OFF_FN = [](vibrator::HalWrapper* hal) { return hal->off(); }; class MockBinder : public BBinder { public: Loading Loading
services/vibratorservice/VibratorManagerHalWrapper.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ constexpr int32_t SINGLE_VIBRATOR_ID = 0; const constexpr char* MISSING_VIBRATOR_MESSAGE_PREFIX = "No vibrator with id="; HalResult<void> LegacyManagerHalWrapper::ping() { auto pingFn = [](std::shared_ptr<HalWrapper> hal) { return hal->ping(); }; auto pingFn = [](HalWrapper* hal) { return hal->ping(); }; return mController->doWithRetry<void>(pingFn, "ping"); } Loading
services/vibratorservice/include/vibratorservice/VibratorHalController.h +4 −5 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ namespace vibrator { std::shared_ptr<HalWrapper> connectHal(std::shared_ptr<CallbackScheduler> scheduler); template <typename T> using HalFunction = std::function<T(std::shared_ptr<HalWrapper>)>; using HalFunction = std::function<T(HalWrapper*)>; // Controller for Vibrator HAL handle. // This relies on a given Connector to connect to the underlying Vibrator HAL service and reconnects Loading Loading @@ -64,8 +64,7 @@ public: */ Info getInfo() { static Info sDefaultInfo = InfoCache().get(); return apply<Info>([](std::shared_ptr<HalWrapper> hal) { return hal->getInfo(); }, sDefaultInfo, "getInfo"); return apply<Info>([](HalWrapper* hal) { return hal->getInfo(); }, sDefaultInfo, "getInfo"); } /* Calls given HAL function, applying automatic retries to reconnect with the HAL when the Loading Loading @@ -103,7 +102,7 @@ private: } for (int i = 0; i < MAX_RETRIES; i++) { T result = halFn(hal); T result = halFn(hal.get()); if (result.checkAndLogFailure(functionName)) { tryReconnect(); } else { Loading @@ -111,7 +110,7 @@ private: } } return halFn(hal); return halFn(hal.get()); } }; Loading
services/vibratorservice/test/VibratorHalControllerTest.cpp +4 −6 Original line number Diff line number Diff line Loading @@ -40,11 +40,9 @@ using namespace android; using namespace std::chrono_literals; using namespace testing; static const auto ON_FN = [](std::shared_ptr<vibrator::HalWrapper> hal) { return hal->on(10ms, []() {}); }; static const auto OFF_FN = [](std::shared_ptr<vibrator::HalWrapper> hal) { return hal->off(); }; static const auto PING_FN = [](std::shared_ptr<vibrator::HalWrapper> hal) { return hal->ping(); }; static const auto ON_FN = [](vibrator::HalWrapper* hal) { return hal->on(10ms, []() {}); }; static const auto OFF_FN = [](vibrator::HalWrapper* hal) { return hal->off(); }; static const auto PING_FN = [](vibrator::HalWrapper* hal) { return hal->ping(); }; // ------------------------------------------------------------------------------------------------- Loading Loading @@ -233,7 +231,7 @@ TEST_F(VibratorHalControllerTest, TestScheduledCallbackSurvivesReconnection) { std::unique_ptr<int32_t> callbackCounter = std::make_unique<int32_t>(); auto callback = vibrator::TestFactory::createCountingCallback(callbackCounter.get()); auto onFn = [&](std::shared_ptr<vibrator::HalWrapper> hal) { return hal->on(10ms, callback); }; auto onFn = [&](vibrator::HalWrapper* hal) { return hal->on(10ms, callback); }; ASSERT_TRUE(mController->doWithRetry<void>(onFn, "on").isOk()); ASSERT_TRUE(mController->doWithRetry<void>(PING_FN, "ping").isFailed()); mMockHal.reset(); Loading
services/vibratorservice/test/VibratorHalWrapperAidlTest.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -644,7 +644,6 @@ TEST_F(VibratorHalWrapperAidlTest, TestPerformPwleEffect) { .Times(Exactly(2)) .WillOnce(Return(Status::fromExceptionCode(Status::Exception::EX_SECURITY))) .WillRepeatedly(DoAll(TriggerCallbackInArg1(), Return(Status()))); ; } std::unique_ptr<int32_t> callbackCounter = std::make_unique<int32_t>(); Loading
services/vibratorservice/test/VibratorManagerHalWrapperAidlTest.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ using android::hardware::vibrator::PrimitivePwle; using namespace android; using namespace testing; static const auto OFF_FN = [](std::shared_ptr<vibrator::HalWrapper> hal) { return hal->off(); }; static const auto OFF_FN = [](vibrator::HalWrapper* hal) { return hal->off(); }; class MockBinder : public BBinder { public: Loading