for(; item != NULL; item = item->next)
{
if(safeStrCmp(item->app_name, app_name) == 0)
- return item->app_name;
+ //return item->app_name;
+ return item->pkg_name;
}
return NULL;
}
-//ail_cb_ret_e __get_appinfo_cb(const ail_appinfo_h appinfo, void *user_data)
int __get_appinfo_cb(pkgmgrinfo_appinfo_h appinfo, void *user_data)
{
SETTING_TRACE_BEGIN;
openlock_appdata *item = lockapp_data;
openlock_appdata *new_item = NULL;
- char *pkg_name = NULL;
char *app_name = NULL;
char *app_id = NULL;
- ail_appinfo_h ai;
+ ail_appinfo_h handle;
int ret = 0;
- //ret = pkgmgrinfo_appinfo_get_pkgname(appinfo, &pkg_name);
ret = pkgmgrinfo_appinfo_get_appid(appinfo, &app_id);
-
- //ail_appinfo_get_str(appinfo, AIL_PROP_PACKAGE_STR, &pkg_name);
- //ail_appinfo_get_str(appinfo, AIL_PROP_NAME_STR, &app_name);
if(ret != 0 || !app_id)
{
SETTING_TRACE_DEBUG("pkgmgrinfo_appinfo_get_appid returns error");
return -1;
}
- ret = ail_get_appinfo(app_id, &ai);
+ ret = ail_get_appinfo(app_id, &handle);
if(ret != AIL_ERROR_OK)
{
SETTING_TRACE_DEBUG("ail_get_appinfo() returns error");
return -1;
}
- ail_appinfo_get_str(appinfo, AIL_PROP_NAME_STR, &app_name);
- ail_appinfo_get_str(appinfo, AIL_PROP_PACKAGE_STR, &pkg_name);
+ ail_appinfo_get_str(handle, AIL_PROP_NAME_STR, &app_name);
- if(!app_name || !pkg_name)
+ if(!app_name)
{
SETTING_TRACE_DEBUG("ail_appinfo_get_str() returns error");
- ail_destroy_appinfo(ai);
+ ail_destroy_appinfo(handle);
return -1;
}
SETTING_TRACE_DEBUG("app_name %s", app_name);
- SETTING_TRACE_DEBUG("pkg_name %s", pkg_name);
-
+ SETTING_TRACE_DEBUG("app_id %s", app_id);// format : 1234567890.AppName
+
+
while(item->next != NULL)
item = item->next;
{
SETTING_TRACE_DEBUG("first app");
/* first app */
- item->pkg_name = (char*)strdup(pkg_name);
- item->app_name = (char*)strdup(app_name);
+ item->app_name = (char*)strdup(app_name); // for display
+ item->pkg_name = (char*)strdup(app_id); // for vconf
- if(!pkg_name && !app_name)
+ if(!app_id && !app_name)
SETTING_TRACE_DEBUG("app info %d %s %s", item->index, item->pkg_name, item->app_name);
}
else
if(new_item != NULL)
{
memset(new_item, 0x00, sizeof(openlock_appdata));
- new_item->pkg_name = (char*)strdup(pkg_name);
- new_item->app_name = (char*)strdup(app_name);
+ new_item->app_name = (char*)strdup(app_name); // for display
+ new_item->pkg_name = (char*)strdup(app_id); // for vconf
new_item->index = item->index + 1;
new_item->prev = item;
item->next = new_item;
- if(!pkg_name && !app_name)
+ if(!app_id && !app_name)
SETTING_TRACE_DEBUG("app info %d %s %s", new_item->index, new_item->pkg_name, new_item->app_name);
}
else
SETTING_TRACE_DEBUG("malloc() failed");
}
}
- return 0; //AIL_CB_RET_CONTINUE;
+ return 0;
}
static int __add_3rd_party_lock(void *data)
SettingSecurityUG *ad = (SettingSecurityUG *) data;
/* Get info from AIL */
- pkgmgrinfo_appinfo_filter_h filter; //ail_filter_h filter;
- int ret = 0; //ail_error_e ret;
- int count = -1; //int count = 0;
+ pkgmgrinfo_appinfo_filter_h filter;
+ int ret = 0;
+ int count = -1;
- ret = pkgmgrinfo_appinfo_filter_create(&filter); //ret = ail_filter_new(&filter);
- if(ret > 0) //if(ret != AIL_ERROR_OK)
+ ret = pkgmgrinfo_appinfo_filter_create(&filter);
+ if(ret > 0)
{
- SETTING_TRACE_DEBUG("pkgmgrinfo_appinfo_filter_create() failed"); //SETTING_TRACE_DEBUG("ail_filter_new() failed");
+ SETTING_TRACE_DEBUG("pkgmgrinfo_appinfo_filter_create() failed");
return;
}
ret = pkgmgrinfo_appinfo_filter_add_string(filter, PMINFO_APPINFO_PROP_APP_CATEGORY, "http://tizen.org/category/lockapp");
- //ret = ail_filter_add_str(filter, AIL_PROP_CATEGORIES_STR, "lockscreen");
- ret = pkgmgrinfo_appinfo_filter_count(filter, &count); ////ret = ail_filter_count_appinfo(filter, &count);
+ ret = pkgmgrinfo_appinfo_filter_count(filter, &count);
SETTING_TRACE_DEBUG("There is/are %d 3rd lock app(s)", count);
if(count <= 0)
{
SETTING_TRACE_DEBUG("No 3rd lock app");
- pkgmgrinfo_appinfo_filter_destroy(filter); //ail_filter_destroy(filter);
+ pkgmgrinfo_appinfo_filter_destroy(filter);
return;
}
lockapp_data->app_name = NULL;
lockapp_data->index = 0;
- pkgmgrinfo_appinfo_filter_foreach_appinfo(filter, __get_appinfo_cb, NULL); //ail_filter_list_appinfo_foreach(filter, __get_appinfo_cb, ad);
- pkgmgrinfo_appinfo_filter_destroy(filter); //ail_filter_destroy(filter);
+ pkgmgrinfo_appinfo_filter_foreach_appinfo(filter, __get_appinfo_cb, NULL);
+ pkgmgrinfo_appinfo_filter_destroy(filter);
/* Add to genlist */
openlock_appdata *list = lockapp_data;
SETTING_TRACE_END;
}
+
+/**
+ * create the lock type list
+ */
void __add_locktype_items(void *data)
{
SETTING_TRACE_BEGIN;
//evas_object_smart_callback_add(ad->sl_scroller, "realized", __gl_realized_cb, NULL);
+ // [FLOW] add default lock type
/* to do : radio menu */
/* 1) swipe */
ad->data_locktype_swipe =
SETTING_TRACE_ERROR("item_data is NULL");
}
- /* Add 3rd party lock apps in list. */
+ /* [FLOW] Add 3rd party lock apps in list. */
index = __add_3rd_party_lock(ad);
/* update info */
{
char *open_lock_name = NULL;
open_lock_name = vconf_get_str(VCONFKEY_SETAPPL_3RD_LOCK_PKG_NAME_STR);
- index = __get_index_of_lockapp(open_lock_name);
+ //index = __get_index_of_lockapp(open_lock_name); // <-- symbol mismatch ?
+ index = __get_lockapp_index_from_pkgname(open_lock_name);
if(open_lock_name)
FREE(open_lock_name);
**
****************************************************/
+/**
+ * select each item of the list
+ */
static void
setting_security_locktype_mouse_up_Gendial_list_cb(void *data, Evas_Object *obj,
void *event_info)
vconf_set_int(VCONFKEY_SETAPPL_SCREEN_LOCK_TYPE_INT, lock_type);
/* set radio */
elm_radio_value_set(list_item->eo_check, lock_type + index);
+ ug_destroy_me(ad->ug);
break;
default:
break;