Lines Matching refs:hubId
56 bool Contexthub::setOsAppAsDestination(hub_message_t *msg, int hubId) { in setOsAppAsDestination() argument
57 if (!isValidHubId(hubId)) { in setOsAppAsDestination()
60 hubId); in setOsAppAsDestination()
63 msg->app_name = mCachedHubInfo[hubId].osAppName; in setOsAppAsDestination()
82 c.hubId = hub->hub_id; in getHubs()
111 uint32_t hubId = static_cast<uint32_t>(cookie); in serviceDied() local
112 mContexthub->handleServiceDeath(hubId); in serviceDied()
115 bool Contexthub::isValidHubId(uint32_t hubId) { in isValidHubId() argument
116 if (!mCachedHubInfo.count(hubId)) { in isValidHubId()
117 ALOGW("Hub information not found for hubId %" PRIu32, hubId); in isValidHubId()
124 sp<IContexthubCallback> Contexthub::getCallBackForHubId(uint32_t hubId) { in getCallBackForHubId() argument
125 if (!isValidHubId(hubId)) { in getCallBackForHubId()
128 return mCachedHubInfo[hubId].callback; in getCallBackForHubId()
132 Return<Result> Contexthub::sendMessageToHub(uint32_t hubId, in sendMessageToHub() argument
134 if (!isValidHubId(hubId) || msg.msg.size() > UINT32_MAX) { in sendMessageToHub()
156 if(NanoHub::sendToNanohub(hubId, &txMsg, 0, msg.hostEndPoint) != 0) { in sendMessageToHub()
163 Return<Result> Contexthub::registerCallback(uint32_t hubId, in registerCallback() argument
167 if (!isValidHubId(hubId)) { in registerCallback()
170 } else if (NanoHub::subscribeMessages(hubId, in registerCallback()
174 if (mCachedHubInfo[hubId].callback != nullptr) { in registerCallback()
175 ALOGD("Modifying callback for hubId %" PRIu32, hubId); in registerCallback()
176 mCachedHubInfo[hubId].callback->unlinkToDeath(mDeathRecipient); in registerCallback()
179 mCachedHubInfo[hubId].callback = cb; in registerCallback()
181 Return<bool> linkResult = cb->linkToDeath(mDeathRecipient, hubId); in registerCallback()
186 hubId); in registerCallback()
305 void Contexthub::handleServiceDeath(uint32_t hubId) { in handleServiceDeath() argument
306 ALOGI("Callback/service died for hubId %" PRIu32, hubId); in handleServiceDeath()
307 int ret = NanoHub::subscribeMessages(hubId, nullptr, nullptr); in handleServiceDeath()
310 hubId, ret); in handleServiceDeath()
312 mCachedHubInfo[hubId].callback.clear(); in handleServiceDeath()
315 int Contexthub::contextHubCb(uint32_t hubId, in contextHubCb() argument
320 if (!obj->isValidHubId(hubId)) { in contextHubCb()
321 ALOGW("Invalid hub Id %" PRIu32, hubId); in contextHubCb()
325 sp<IContexthubCallback> cb = obj->getCallBackForHubId(hubId); in contextHubCb()
355 Return<Result> Contexthub::unloadNanoApp(uint32_t hubId, in unloadNanoApp() argument
364 if (setOsAppAsDestination(&msg, hubId) == false) { in unloadNanoApp()
375 if(NanoHub::sendToNanohub(hubId, in unloadNanoApp()
386 Return<Result> Contexthub::loadNanoApp(uint32_t hubId, in loadNanoApp() argument
395 if (setOsAppAsDestination(&hubMsg, hubId) == false) { in loadNanoApp()
423 if(NanoHub::sendToNanohub(hubId, in loadNanoApp()
434 Return<Result> Contexthub::enableNanoApp(uint32_t hubId, in enableNanoApp() argument
443 if (setOsAppAsDestination(&msg, hubId) == false) { in enableNanoApp()
454 if(NanoHub::sendToNanohub(hubId, in enableNanoApp()
465 Return<Result> Contexthub::disableNanoApp(uint32_t hubId, in disableNanoApp() argument
474 if (setOsAppAsDestination(&msg, hubId) == false) { in disableNanoApp()
485 if(NanoHub::sendToNanohub(hubId, in disableNanoApp()
496 Return<Result> Contexthub::queryApps(uint32_t hubId) { in queryApps() argument
499 if (setOsAppAsDestination(&msg, hubId) == false) { in queryApps()
500 ALOGW("Could not find hubId %" PRIu32, hubId); in queryApps()
510 if(NanoHub::sendToNanohub(hubId, in queryApps()