Loading core/java/android/text/Hyphenator.java +9 −5 Original line number Diff line number Diff line Loading @@ -53,11 +53,15 @@ public class Hyphenator { 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 Loading @@ -67,7 +71,7 @@ public class Hyphenator { result = sMap.get(languageOnlyLocale); if (result != null) { sMap.put(locale, result); return result.mNativePtr; return result; } // Fall back to script-only, if available Loading @@ -80,13 +84,13 @@ public class Hyphenator { 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) { Loading core/java/android/text/StaticLayout.java +2 −1 Original line number Diff line number Diff line Loading @@ -341,7 +341,8 @@ public class StaticLayout extends Layout { 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; } } Loading Loading
core/java/android/text/Hyphenator.java +9 −5 Original line number Diff line number Diff line Loading @@ -53,11 +53,15 @@ public class Hyphenator { 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 Loading @@ -67,7 +71,7 @@ public class Hyphenator { result = sMap.get(languageOnlyLocale); if (result != null) { sMap.put(locale, result); return result.mNativePtr; return result; } // Fall back to script-only, if available Loading @@ -80,13 +84,13 @@ public class Hyphenator { 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) { Loading
core/java/android/text/StaticLayout.java +2 −1 Original line number Diff line number Diff line Loading @@ -341,7 +341,8 @@ public class StaticLayout extends Layout { 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; } } Loading