Fixed bug 2795971 IME doesn't appear on touching a text field
Refactoring in CL 55138 added an extra condition to display the IME.
Change-Id: I2a4cc83bb39bd2c87ad3bd75ef234cdbdfdad74f
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index de0a846..17967d9 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -6644,11 +6644,13 @@
final int newSelStart = Selection.getSelectionStart(mText);
final int newSelEnd = Selection.getSelectionEnd(mText);
+ CommitSelectionReceiver csr = null;
if (newSelStart != oldSelStart || newSelEnd != oldSelEnd) {
- CommitSelectionReceiver csr = new CommitSelectionReceiver(
- oldSelStart, oldSelEnd, newSelStart, newSelEnd);
- handled = imm.showSoftInput(this, 0, csr);
+ csr = new CommitSelectionReceiver(oldSelStart, oldSelEnd,
+ newSelStart, newSelEnd);
}
+
+ handled = imm.showSoftInput(this, 0, csr) && (csr != null);
}
}
@@ -7355,9 +7357,9 @@
private ArrayList<TextWatcher> mListeners = null;
// display attributes
- private final TextPaint mTextPaint;
+ private final TextPaint mTextPaint;
private boolean mUserSetTextScaleX;
- private final Paint mHighlightPaint;
+ private final Paint mHighlightPaint;
private int mHighlightColor = 0xFFBBDDFF;
private Layout mLayout;