Lines Matching refs:hubId
59 bool Contexthub::setOsAppAsDestination(hub_message_t *msg, int hubId) { in setOsAppAsDestination() argument
60 if (!isValidHubId(hubId)) { in setOsAppAsDestination()
63 hubId); in setOsAppAsDestination()
66 msg->app_name = mCachedHubInfo[hubId].osAppName; in setOsAppAsDestination()
88 c.hubId = hubArray[i].hub_id; in getHubs()
120 uint32_t hubId = static_cast<uint32_t>(cookie); in serviceDied() local
121 mContexthub->handleServiceDeath(hubId); in serviceDied()
124 bool Contexthub::isValidHubId(uint32_t hubId) { in isValidHubId() argument
125 if (!mCachedHubInfo.count(hubId)) { in isValidHubId()
126 ALOGW("Hub information not found for hubId %" PRIu32, hubId); in isValidHubId()
133 sp<IContexthubCallback> Contexthub::getCallBackForHubId(uint32_t hubId) { in getCallBackForHubId() argument
134 if (!isValidHubId(hubId)) { in getCallBackForHubId()
137 return mCachedHubInfo[hubId].callback; in getCallBackForHubId()
141 Return<Result> Contexthub::sendMessageToHub(uint32_t hubId, in sendMessageToHub() argument
147 if (!isValidHubId(hubId) || msg.msg.size() > UINT32_MAX) { in sendMessageToHub()
169 if(mContextHubModule->send_message(hubId, &txMsg) != 0) { in sendMessageToHub()
176 Return<Result> Contexthub::reboot(uint32_t hubId) { in reboot() argument
183 if (setOsAppAsDestination(&msg, hubId) == false) { in reboot()
191 if(mContextHubModule->send_message(hubId, &msg) != 0) { in reboot()
198 Return<Result> Contexthub::registerCallback(uint32_t hubId, in registerCallback() argument
206 } else if (!isValidHubId(hubId)) { in registerCallback()
209 } else if (mContextHubModule->subscribe_messages(hubId, in registerCallback()
213 if (mCachedHubInfo[hubId].callback != nullptr) { in registerCallback()
214 ALOGD("Modifying callback for hubId %" PRIu32, hubId); in registerCallback()
215 mCachedHubInfo[hubId].callback->unlinkToDeath(mDeathRecipient); in registerCallback()
218 mCachedHubInfo[hubId].callback = cb; in registerCallback()
220 Return<bool> linkResult = cb->linkToDeath(mDeathRecipient, hubId); in registerCallback()
225 hubId); in registerCallback()
343 void Contexthub::handleServiceDeath(uint32_t hubId) { in handleServiceDeath() argument
344 ALOGI("Callback/service died for hubId %" PRIu32, hubId); in handleServiceDeath()
345 int ret = mContextHubModule->subscribe_messages(hubId, nullptr, nullptr); in handleServiceDeath()
348 hubId, ret); in handleServiceDeath()
350 mCachedHubInfo[hubId].callback.clear(); in handleServiceDeath()
353 int Contexthub::contextHubCb(uint32_t hubId, in contextHubCb() argument
363 if (!obj->isValidHubId(hubId)) { in contextHubCb()
364 ALOGW("Invalid hub Id %" PRIu32, hubId); in contextHubCb()
368 sp<IContexthubCallback> cb = obj->getCallBackForHubId(hubId); in contextHubCb()
397 Return<Result> Contexthub::unloadNanoApp(uint32_t hubId, in unloadNanoApp() argument
410 if (setOsAppAsDestination(&msg, hubId) == false) { in unloadNanoApp()
421 if(mContextHubModule->send_message(hubId, &msg) != 0) { in unloadNanoApp()
430 Return<Result> Contexthub::loadNanoApp(uint32_t hubId, in loadNanoApp() argument
443 if (setOsAppAsDestination(&hubMsg, hubId) == false) { in loadNanoApp()
471 if (mContextHubModule->send_message(hubId, &hubMsg) != 0) { in loadNanoApp()
480 Return<Result> Contexthub::enableNanoApp(uint32_t hubId, in enableNanoApp() argument
493 if (setOsAppAsDestination(&msg, hubId) == false) { in enableNanoApp()
504 if(mContextHubModule->send_message(hubId, &msg) != 0) { in enableNanoApp()
513 Return<Result> Contexthub::disableNanoApp(uint32_t hubId, in disableNanoApp() argument
526 if (setOsAppAsDestination(&msg, hubId) == false) { in disableNanoApp()
537 if(mContextHubModule->send_message(hubId, &msg) != 0) { in disableNanoApp()
546 Return<Result> Contexthub::queryApps(uint32_t hubId) { in queryApps() argument
553 if (setOsAppAsDestination(&msg, hubId) == false) { in queryApps()
554 ALOGW("Could not find hubId %" PRIu32, hubId); in queryApps()
564 if(mContextHubModule->send_message(hubId, &msg) != 0) { in queryApps()