Loading core/java/android/hardware/location/ContextHubService.java +9 −2 Original line number Diff line number Diff line Loading @@ -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; } Loading core/java/android/hardware/location/NanoAppInstanceInfo.java +6 −1 Original line number Diff line number Diff line Loading @@ -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 */ Loading core/jni/android_hardware_location_ContextHubService.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -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, Loading @@ -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; Loading Loading
core/java/android/hardware/location/ContextHubService.java +9 −2 Original line number Diff line number Diff line Loading @@ -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; } Loading
core/java/android/hardware/location/NanoAppInstanceInfo.java +6 −1 Original line number Diff line number Diff line Loading @@ -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 */ Loading
core/jni/android_hardware_location_ContextHubService.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -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, Loading @@ -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; Loading