return true;
}
-static void initEnvForSpecialFolder()
+static void setSpecialFolder(storage_directory_e type, const char* key)
{
- int storageId;
int error;
- char *path = NULL;
+ char* path = NULL;
+ static int __storageId = -1;
- error = storage_foreach_device_supported(storage_cb, &storageId);
- if (error != STORAGE_ERROR_NONE) {
- return;
+ if (__storageId < 0) {
+ error = storage_foreach_device_supported(storage_cb, &__storageId);
+ if (error != STORAGE_ERROR_NONE) {
+ return;
+ }
}
- error = storage_get_directory(storageId, STORAGE_DIRECTORY_IMAGES, &path);
+ error = storage_get_directory(__storageId, type, &path);
if (error == STORAGE_ERROR_NONE && path != NULL) {
- setenv("XDG_PICTURES_DIR", const_cast<char *>(path), 1);
+ setenv(key, const_cast<char *>(path), 1);
free(path);
- path = NULL;
}
+}
- error = storage_get_directory(storageId, STORAGE_DIRECTORY_MUSIC, &path);
- if (error == STORAGE_ERROR_NONE && path != NULL) {
- setenv("XDG_MUSIC_DIR", const_cast<char *>(path), 1);
- free(path);
- path = NULL;
+static void initEnvForSpecialFolder()
+{
+ if (getenv("XDG_PICTURES_DIR") == NULL) {
+ setSpecialFolder(STORAGE_DIRECTORY_IMAGES, "XDG_PICTURES_DIR");
}
- error = storage_get_directory(storageId, STORAGE_DIRECTORY_VIDEOS, &path);
- if (error == STORAGE_ERROR_NONE && path != NULL) {
- setenv("XDG_VIDEOS_DIR", const_cast<char *>(path), 1);
- free(path);
- path = NULL;
+ if (getenv("XDG_MUSIC_DIR") == NULL) {
+ setSpecialFolder(STORAGE_DIRECTORY_MUSIC, "XDG_MUSIC_DIR");
+ }
+
+ if (getenv("XDG_VIDEOS_DIR") == NULL) {
+ setSpecialFolder(STORAGE_DIRECTORY_VIDEOS, "XDG_VIDEOS_DIR");
}
}
bool initializeCoreClr(PathManager* pm, const std::string& tpa)
{
+ bool ncdbStartupHook = isNCDBStartupHookProvided();
+
const char *propertyKeys[] = {
"TRUSTED_PLATFORM_ASSEMBLIES",
"APP_PATHS",
"APP_NI_PATHS",
"NATIVE_DLL_SEARCH_DIRECTORIES",
- "AppDomainCompatSwitch"
+ "AppDomainCompatSwitch",
+ ncdbStartupHook ? "STARTUP_HOOKS" : "" // must be the last one
};
const char *propertyValues[] = {
pm->getAppPaths().c_str(),
pm->getAppNIPaths().c_str(),
pm->getNativeDllSearchingPaths().c_str(),
- "UseLatestBehaviorWhenTFMNotSpecified"
+ "UseLatestBehaviorWhenTFMNotSpecified",
+ ncdbStartupHook ? getNCDBStartupHook() : "" // must be the last one
};
std::string selfPath = readSelfPath();
int st = initializeClr(selfPath.c_str(),
"TizenDotnetApp",
- sizeof(propertyKeys) / sizeof(propertyKeys[0]),
+ sizeof(propertyKeys) / sizeof(propertyKeys[0]) - (ncdbStartupHook ? 0 : 1),
propertyKeys,
propertyValues,
&__hostHandle,
if (exist(multiCoreJitProfile)) {
setEnvironmentVariable("COMPlus_MultiCoreJitNoProfileGather", "1");
+ _INFO("Completed loading of profile data for the %s", appId);
} else {
setEnvironmentVariable("COMPlus_MultiCoreJitNoProfileGather", "0");
// stop profiling and write collected data after delay if env value is set.
stopProfileAfterDelay(delay);
}
}
+ _INFO("Create the profile data for the %s", appId);
}
}
free(localDataPath);