summaryrefslogtreecommitdiff
path: root/contexthub/aidl/default/ContextHub.cpp
diff options
context:
space:
mode:
authorArthur Ishiguro <arthuri@google.com>2021-11-19 00:24:45 +0000
committerArthur Ishiguro <arthuri@google.com>2021-11-22 17:16:12 +0000
commit065a9a5aac1dc35fcb7306e15de208f58b1e93ae (patch)
tree885a8d229f0d669d5752ce5443b3cddc8e96ca2e /contexthub/aidl/default/ContextHub.cpp
parent8824d6c08abf932cea048ea6098e3dcc86a0818b (diff)
Adds additional host info exchanges in Context Hub HAL
Bug: 194287786 Test: Run VTS Change-Id: I5459e44f752cd04bc1bec3b5e99f398be9f4ce11
Diffstat (limited to 'contexthub/aidl/default/ContextHub.cpp')
-rw-r--r--contexthub/aidl/default/ContextHub.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/contexthub/aidl/default/ContextHub.cpp b/contexthub/aidl/default/ContextHub.cpp
index 1fbccc5333..6da690da4f 100644
--- a/contexthub/aidl/default/ContextHub.cpp
+++ b/contexthub/aidl/default/ContextHub.cpp
@@ -111,6 +111,21 @@ namespace contexthub {
return ndk::ScopedAStatus::ok();
}
+::ndk::ScopedAStatus ContextHub::onHostEndpointConnected(const HostEndpointInfo& in_info) {
+ mConnectedHostEndpoints.insert(in_info.hostEndpointId);
+
+ return ndk::ScopedAStatus::ok();
+}
+
+::ndk::ScopedAStatus ContextHub::onHostEndpointDisconnected(char16_t in_hostEndpointId) {
+ if (mConnectedHostEndpoints.count(in_hostEndpointId) > 0) {
+ mConnectedHostEndpoints.erase(in_hostEndpointId);
+ return ndk::ScopedAStatus::ok();
+ } else {
+ return ndk::ScopedAStatus(AStatus_fromExceptionCode(EX_ILLEGAL_ARGUMENT));
+ }
+}
+
} // namespace contexthub
} // namespace hardware
} // namespace android