Loading core/jni/platform/host/HostRuntime.cpp +10 −4 Original line number Diff line number Diff line Loading @@ -280,12 +280,18 @@ static string getJavaProperty(JNIEnv* env, const char* property_name, return string(chars.c_str()); } static void loadIcuData(string icuPath) { static void loadIcuData(JNIEnv* env, string icuPath) { void* addr = mmapFile(icuPath.c_str()); if (addr == nullptr) { jniThrowRuntimeException(env, "Failed to map the ICU data file."); } UErrorCode err = U_ZERO_ERROR; udata_setCommonData(addr, &err); if (err != U_ZERO_ERROR) { ALOGE("Unable to load ICU data\n"); jniThrowRuntimeException(env, format("udata_setCommonData failed with error code {}", u_errorName(err)) .c_str()); } } Loading @@ -296,12 +302,12 @@ static void loadIcuData() { JNIEnv* env = AndroidRuntime::getJNIEnv(); string icuPath = base::GetProperty("ro.icu.data.path", ""); if (!icuPath.empty()) { loadIcuData(icuPath); loadIcuData(env, icuPath); } else { // fallback to read from java.lang.System.getProperty string icuPathFromJava = getJavaProperty(env, "icu.data.path"); if (!icuPathFromJava.empty()) { loadIcuData(icuPathFromJava); loadIcuData(env, icuPathFromJava); } } Loading Loading
core/jni/platform/host/HostRuntime.cpp +10 −4 Original line number Diff line number Diff line Loading @@ -280,12 +280,18 @@ static string getJavaProperty(JNIEnv* env, const char* property_name, return string(chars.c_str()); } static void loadIcuData(string icuPath) { static void loadIcuData(JNIEnv* env, string icuPath) { void* addr = mmapFile(icuPath.c_str()); if (addr == nullptr) { jniThrowRuntimeException(env, "Failed to map the ICU data file."); } UErrorCode err = U_ZERO_ERROR; udata_setCommonData(addr, &err); if (err != U_ZERO_ERROR) { ALOGE("Unable to load ICU data\n"); jniThrowRuntimeException(env, format("udata_setCommonData failed with error code {}", u_errorName(err)) .c_str()); } } Loading @@ -296,12 +302,12 @@ static void loadIcuData() { JNIEnv* env = AndroidRuntime::getJNIEnv(); string icuPath = base::GetProperty("ro.icu.data.path", ""); if (!icuPath.empty()) { loadIcuData(icuPath); loadIcuData(env, icuPath); } else { // fallback to read from java.lang.System.getProperty string icuPathFromJava = getJavaProperty(env, "icu.data.path"); if (!icuPathFromJava.empty()) { loadIcuData(icuPathFromJava); loadIcuData(env, icuPathFromJava); } } Loading