diff --git a/core/jni/Android.mk b/core/jni/Android.mk index 97744eac2d662..d17a0aea8b922 100644 --- a/core/jni/Android.mk +++ b/core/jni/Android.mk @@ -18,6 +18,8 @@ endif LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES +LOCAL_CFLAGS += -DU_USING_ICU_NAMESPACE=0 + LOCAL_SRC_FILES:= \ AndroidRuntime.cpp \ com_android_internal_content_NativeLibraryHelper.cpp \ diff --git a/core/jni/android_text_StaticLayout.cpp b/core/jni/android_text_StaticLayout.cpp index a6f19b13b08c1..e5ae14770c23f 100644 --- a/core/jni/android_text_StaticLayout.cpp +++ b/core/jni/android_text_StaticLayout.cpp @@ -48,10 +48,10 @@ class Builder { delete mBreakIterator; } - void setLocale(const Locale& locale) { + void setLocale(const icu::Locale& locale) { delete mBreakIterator; UErrorCode status = U_ZERO_ERROR; - mBreakIterator = BreakIterator::createLineInstance(locale, status); + mBreakIterator = icu::BreakIterator::createLineInstance(locale, status); // TODO: check status } @@ -77,13 +77,13 @@ class Builder { } } - BreakIterator* breakIterator() const { + icu::BreakIterator* breakIterator() const { return mBreakIterator; } private: const size_t MAX_TEXT_BUF_RETAIN = 32678; - BreakIterator* mBreakIterator = nullptr; + icu::BreakIterator* mBreakIterator = nullptr; UText mUText = UTEXT_INITIALIZER; std::vectormTextBuf; }; @@ -560,9 +560,9 @@ static jint nComputeLineBreaks(JNIEnv* env, jclass, jlong nativePtr, // TODO: this array access is pretty inefficient, but we'll replace it anyway ScopedFloatArrayRO widthsScopedArr(env, widths); - BreakIterator* breakIterator = b->breakIterator(); + icu::BreakIterator* breakIterator = b->breakIterator(); int loc = breakIterator->first(); - while ((loc = breakIterator->next()) != BreakIterator::DONE) { + while ((loc = breakIterator->next()) != icu::BreakIterator::DONE) { breaks.push_back(loc); }