summaryrefslogtreecommitdiffstats
path: root/luni/src
diff options
context:
space:
mode:
authorNeil Fuller <nfuller@google.com>2015-06-01 17:12:38 +0100
committerNeil Fuller <nfuller@google.com>2015-06-03 16:04:40 +0100
commitd2a3075106f700f229750c228de989b789b7dacd (patch)
tree7e7708e81d8538ba6007d84200984fe723db3e16 /luni/src
parente9fbfba8affa05b7ed129da51f789985a1d379d0 (diff)
downloadlibcore-d2a3075106f700f229750c228de989b789b7dacd.zip
libcore-d2a3075106f700f229750c228de989b789b7dacd.tar.gz
libcore-d2a3075106f700f229750c228de989b789b7dacd.tar.bz2
Configure ICU4C without relying on build-time flags
The presence of the build-time flags appears to cause ICU4C to open the .dat file again as a fallback if it fails to find a config value. This is even though the .dat file is explicitly mapped using udata_setCommonData(). Bug: 19960867 Bug: 19961406 (cherry-picked from commit 79fdcc64ea2d9234f258dac57f04b1017a573311) Change-Id: I03f0f2d661dd2de2b0db085519159f7deb60816d
Diffstat (limited to 'luni/src')
-rw-r--r--luni/src/main/native/libcore_icu_ICU.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/luni/src/main/native/libcore_icu_ICU.cpp b/luni/src/main/native/libcore_icu_ICU.cpp
index 0e744b7..d092978 100644
--- a/luni/src/main/native/libcore_icu_ICU.cpp
+++ b/luni/src/main/native/libcore_icu_ICU.cpp
@@ -890,9 +890,14 @@ void register_libcore_icu_ICU(JNIEnv* env) {
}
// Use the ICU data files that shipped with the device for everything else.
+ const char* systemPathPrefix = getenv("ANDROID_ROOT");
+ if (systemPathPrefix == NULL) {
+ ALOGE("ANDROID_ROOT environment variable not set"); \
+ abort();
+ }
std::string systemPath;
- systemPath = u_getDataDirectory();
- systemPath += "/";
+ systemPath = systemPathPrefix;
+ systemPath += "/usr/icu/";
systemPath += U_ICUDATA_NAME;
systemPath += ".dat";