int app2sd_usr_on_demand_setup_exit(const char *pkgid, uid_t uid)
{
int ret = APP2EXT_SUCCESS;
- char mmc_path[FILENAME_MAX] = { 0, };
char application_path[FILENAME_MAX] = { 0, };
char loopback_device[FILENAME_MAX] = { 0, };
+#if !defined(TIZEN_FEATURE_APP2SD_DMCRYPT_ENCRYPTION)
+ char mmc_path[FILENAME_MAX] = { 0, };
char *sdpath = NULL;
char *encoded_id = NULL;
- FILE *fp = NULL;
- int mmc_present = 1;
+#endif
/* validate the function parameter recieved */
if (pkgid == NULL) {
_app2sd_kill_running_app(pkgid, uid);
+#ifdef TIZEN_FEATURE_APP2SD_DMCRYPT_ENCRYPTION
+ if (_is_global(uid)) {
+ snprintf(application_path, FILENAME_MAX - 1, "%s/%s",
+ tzplatform_getenv(TZ_SYS_RW_APP), pkgid);
+ } else {
+ tzplatform_set_user(uid);
+ snprintf(application_path, FILENAME_MAX - 1, "%s/%s",
+ tzplatform_getenv(TZ_USER_APP), pkgid);
+ tzplatform_reset_user();
+ }
+#else
/* check whether MMC is present or not */
ret = _app2sd_check_mmc_status(&sdpath);
- if (ret) {
+ if (ret)
_W("MMC not present OR Not ready (%d)", ret);
- mmc_present = 0;
- }
+
snprintf(mmc_path, FILENAME_MAX - 1, "%s", sdpath);
free(sdpath);
if (encoded_id == NULL)
return APP2EXT_ERROR_MEMORY_ALLOC_FAILED;
- /* check app entry is there in sd card or not. */
if (_is_global(uid)) {
snprintf(application_path, FILENAME_MAX - 1, "%s/%s",
tzplatform_getenv(TZ_SYS_RW_APP), pkgid);
tzplatform_reset_user();
}
free(encoded_id);
-
- if (mmc_present) {
- fp = fopen(loopback_device, "r+");
- if (fp == NULL) {
- _E("app entry is not present in SD Card");
- return APP2EXT_ERROR_INVALID_PACKAGE;
- }
- fclose(fp);
- }
+#endif
ret = __app2sd_finalize_device_setup(pkgid, loopback_device,
application_path, uid);