Merge "Remove TextUtils.join(Iterable<CharSequence>)."
diff --git a/core/java/android/text/Hyphenator.java b/core/java/android/text/Hyphenator.java
index 10a994a..1665c75 100644
--- a/core/java/android/text/Hyphenator.java
+++ b/core/java/android/text/Hyphenator.java
@@ -53,11 +53,15 @@
mNativePtr = nativePtr;
}
- public static long get(@Nullable Locale locale) {
+ public long getNativePtr() {
+ return mNativePtr;
+ }
+
+ public static Hyphenator get(@Nullable Locale locale) {
synchronized (sLock) {
Hyphenator result = sMap.get(locale);
if (result != null) {
- return result.mNativePtr;
+ return result;
}
// TODO: Convert this a proper locale-fallback system
@@ -67,7 +71,7 @@
result = sMap.get(languageOnlyLocale);
if (result != null) {
sMap.put(locale, result);
- return result.mNativePtr;
+ return result;
}
// Fall back to script-only, if available
@@ -80,13 +84,13 @@
result = sMap.get(scriptOnlyLocale);
if (result != null) {
sMap.put(locale, result);
- return result.mNativePtr;
+ return result;
}
}
sMap.put(locale, sEmptyHyphenator); // To remember we found nothing.
}
- return sEmptyHyphenator.mNativePtr;
+ return sEmptyHyphenator;
}
private static Hyphenator loadHyphenator(String languageTag) {
diff --git a/core/java/android/text/StaticLayout.java b/core/java/android/text/StaticLayout.java
index 24fc6f2..79c4a55 100644
--- a/core/java/android/text/StaticLayout.java
+++ b/core/java/android/text/StaticLayout.java
@@ -341,7 +341,8 @@
private void setLocale(Locale locale) {
if (!locale.equals(mLocale)) {
- nSetLocale(mNativePtr, locale.toLanguageTag(), Hyphenator.get(locale));
+ nSetLocale(mNativePtr, locale.toLanguageTag(),
+ Hyphenator.get(locale).getNativePtr());
mLocale = locale;
}
}