-#ifdef APP2EXT_ENABLE
- ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &pkghandle);
- if (ret < 0) {
- _LOGE("failed to get pkginfo handle");
- ret = RPM_INSTALLER_ERR_PKG_NOT_FOUND;
- goto end;
- }
- ret = pkgmgrinfo_pkginfo_get_installed_storage(pkghandle, &location);
- if (ret < 0) {
- _LOGE("failed to get install location\n");
- pkgmgrinfo_pkginfo_destroy_pkginfo(pkghandle);
- return RPM_INSTALLER_ERR_INTERNAL;
- }
-
- pkgmgrinfo_pkginfo_destroy_pkginfo(pkghandle);
- if (location == PMINFO_EXTERNAL_STORAGE) {
- handle = app2ext_init(APP2EXT_SD_CARD);
- if (handle == NULL) {
- _LOGE("app2ext init failed\n");
- return RPM_INSTALLER_ERR_INTERNAL;
- }
- if ((&(handle->interface) != NULL) && (handle->interface.pre_uninstall != NULL) && (handle->interface.post_uninstall != NULL) &&
- (handle->interface.disable != NULL)){
- ret = handle->interface.disable(pkgid);
- if (ret != APP2EXT_SUCCESS) {
- _LOGE("Unmount ret[%d]", ret);
- }
- ret = app2ext_get_app_location(pkgid);
- if (ret == APP2EXT_INTERNAL_MEM){
- _LOGE("app2xt APP is not in MMC, go internal (%d)\n", ret);
- }
- else {
- ret = handle->interface.pre_uninstall(pkgid);
- if (ret == APP2EXT_ERROR_MMC_STATUS ) {
- _LOGE("app2xt MMC is not here, go internal (%d)\n", ret);
- }else if (ret == APP2EXT_SUCCESS){
- _LOGE("pre uninstall done, go to internal");
- }else {
- _LOGE("app2xt pre uninstall API failed (%d)\n", ret);
- handle->interface.post_uninstall(pkgid);
- app2ext_deinit(handle);
- return RPM_INSTALLER_ERR_INTERNAL;
- }
- }
- }
- }
-#endif