ContextHubService: Don't change app handle on load
Due to the way this logic was set up, every time we would load a new nanoapp, add_app_instance() would change the nanoapp's handle/"id" in manner that was invisible to closeTxnLoad(), so our JNI cache would use a different handle than what we passed to the Java callback. We remove this unnecessary changing of the handle/"id". Bug:31325144 Change-Id: I8678729f38fb804bc6a128ce9722fd35551fa1c1
This commit is contained in:
@@ -393,16 +393,8 @@ 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,
|
||||
appInstanceHandle);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
const char *action =
|
||||
(db.appInstances.count(appInstanceHandle) == 0) ? "Added" : "Updated";
|
||||
|
||||
entry.appInfo = *appInfo;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user