From 0445fdf321e74044dc9f3719922fc8ff4923fdf4 Mon Sep 17 00:00:00 2001 From: Yohei Yukawa Date: Wed, 20 Jan 2016 21:09:33 -0800 Subject: [PATCH] Ensure EditorInfo#locales is set before return. This is a follow up CL for the previous CL [1], which mistakenly put the initialization code of EditorInfo#locales after return statement. [1]: I77db5b99a7cf745d800db75baf135bb60ad04820 8d6eeb01df72891acd3aa75e64aa1595a41cc96e With this CL, the IME starts receiving correctly initialized LocaleList as expected. Bug: 22859862 Change-Id: I738ffaaf07091d8b980f8bfc6e16227fcb85a96a --- core/java/android/widget/TextView.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index d46c6f92b762..81ebdb3bd3ff 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -6440,6 +6440,9 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener outAttrs.imeOptions |= EditorInfo.IME_FLAG_NO_ENTER_ACTION; } outAttrs.hintText = mHint; + // LocaleList is designed to be immutable. This is theoretically equivalent to copy + // the snapshot of the current text locales. + outAttrs.locales = getTextLocales(); if (mText instanceof Editable) { InputConnection ic = new EditableInputConnection(this); outAttrs.initialSelStart = getSelectionStart(); @@ -6447,9 +6450,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener outAttrs.initialCapsMode = ic.getCursorCapsMode(getInputType()); return ic; } - // LocaleList is designed to be immutable. This is theoretically equivalent to copy - // the snapshot of the current text locales. - outAttrs.locales = getTextLocales(); } return null; } -- 2.11.0