return 0;
}
+static int __insert_package_privilege_info(sqlite3 *db, manifest_x *mfx)
+{
+ static const char query[] =
+ "INSERT INTO package_privilege_info (package, privilege, type) "
+ "VALUES (?, ?, ?)";
+ int ret;
+ sqlite3_stmt *stmt;
+ int idx;
+ GList *tmp;
+ privilege_x *priv;
+
+ ret = sqlite3_prepare_v2(db, query, strlen(query), &stmt, NULL);
+ if (ret != SQLITE_OK) {
+ _LOGE("prepare failed: %s", sqlite3_errmsg(db));
+ return -1;
+ }
+
+ for (tmp = mfx->privileges; tmp; tmp = tmp->next) {
+ priv = (privilege_x *)tmp->data;
+ if (priv == NULL)
+ continue;
+
+ idx = 1;
+ __BIND_TEXT(db, stmt, idx++, mfx->package);
+ __BIND_TEXT(db, stmt, idx++, priv->value);
+ __BIND_TEXT(db, stmt, idx++, priv->type);
+
+ ret = sqlite3_step(stmt);
+ if (ret != SQLITE_DONE) {
+ _LOGE("step failed: %s", sqlite3_errmsg(db));
+ sqlite3_finalize(stmt);
+ return -1;
+ }
+ sqlite3_reset(stmt);
+ }
+
+ sqlite3_finalize(stmt);
+
+ return 0;
+}
+
/* _PRODUCT_LAUNCHING_ENHANCED_
* app->indicatordisplay, app->portraitimg, app->landscapeimg,
* app->guestmode_appstatus
return -1;
if (__insert_application_info(db, mfx))
return -1;
+ if (__insert_package_privilege_info(db, mfx))
+ return -1;
return 0;
}
return -1;
}
+ sqlite3_finalize(stmt);
+
return 0;
}