#include <errno.h>
#include <unistd.h>
#include <unique_ptr.h>
+#include <vconf.h>
#include <FBaseErrorDefine.h>
#include <FIoFile.h>
}
bool
-InstallerUtil::CreateSymlink(const String& oldPath, const String& newPath)
+InstallerUtil::CreateSymlink(const String& oldPath, const String& newPath, bool SmackLabelToRealPath)
{
int err = -1;
bool res = false;
SmackManager smackManager;
String label("_");
- smackManager.AddLabelDir(label, newPath);
+
+ if (SmackLabelToRealPath == true)
+ {
+ smackManager.AddLabelDir(label, newPath);
+ }
+ else
+ {
+ smackManager.AddLabelSymlink(label, newPath);
+ }
AppLog("CreateSymlink(): [%ls] -> [%ls]", newPath.GetPointer(), oldPath.GetPointer());
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;
+}