int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
+int pkgmgrinfo_appinfo_foreach_remote_appcontrol(pkgmgrinfo_appinfo_h handle,
+ pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
+
/**
* @brief
*/
char *operation;
char *uri;
char *mime;
+ char *visibility;
GList *privileges;
} appcontrol_x;
<xs:element ref="packages:subapp"/>
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##any" processContents="lax"/>
</xs:choice>
+ <xs:attribute name="visibility" type="xs:string"/>
+ <xs:anyAttribute namespace="##any" processContents="lax"/>
</xs:complexType>
</xs:element>
<xs:element name="category">
<xs:enumeration value="wgt"/>
</xs:restriction>
</xs:simpleType>
+ <xs:simpleType name="AppControlVisibilityType">
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="local-only"/>
+ <xs:enumeration value="remote-only"/>
+ <xs:enumeration value="both"/>
+ </xs:restriction>
+ </xs:simpleType>
<xs:element name="author">
<xs:complexType mixed="true">
<xs:element ref="packages:mime"/>
<xs:element ref="packages:subapp"/>
</xs:choice>
+ <xs:attribute name="visibility" type="packages:AppControlVisibilityType"/>
</xs:complexType>
</xs:element>
<xs:element name="category">
static int __insert_appcontrol_info(sqlite3 *db, application_x *app)
{
static const char query[] =
- "INSERT INTO package_app_app_control (app_id, app_control) "
- "VALUES (?, ?)";
+ "INSERT INTO package_app_app_control (app_id, app_control,"
+ " visibility) "
+ "VALUES (?, ?, ?)";
int ret;
sqlite3_stmt *stmt;
int idx;
ac->mime : "NULL") : "NULL");
__BIND_TEXT(db, stmt, idx++, app->appid);
__BIND_TEXT(db, stmt, idx++, app_control);
+ __BIND_TEXT(db, stmt, idx++, ac->visibility);
ret = sqlite3_step(stmt);
if (ret != SQLITE_DONE) {
"CREATE TABLE IF NOT EXISTS package_app_app_control (\n" \
" app_id TEXT NOT NULL,\n" \
" app_control TEXT NOT NULL,\n" \
+ " visibility TEXT NOT NULL DEFAULT 'local-only',\n" \
" PRIMARY KEY(app_id,app_control)\n" \
" FOREIGN KEY(app_id)\n" \
" REFERENCES package_app_info(app_id) ON DELETE CASCADE)"
for (tmp = info->app_info->appcontrol; tmp; tmp = tmp->next) {
appcontrol = (appcontrol_x *)tmp->data;
- if (appcontrol == NULL)
+ if (appcontrol == NULL || !strcasecmp(appcontrol->visibility, "remote-only"))
+ continue;
+ ret = appcontrol_func(appcontrol->operation, appcontrol->uri, appcontrol->mime, user_data);
+ if (ret < 0)
+ break;
+ }
+
+ return PMINFO_R_OK;
+}
+
+API int pkgmgrinfo_appinfo_foreach_remote_appcontrol(pkgmgrinfo_appinfo_h handle,
+ pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data)
+{
+ retvm_if(handle == NULL, PMINFO_R_EINVAL, "appinfo handle is NULL");
+ retvm_if(appcontrol_func == NULL, PMINFO_R_EINVAL, "Callback function is NULL");
+ int ret;
+ pkgmgr_appinfo_x *info = (pkgmgr_appinfo_x *)handle;
+ appcontrol_x *appcontrol;
+ GList *tmp;
+
+ if (info->app_info == NULL)
+ return PMINFO_R_ERROR;
+
+ for (tmp = info->app_info->appcontrol; tmp; tmp = tmp->next) {
+ appcontrol = (appcontrol_x *)tmp->data;
+ if (appcontrol == NULL || !strcasecmp(appcontrol->visibility, "local-only"))
continue;
ret = appcontrol_func(appcontrol->operation, appcontrol->uri, appcontrol->mime, user_data);
if (ret < 0)