ContextHubService: Don't double report app loads am: fe6d4f518a
am: ca627a8cc3
Change-Id: Ief0783ce04972f00e7ed3637bf3bf54b78e5c55e
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user