Apply ICULoadDisable option (#386)
author이형주/Common Platform Lab(SR)/삼성전자 <leee.lee@samsung.com>
Fri, 18 Feb 2022 02:24:17 +0000 (11:24 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Fri, 18 Feb 2022 02:24:17 +0000 (11:24 +0900)
Apply ICULoadDisable option for apps that run during cold boot

Co-authored-by: 김종민/S/W Platform Lab(VD)/Engineer/삼성전자 <jong-min.kim@samsung.com>
NativeLauncher/launcher/exec/launcher.cc

index c98d766..c2fa7a9 100644 (file)
@@ -40,6 +40,8 @@ static std::string StandaloneOption("--standalone");
 static std::string PaddingOption("--PADDING_TO_CHANGE_CMDLINE_PADDING_TO_CHANGE_CMDLINE_PADDING_TO_CHANGE_CMDLINE_PADDING_TO_CHANGE_CMDLINE");
 static std::string AppTypeOption("--appType");
 static std::string ProfileOption("--profile");
+static std::string GlobalizationInvariantOption("--invariant");
+static std::string GlobalizationInvariantOption2("ICULoadDisable");
 
 int main(int argc, char *argv[])
 {
@@ -49,7 +51,7 @@ int main(int argc, char *argv[])
        char* standalonePath = nullptr;
        bool paddingExist = false;
        bool profile = false;
-       const char* appType = NULL;
+       const char* appType = "dotnet";
        const char* appRootPath = NULL;
        char appId[APPID_MAX_LENGTH] = {0,};
 
@@ -57,7 +59,11 @@ int main(int argc, char *argv[])
 
        // start index 1 to avoid passing executable name "dotnet-launcher" as a parameter
        for (int i = 1; i < argc; i++) {
-               if (StandaloneOption.compare(argv[i]) == 0) {
+
+               if (GlobalizationInvariantOption.compare(argv[i]) == 0 || GlobalizationInvariantOption2.compare(argv[i]) == 0) {
+                       setenv("DOTNET_SYSTEM_GLOBALIZATION_INVARIANT", "1", 1);
+                       i++;
+               } else if (StandaloneOption.compare(argv[i]) == 0) {
                        if (i > argc - 1) {
                                _ERR("Assembly path must be after \"--standalone\" option");
                                return -1;
@@ -80,10 +86,6 @@ int main(int argc, char *argv[])
                }
        }
 
-       if (appType == NULL) {
-               appType = "dotnet";
-       }
-
        // get app ID and app root path
        if (AUL_R_OK == aul_app_get_appid_bypid(getpid(), appId, sizeof(appId))) {
                _INFO("AUL_APPID : %s", appId);