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

Commit f869c0ce authored by Tri Vo's avatar Tri Vo
Browse files

Use default argument to getService.

Bug: 35769988
Test: vts-tradefed run commandAndExit vts --skip-all-system-status-check
--primary-abi-only --skip-preconditions --module
VtsHalContextHubV1_0Target -l VERBOSE
Change-Id: I3919226a7f0c6f2c5475fcba15f026297f93dcc3
parent ce308019
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -42,8 +42,6 @@ using ::android::hardware::contexthub::V1_0::Result;
using ::android::hardware::contexthub::V1_0::TransactionResult;
using ::android::sp;

#define CONTEXTHUB_SERVICE_NAME "contexthub"

#define ASSERT_OK(result) ASSERT_EQ(result, Result::OK)
#define EXPECT_OK(result) EXPECT_EQ(result, Result::OK)

@@ -80,7 +78,7 @@ std::vector<uint32_t> getHubIds() {
  static std::vector<uint32_t> hubIds;

  if (hubIds.size() == 0) {
    sp<IContexthub> hubApi = ::testing::VtsHalHidlTargetBaseTest::getService<IContexthub>(CONTEXTHUB_SERVICE_NAME);
    sp<IContexthub> hubApi = ::testing::VtsHalHidlTargetBaseTest::getService<IContexthub>();

    if (hubApi != nullptr) {
      for (ContextHub hub : getHubsSync(hubApi)) {
@@ -98,7 +96,7 @@ std::vector<uint32_t> getHubIds() {
class ContexthubHidlTestBase : public ::testing::VtsHalHidlTargetBaseTest {
 public:
  virtual void SetUp() override {
    hubApi = ::testing::VtsHalHidlTargetBaseTest::getService<IContexthub>(CONTEXTHUB_SERVICE_NAME);
    hubApi = ::testing::VtsHalHidlTargetBaseTest::getService<IContexthub>();
    ASSERT_NE(hubApi, nullptr);

    // getHubs() must be called at least once for proper initialization of the