summaryrefslogtreecommitdiff
path: root/contexthub/aidl/default/ContextHub.cpp
diff options
context:
space:
mode:
authorScott Lobdell <slobdell@google.com>2022-01-21 07:03:32 +0000
committerScott Lobdell <slobdell@google.com>2022-01-21 07:15:05 +0000
commit593bdf5548ac6f13053424a655423c0677e7cb2d (patch)
treeebbbe99553ec26ed9088cf6cfef1aec2e5cc2ef0 /contexthub/aidl/default/ContextHub.cpp
parent78c23e4f5f9e8b61b8bace9a2b4cb691073ef906 (diff)
parenta0f5ebdbd3992e7a78517d13f568d9cbcbb71564 (diff)
Merge TP1A.211206.001
Change-Id: I8b3a43021a3328cf6afb4e7e157339d8e214ddbe
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