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

Commit 8c94f54e authored by Greg Kaiser's avatar Greg Kaiser Committed by android-build-merger
Browse files

ContextHubService: Don't double report app loads am: fe6d4f51

am: ca627a8c

Change-Id: Ief0783ce04972f00e7ed3637bf3bf54b78e5c55e
parents 6143907a ca627a8c
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -322,9 +322,16 @@ public class ContextHubService extends IContextHubService.Stub {
        appInfo.setNeededReadMemBytes(PRE_LOADED_APP_MEM_REQ);
        appInfo.setNeededWriteMemBytes(PRE_LOADED_APP_MEM_REQ);

        String action;
        if (mNanoAppHash.containsKey(appInstanceHandle)) {
            action = "Updated";
        } else {
            action = "Added";
        }

        mNanoAppHash.put(appInstanceHandle, appInfo);
        Log.d(TAG, "Added app instance " + appInstanceHandle + " with id " + appId
              + " version " + appVersion);
        Log.d(TAG, action + " app instance " + appInstanceHandle + " with id "
              + appId + " version " + appVersion);

        return 0;
    }
+6 −1
Original line number Diff line number Diff line
@@ -113,7 +113,12 @@ public class NanoAppInstanceInfo {
    }

    /**
     * Set the application version
     * Get the application version
     *
     * NOTE: There is a race condition where shortly after loading, this
     * may return -1 instead of the correct version.
     *
     * TODO(b/30970527): Fix this race condition.
     *
     * @return int - version of the app
     */
+4 −2
Original line number Diff line number Diff line
@@ -357,7 +357,9 @@ static jint add_app_instance(const hub_app_info *appInfo, uint32_t hubHandle,
    app_instance_info_s entry;
    assert(appInfo);

    const char *action = "Updated";
    if (db.appInstances.count(appInstanceHandle) == 0) {
        action = "Added";
        appInstanceHandle = generate_id();
        if (appInstanceHandle < 0) {
            ALOGE("Cannot find resources to add app instance %" PRId32,
@@ -380,8 +382,8 @@ static jint add_app_instance(const hub_app_info *appInfo, uint32_t hubHandle,
                       hubHandle, entry.instanceId, entry.truncName,
                       entry.appInfo.version);

    ALOGW("Added App 0x%" PRIx64 " on hub Handle %" PRId32
          " as appInstance %" PRId32, entry.truncName,
    ALOGW("%s App 0x%" PRIx64 " on hub Handle %" PRId32
          " as appInstance %" PRId32, action, entry.truncName,
          entry.hubHandle, appInstanceHandle);

    return appInstanceHandle;