Add an API to get the name of the HAL client
Bug: 315039707
Test: manual test by
1) run VTS context hub test and pass on pixel;
2) call the API in HAL and verify the string name returned.
Change-Id: I6a42482ea5232b8664849821ba4ef63c49484086
diff --git a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp
index e780857..76b25b6 100644
--- a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp
+++ b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp
@@ -49,8 +49,9 @@
using ::android::hardware::contexthub::vts_utils::waitForCallback;
// 6612b522-b717-41c8-b48d-c0b1cc64e142
-const std::array<uint8_t, 16> kUuid = {0x66, 0x12, 0xb5, 0x22, 0xb7, 0x17, 0x41, 0xc8,
- 0xb4, 0x8d, 0xc0, 0xb1, 0xcc, 0x64, 0xe1, 0x42};
+constexpr std::array<uint8_t, 16> kUuid = {0x66, 0x12, 0xb5, 0x22, 0xb7, 0x17, 0x41, 0xc8,
+ 0xb4, 0x8d, 0xc0, 0xb1, 0xcc, 0x64, 0xe1, 0x42};
+const String16 kName{"VtsAidlHalContextHubTargetTest"};
class ContextHubAidl : public testing::TestWithParam<std::tuple<std::string, int32_t>> {
public:
@@ -135,6 +136,11 @@
*out_uuid = kUuid;
return Status::ok();
}
+
+ Status getName(::android::String16* out_name) override {
+ *out_name = kName;
+ return Status::ok();
+ }
};
TEST_P(ContextHubAidl, TestRegisterCallback) {
@@ -171,6 +177,11 @@
return Status::ok();
}
+ Status getName(::android::String16* out_name) override {
+ *out_name = kName;
+ return Status::ok();
+ }
+
std::promise<std::vector<NanoappInfo>> promise;
};
@@ -242,6 +253,11 @@
return Status::ok();
}
+ Status getName(::android::String16* out_name) override {
+ *out_name = kName;
+ return Status::ok();
+ }
+
uint32_t expectedTransactionId = 0;
std::promise<bool> promise;
};