SettingAppMgr_PkgInfo *pkg = NULL;
/* Public API call will be temporarily substituted with internal API call:*/
/* package_info_installed_storage_type_e storage; */
- pkgmgrinfo_installed_storage storage;
- pkgmgrinfo_pkginfo_h internal_api_handle = NULL;
package_manager_filter_h filter_supports_disable_h = NULL;
package_manager_filter_h filter_is_disabled_h = NULL;
success = false;
goto finish;
}
+ pkg->is_installed_internally = (PACKAGE_INFO_INTERNAL_STORAGE == storage);
*/
/* Above public API call will be substituted by internal one,
* because public one lacks support for the extended SD mode: */
- ret = pkgmgrinfo_pkginfo_get_pkginfo(pkg->id, &internal_api_handle);
- if (PMINFO_R_OK != ret) {
- SETTING_TRACE_ERROR("pkgmgrinfo_pkginfo_get_pkginfo(): %s",
- get_error_message(ret));
- success = false;
- goto finish;
- }
- ret = pkgmgrinfo_pkginfo_get_installed_storage(internal_api_handle,
- &storage);
- if (PMINFO_R_OK != ret) {
- SETTING_TRACE_ERROR("pkgmgrinfo_pkginfo_get_installed_storage(): %s",
- get_error_message(ret));
- pkgmgrinfo_pkginfo_destroy_pkginfo(internal_api_handle);
+
+ if (!appmgr_utils_get_pkg_storage_type(pkg->id,
+ &pkg->is_installed_internally)
+ ) {
success = false;
goto finish;
}
- pkgmgrinfo_pkginfo_destroy_pkginfo(internal_api_handle);
- pkg->is_installed_internally = (PMINFO_INTERNAL_STORAGE == storage);
- /*(PACKAGE_INFO_INTERNAL_STORAGE == storage);*/
-
pkg->is_removable = false;
ret = package_info_is_removable_package(pkg->package_info,
&pkg->is_removable);
const char *key, const char *val,
const void *pmsg, void *data)
{
+ bool package_installed_internally = true;
+ bool sd_card_in_internal_mode = true;
+ char toast_text[256] = {'\0',};
SettingAppMgr *ad = data;
retv_if(!ad, -1);
elm_object_item_disabled_set(ad->move_to_from_sd_item, EINA_FALSE);
elm_genlist_item_update(ad->move_to_from_sd_item);
+ if (0 != safeStrCmp(val, "ok"))
+ return 0;
+
+ if (appmgr_utils_get_pkg_storage_type(pkgid, &package_installed_internally)
+ &&
+ appmgr_utils_SD_card_in_internal_mode(&sd_card_in_internal_mode)
+ ) {
+
+ if (package_installed_internally && sd_card_in_internal_mode)
+ snprintf(toast_text, sizeof(toast_text), "%s %s", pkgid,
+ _("moved to internal storage."));
+ if (package_installed_internally && !sd_card_in_internal_mode)
+ snprintf(toast_text, sizeof(toast_text), "%s %s", pkgid,
+ _("moved to device storage."));
+ if (!package_installed_internally && sd_card_in_internal_mode)
+ snprintf(toast_text, sizeof(toast_text), "%s %s", pkgid,
+ _("moved to Extend SD card."));
+ if (!package_installed_internally && !sd_card_in_internal_mode)
+ snprintf(toast_text, sizeof(toast_text), "%s %s", pkgid,
+ _("moved to SD card."));
+
+ setting_create_toast_popup(toast_text, ad->md.window);
+
+ } else {
+ SETTING_TRACE_ERROR("Can't obtain information on package location");
+ }
+
return 0;
}
return true;
}
+
+bool appmgr_utils_get_pkg_storage_type(const char *pkg_id, bool *internal)
+{
+ int ret = PMINFO_R_OK;
+ pkgmgrinfo_installed_storage storage;
+ pkgmgrinfo_pkginfo_h internal_api_handle = NULL;
+
+ if (!internal)
+ return false;
+
+ ret = pkgmgrinfo_pkginfo_get_pkginfo(pkg_id, &internal_api_handle);
+
+ if (PMINFO_R_OK != ret) {
+ SETTING_TRACE_ERROR("pkgmgrinfo_pkginfo_get_pkginfo(): %s",
+ get_error_message(ret));
+ return false;
+ }
+ ret = pkgmgrinfo_pkginfo_get_installed_storage(internal_api_handle,
+ &storage);
+ if (PMINFO_R_OK != ret) {
+ SETTING_TRACE_ERROR("pkgmgrinfo_pkginfo_get_installed_storage(): %s",
+ get_error_message(ret));
+ pkgmgrinfo_pkginfo_destroy_pkginfo(internal_api_handle);
+ return false;
+ }
+
+ pkgmgrinfo_pkginfo_destroy_pkginfo(internal_api_handle);
+ *internal = (PMINFO_INTERNAL_STORAGE == storage);
+
+ return true;
+}