diff options
| author | Ashutosh Joshi <ashutoshj@google.com> | 2016-07-15 22:12:41 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2016-07-15 22:12:42 +0000 |
| commit | 095979b46366fcb176215e448bcb59074fa97c0e (patch) | |
| tree | 644971a2f9ecb3e5c844fe6f183ed76ce680a918 | |
| parent | 8b9015899d355a93f594a54d454e9fa50465fd4f (diff) | |
| parent | 118644056f3c442f0aa9451aaeac8e8b35dde3f8 (diff) | |
Merge "Loading NanoApps now works." into nyc-mr1-dev
| -rw-r--r-- | core/java/android/hardware/location/ContextHubService.java | 5 | ||||
| -rw-r--r-- | core/jni/android_hardware_location_ContextHubService.cpp | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/core/java/android/hardware/location/ContextHubService.java b/core/java/android/hardware/location/ContextHubService.java index fcbc962f0743..062c9580c1e4 100644 --- a/core/java/android/hardware/location/ContextHubService.java +++ b/core/java/android/hardware/location/ContextHubService.java @@ -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_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; } + // Do not add an entry to mNanoAppInstance Hash yet. The HAL may reject the app return 0; } diff --git a/core/jni/android_hardware_location_ContextHubService.cpp b/core/jni/android_hardware_location_ContextHubService.cpp index 46f76de87a2f..9515a0e336aa 100644 --- a/core/jni/android_hardware_location_ContextHubService.cpp +++ b/core/jni/android_hardware_location_ContextHubService.cpp @@ -423,7 +423,7 @@ static int startLoadAppTxn(uint64_t appId, int hubHandle) { txnInfo->appInfo.num_mem_ranges = 0; txnInfo->appInfo.version = -1; // Awaited - if (!addTxn(CONTEXT_HUB_LOAD_APP, txnInfo)) { + if (addTxn(CONTEXT_HUB_LOAD_APP, txnInfo) != 0) { return_id(instanceId); free(txnInfo); return -1; @@ -726,6 +726,7 @@ static int handle_os_message(uint32_t msgType, uint32_t hubHandle, if (isValidOsStatus(msg, msgLen, &rsp)) { rsp.result = 0; ALOGW("Context Hub handle %d restarted", hubHandle); + closeTxn(); passOnOsResponse(hubHandle, msgType, &rsp, nullptr, 0); invalidateNanoApps(hubHandle); query_hub_for_apps(ALL_APPS, hubHandle); @@ -1012,10 +1013,12 @@ static jint nativeSendMessage(JNIEnv *env, jobject instance, jintArray header_, if (msgType == CONTEXT_HUB_LOAD_APP) { if (startLoadAppTxn(appId, hubHandle) != 0) { + ALOGW("Cannot Start Load Transaction"); return -1; } } else if (msgType == CONTEXT_HUB_UNLOAD_APP) { if (startUnloadAppTxn(appInstanceHandle) != 0) { + ALOGW("Cannot Start UnLoad Transaction"); return -1; } } |
