#include <errno.h>
#include <unistd.h>
#include <unique_ptr.h>
+#include <vconf.h>
#include <FBaseErrorDefine.h>
#include <FIoFile.h>
return res;
}
+
+bool
+InstallerUtil::IsDefaultExternalStorage()
+{
+ int res = 0;
+ int storage = 0;
+ int mmcStatus = VCONFKEY_SYSMAN_MMC_REMOVED;
+
+ res = vconf_get_int("db/setting/default_memory/download", &storage);
+ TryReturn(res == 0, false, "vconf_get_int(db/setting/default_memory/download) failed.");
+
+ AppLog("Storage = [%d]", storage);
+
+ if (storage == 1)
+ {
+ res = vconf_get_int(VCONFKEY_SYSMAN_MMC_STATUS, &mmcStatus);
+ TryReturn(res == 0, false, "vconf_get_int(VCONFKEY_SYSMAN_MMC_STATUS) failed.");
+
+ if ((mmcStatus == VCONFKEY_SYSMAN_MMC_REMOVED) || (mmcStatus == VCONFKEY_SYSMAN_MMC_INSERTED_NOT_MOUNTED))
+ {
+ AppLog("mmcStatus is MMC_REMOVED or NOT_MOUNTED.");
+ }
+ else
+ {
+ AppLog("mmcStatus is MMC_MOUNTED.");
+ return true;
+ }
+ }
+
+ return false;
+}