typedef int (*shortcut_list_cb)(const char *package_name, const char *icon, const char *name, const char *extra_key, const char *extra_data, void *user_data);
/**
- * @brief Gets the installed shortcut view list, synchronously.
+ * @brief Gets the list of shortcut elements from the manifest file, synchronously.
* @remarks If a homescreen does not support this feature, you will get a proper error code.\n
* Application must check the return value of this function.\n
* Application must check the return status from the callback function.\n
s_info.server_fd = com_core_packet_client_init(s_info.socket_file, 0, service_table);
if (s_info.server_fd < 0) {
- ErrPrint("Failed to make a connection to the master\n");
- return SHORTCUT_ERROR_COMM;
+ ErrPrint("Failed to make a connection to the master [%d]\n", s_info.client_fd);
+
+ if (s_info.client_fd == SHORTCUT_ERROR_PERMISSION_DENIED)
+ return SHORTCUT_ERROR_PERMISSION_DENIED;
+ else
+ return SHORTCUT_ERROR_COMM;
}
packet = packet_create_noack("service_register", "");
EAPI int shortcut_set_request_cb(shortcut_request_cb request_cb, void *data)
{
+ int ret;
+
if (request_cb == NULL) {
return SHORTCUT_ERROR_INVALID_PARAMETER;
}
s_info.server_cb.data = data;
if (s_info.server_fd < 0) {
- int ret;
+
+ ret = make_connection();
+ if (ret == SHORTCUT_ERROR_NONE || ret == SHORTCUT_ERROR_PERMISSION_DENIED)
+ return ret;
ret = vconf_notify_key_changed(VCONFKEY_MASTER_STARTED, master_started_cb, NULL);
if (ret < 0) {
if (appid) {
free(appid);
}
- if (shortcut_is_master_ready() == 1) {
+ if (s_info.client_fd == SHORTCUT_ERROR_PERMISSION_DENIED)
return SHORTCUT_ERROR_PERMISSION_DENIED;
- }
- else {
+ else
return SHORTCUT_ERROR_COMM;
- }
}
}
s_info.client_fd = com_core_packet_client_init(s_info.socket_file, 0, service_table);
if (s_info.client_fd < 0) {
- err = SHORTCUT_ERROR_COMM;
+ if (s_info.client_fd == SHORTCUT_ERROR_PERMISSION_DENIED)
+ err = SHORTCUT_ERROR_PERMISSION_DENIED;
+ else
+ err = SHORTCUT_ERROR_COMM;
+
goto out;
}
}
ret = db_util_open(s_info.dbfile, &s_info.handle, DB_UTIL_REGISTER_HOOK_METHOD);
if (ret != SQLITE_OK) {
DbgPrint("Failed to open a %s\n", s_info.dbfile);
+ if (ret == SQLITE_PERM)
+ return SHORTCUT_ERROR_PERMISSION_DENIED;
return SHORTCUT_ERROR_IO_ERROR;
}
}
if (!s_info.db_opened) {
- s_info.db_opened = (open_db() == 0);
- }
-
- if (!s_info.db_opened) {
- ErrPrint("Failed to open a DB\n");
- return SHORTCUT_ERROR_IO_ERROR;
+ ret = open_db();
+ if (ret != SHORTCUT_ERROR_NONE) {
+ ErrPrint("Failed to open a DB\n");
+ return ret;
+ }
+ s_info.db_opened = 1;
}
language = cur_locale();