Lines Matching refs:hubId
55 bool Contexthub::setOsAppAsDestination(hub_message_t *msg, int hubId) { in setOsAppAsDestination() argument
56 if (!isValidHubId(hubId)) { in setOsAppAsDestination()
59 hubId); in setOsAppAsDestination()
62 msg->app_name = mCachedHubInfo[hubId].osAppName; in setOsAppAsDestination()
81 c.hubId = hub->hub_id; in getHubs()
110 uint32_t hubId = static_cast<uint32_t>(cookie); in serviceDied() local
111 mContexthub->handleServiceDeath(hubId); in serviceDied()
114 bool Contexthub::isValidHubId(uint32_t hubId) { in isValidHubId() argument
115 if (!mCachedHubInfo.count(hubId)) { in isValidHubId()
116 ALOGW("Hub information not found for hubId %" PRIu32, hubId); in isValidHubId()
123 sp<IContexthubCallback> Contexthub::getCallBackForHubId(uint32_t hubId) { in getCallBackForHubId() argument
124 if (!isValidHubId(hubId)) { in getCallBackForHubId()
127 return mCachedHubInfo[hubId].callback; in getCallBackForHubId()
131 Return<Result> Contexthub::sendMessageToHub(uint32_t hubId, in sendMessageToHub() argument
133 if (!isValidHubId(hubId) || msg.msg.size() > UINT32_MAX) { in sendMessageToHub()
155 if(NanoHub::sendToNanohub(hubId, &txMsg, 0, msg.hostEndPoint) != 0) { in sendMessageToHub()
162 Return<Result> Contexthub::registerCallback(uint32_t hubId, in registerCallback() argument
166 if (!isValidHubId(hubId)) { in registerCallback()
169 } else if (NanoHub::subscribeMessages(hubId, in registerCallback()
173 if (mCachedHubInfo[hubId].callback != nullptr) { in registerCallback()
174 ALOGD("Modifying callback for hubId %" PRIu32, hubId); in registerCallback()
175 mCachedHubInfo[hubId].callback->unlinkToDeath(mDeathRecipient); in registerCallback()
178 mCachedHubInfo[hubId].callback = cb; in registerCallback()
180 Return<bool> linkResult = cb->linkToDeath(mDeathRecipient, hubId); in registerCallback()
185 hubId); in registerCallback()
304 void Contexthub::handleServiceDeath(uint32_t hubId) { in handleServiceDeath() argument
305 ALOGI("Callback/service died for hubId %" PRIu32, hubId); in handleServiceDeath()
306 int ret = NanoHub::subscribeMessages(hubId, nullptr, nullptr); in handleServiceDeath()
309 hubId, ret); in handleServiceDeath()
311 mCachedHubInfo[hubId].callback.clear(); in handleServiceDeath()
314 int Contexthub::contextHubCb(uint32_t hubId, in contextHubCb() argument
319 if (!obj->isValidHubId(hubId)) { in contextHubCb()
320 ALOGW("Invalid hub Id %" PRIu32, hubId); in contextHubCb()
324 sp<IContexthubCallback> cb = obj->getCallBackForHubId(hubId); in contextHubCb()
354 Return<Result> Contexthub::unloadNanoApp(uint32_t hubId, in unloadNanoApp() argument
363 if (setOsAppAsDestination(&msg, hubId) == false) { in unloadNanoApp()
374 if(NanoHub::sendToNanohub(hubId, in unloadNanoApp()
385 Return<Result> Contexthub::loadNanoApp(uint32_t hubId, in loadNanoApp() argument
394 if (setOsAppAsDestination(&hubMsg, hubId) == false) { in loadNanoApp()
422 if(NanoHub::sendToNanohub(hubId, in loadNanoApp()
433 Return<Result> Contexthub::enableNanoApp(uint32_t hubId, in enableNanoApp() argument
442 if (setOsAppAsDestination(&msg, hubId) == false) { in enableNanoApp()
453 if(NanoHub::sendToNanohub(hubId, in enableNanoApp()
464 Return<Result> Contexthub::disableNanoApp(uint32_t hubId, in disableNanoApp() argument
473 if (setOsAppAsDestination(&msg, hubId) == false) { in disableNanoApp()
484 if(NanoHub::sendToNanohub(hubId, in disableNanoApp()
495 Return<Result> Contexthub::queryApps(uint32_t hubId) { in queryApps() argument
498 if (setOsAppAsDestination(&msg, hubId) == false) { in queryApps()
499 ALOGW("Could not find hubId %" PRIu32, hubId); in queryApps()
509 if(NanoHub::sendToNanohub(hubId, in queryApps()