/* same as pkgmgrinfo_client_new */
return ret;
}
-
-static int __get_pkg_location(const char *pkgid)
-{
- retvm_if(pkgid == NULL, PMINFO_R_OK, "pkginfo handle is NULL");
-
- FILE *fp = NULL;
- char pkg_mmc_path[FILENAME_MAX] = { 0, };
- snprintf(pkg_mmc_path, FILENAME_MAX, "%s%s", PKG_SD_PATH, pkgid);
-
- /*check whether application is in external memory or not */
- fp = fopen(pkg_mmc_path, "r");
- if (fp != NULL) {
- fclose(fp);
- fp = NULL;
- return PMINFO_EXTERNAL_STORAGE;
- }
-
- return PMINFO_INTERNAL_STORAGE;
-}
-
-API int pkgmgrinfo_client_request_enable_external_pkg(char *pkgid)
-{
- DBusConnection *bus;
- DBusMessage *message = NULL;
- DBusMessage *reply = NULL;
-
- retvm_if(pkgid == NULL, PMINFO_R_EINVAL, "pkgid is NULL\n");
-
- if(__get_pkg_location(pkgid) != PMINFO_EXTERNAL_STORAGE)
- return PMINFO_R_OK;
-
- bus = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
- retvm_if(bus == NULL, PMINFO_R_EINVAL, "dbus_bus_get() failed.");
-
- message = dbus_message_new_method_call (SERVICE_NAME, PATH_NAME, INTERFACE_NAME, METHOD_NAME);
- trym_if(message == NULL, "dbus_message_new_method_call() failed.");
-
- dbus_message_append_args(message, DBUS_TYPE_STRING, &pkgid, DBUS_TYPE_INVALID);
-
- reply = dbus_connection_send_with_reply_and_block(bus, message, -1, NULL);
- trym_if(reply == NULL, "connection_send dbus fail");
-
-catch:
- dbus_connection_flush(bus);
- if (message)
- dbus_message_unref(message);
- if (reply)
- dbus_message_unref(reply);
-
- return PMINFO_R_OK;
-}