OSDN Git Service

Use default argument to getService.
authorTri Vo <trong@google.com>
Tue, 7 Mar 2017 01:02:25 +0000 (17:02 -0800)
committerTri Vo <trong@google.com>
Tue, 7 Mar 2017 01:02:33 +0000 (17:02 -0800)
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

contexthub/1.0/vts/functional/VtsHalContexthubV1_0TargetTest.cpp

index c5eea89..40a05e6 100644 (file)
@@ -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