Updates echo service name in VTS Context Hub test
Bug: 383574936
Change-Id: Id683890ee4e8b33ab858fdcd32d3483e4f684fd4
Test: Compile
diff --git a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp
index 02f0653..aa611ce 100644
--- a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp
+++ b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp
@@ -64,6 +64,8 @@
0xb4, 0x8d, 0xc0, 0xb1, 0xcc, 0x64, 0xe1, 0x42};
const String16 kName{"VtsAidlHalContextHubTargetTest"};
+const String16 kEchoServiceName{"android.hardware.contexthub.test.EchoService"};
+
class ContextHubAidl : public testing::TestWithParam<std::tuple<std::string, int32_t>> {
public:
virtual void SetUp() override {
@@ -685,7 +687,7 @@
const EndpointInfo* destinationEndpoint = nullptr;
for (const EndpointInfo& endpoint : endpoints) {
for (const Service& service : endpoint.services) {
- if (service.serviceDescriptor == String16("ECHO")) {
+ if (service.serviceDescriptor == kEchoServiceName) {
destinationEndpoint = &endpoint;
break;
}
@@ -707,7 +709,7 @@
EXPECT_FALSE(contextHub
->openEndpointSession(sessionId, destinationEndpoint->id,
initiatorEndpoint.id,
- /* in_serviceDescriptor= */ String16("ECHO"))
+ /* in_serviceDescriptor= */ kEchoServiceName)
.isOk());
}
@@ -738,7 +740,7 @@
const EndpointInfo* destinationEndpoint = nullptr;
for (const EndpointInfo& endpoint : endpoints) {
for (const Service& service : endpoint.services) {
- if (service.serviceDescriptor == String16("ECHO")) {
+ if (service.serviceDescriptor == kEchoServiceName) {
destinationEndpoint = &endpoint;
break;
}
@@ -761,7 +763,7 @@
ASSERT_TRUE(contextHub
->openEndpointSession(sessionId, destinationEndpoint->id,
initiatorEndpoint.id,
- /* in_serviceDescriptor= */ String16("ECHO"))
+ /* in_serviceDescriptor= */ kEchoServiceName)
.isOk());
cb->getCondVar().wait(lock);
EXPECT_TRUE(cb->wasOnEndpointSessionOpenCompleteCalled());