Loading core/java/android/hardware/location/ContextHubService.java +4 −1 Original line number Original line Diff line number Diff line Loading @@ -166,9 +166,12 @@ public class ContextHubService extends IContextHubService.Stub { msgHeader[HEADER_FIELD_LOAD_APP_ID_LO] = (int)(appId & 0xFFFFFFFF); msgHeader[HEADER_FIELD_LOAD_APP_ID_LO] = (int)(appId & 0xFFFFFFFF); msgHeader[HEADER_FIELD_LOAD_APP_ID_HI] = (int)((appId >> 32) & 0xFFFFFFFF); msgHeader[HEADER_FIELD_LOAD_APP_ID_HI] = (int)((appId >> 32) & 0xFFFFFFFF); if (nativeSendMessage(msgHeader, app.getAppBinary()) != 0) { int errVal = nativeSendMessage(msgHeader, app.getAppBinary()); if (errVal != 0) { Log.e(TAG, "Send Message returns error" + contextHubHandle); return -1; return -1; } } // Do not add an entry to mNanoAppInstance Hash yet. The HAL may reject the app // Do not add an entry to mNanoAppInstance Hash yet. The HAL may reject the app return 0; return 0; } } Loading core/jni/android_hardware_location_ContextHubService.cpp +4 −1 Original line number Original line Diff line number Diff line Loading @@ -423,7 +423,7 @@ static int startLoadAppTxn(uint64_t appId, int hubHandle) { txnInfo->appInfo.num_mem_ranges = 0; txnInfo->appInfo.num_mem_ranges = 0; txnInfo->appInfo.version = -1; // Awaited txnInfo->appInfo.version = -1; // Awaited if (!addTxn(CONTEXT_HUB_LOAD_APP, txnInfo)) { if (addTxn(CONTEXT_HUB_LOAD_APP, txnInfo) != 0) { return_id(instanceId); return_id(instanceId); free(txnInfo); free(txnInfo); return -1; return -1; Loading Loading @@ -726,6 +726,7 @@ static int handle_os_message(uint32_t msgType, uint32_t hubHandle, if (isValidOsStatus(msg, msgLen, &rsp)) { if (isValidOsStatus(msg, msgLen, &rsp)) { rsp.result = 0; rsp.result = 0; ALOGW("Context Hub handle %d restarted", hubHandle); ALOGW("Context Hub handle %d restarted", hubHandle); closeTxn(); passOnOsResponse(hubHandle, msgType, &rsp, nullptr, 0); passOnOsResponse(hubHandle, msgType, &rsp, nullptr, 0); invalidateNanoApps(hubHandle); invalidateNanoApps(hubHandle); query_hub_for_apps(ALL_APPS, hubHandle); query_hub_for_apps(ALL_APPS, hubHandle); Loading Loading @@ -1012,10 +1013,12 @@ static jint nativeSendMessage(JNIEnv *env, jobject instance, jintArray header_, if (msgType == CONTEXT_HUB_LOAD_APP) { if (msgType == CONTEXT_HUB_LOAD_APP) { if (startLoadAppTxn(appId, hubHandle) != 0) { if (startLoadAppTxn(appId, hubHandle) != 0) { ALOGW("Cannot Start Load Transaction"); return -1; return -1; } } } else if (msgType == CONTEXT_HUB_UNLOAD_APP) { } else if (msgType == CONTEXT_HUB_UNLOAD_APP) { if (startUnloadAppTxn(appInstanceHandle) != 0) { if (startUnloadAppTxn(appInstanceHandle) != 0) { ALOGW("Cannot Start UnLoad Transaction"); return -1; return -1; } } } } Loading Loading
core/java/android/hardware/location/ContextHubService.java +4 −1 Original line number Original line Diff line number Diff line Loading @@ -166,9 +166,12 @@ public class ContextHubService extends IContextHubService.Stub { msgHeader[HEADER_FIELD_LOAD_APP_ID_LO] = (int)(appId & 0xFFFFFFFF); msgHeader[HEADER_FIELD_LOAD_APP_ID_LO] = (int)(appId & 0xFFFFFFFF); msgHeader[HEADER_FIELD_LOAD_APP_ID_HI] = (int)((appId >> 32) & 0xFFFFFFFF); msgHeader[HEADER_FIELD_LOAD_APP_ID_HI] = (int)((appId >> 32) & 0xFFFFFFFF); if (nativeSendMessage(msgHeader, app.getAppBinary()) != 0) { int errVal = nativeSendMessage(msgHeader, app.getAppBinary()); if (errVal != 0) { Log.e(TAG, "Send Message returns error" + contextHubHandle); return -1; return -1; } } // Do not add an entry to mNanoAppInstance Hash yet. The HAL may reject the app // Do not add an entry to mNanoAppInstance Hash yet. The HAL may reject the app return 0; return 0; } } Loading
core/jni/android_hardware_location_ContextHubService.cpp +4 −1 Original line number Original line Diff line number Diff line Loading @@ -423,7 +423,7 @@ static int startLoadAppTxn(uint64_t appId, int hubHandle) { txnInfo->appInfo.num_mem_ranges = 0; txnInfo->appInfo.num_mem_ranges = 0; txnInfo->appInfo.version = -1; // Awaited txnInfo->appInfo.version = -1; // Awaited if (!addTxn(CONTEXT_HUB_LOAD_APP, txnInfo)) { if (addTxn(CONTEXT_HUB_LOAD_APP, txnInfo) != 0) { return_id(instanceId); return_id(instanceId); free(txnInfo); free(txnInfo); return -1; return -1; Loading Loading @@ -726,6 +726,7 @@ static int handle_os_message(uint32_t msgType, uint32_t hubHandle, if (isValidOsStatus(msg, msgLen, &rsp)) { if (isValidOsStatus(msg, msgLen, &rsp)) { rsp.result = 0; rsp.result = 0; ALOGW("Context Hub handle %d restarted", hubHandle); ALOGW("Context Hub handle %d restarted", hubHandle); closeTxn(); passOnOsResponse(hubHandle, msgType, &rsp, nullptr, 0); passOnOsResponse(hubHandle, msgType, &rsp, nullptr, 0); invalidateNanoApps(hubHandle); invalidateNanoApps(hubHandle); query_hub_for_apps(ALL_APPS, hubHandle); query_hub_for_apps(ALL_APPS, hubHandle); Loading Loading @@ -1012,10 +1013,12 @@ static jint nativeSendMessage(JNIEnv *env, jobject instance, jintArray header_, if (msgType == CONTEXT_HUB_LOAD_APP) { if (msgType == CONTEXT_HUB_LOAD_APP) { if (startLoadAppTxn(appId, hubHandle) != 0) { if (startLoadAppTxn(appId, hubHandle) != 0) { ALOGW("Cannot Start Load Transaction"); return -1; return -1; } } } else if (msgType == CONTEXT_HUB_UNLOAD_APP) { } else if (msgType == CONTEXT_HUB_UNLOAD_APP) { if (startUnloadAppTxn(appInstanceHandle) != 0) { if (startUnloadAppTxn(appInstanceHandle) != 0) { ALOGW("Cannot Start UnLoad Transaction"); return -1; return -1; } } } } Loading