Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d51413ec authored by Ashutosh Joshi's avatar Ashutosh Joshi Committed by android-build-merger
Browse files

Merge \\"Loading NanoApps now works.\\" into nyc-mr1-dev am: 095979b4

am: 820ab55e

Change-Id: Ib92f140990ed577483bcafdbdc87118f2528144e
parents 05f863ea 820ab55e
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -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;
    }
    }
+4 −1
Original line number Original line Diff line number Diff line
@@ -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;
@@ -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);
@@ -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;
            }
            }
        }
        }