Merge "Voice input replaces selected text." into gingerbread
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 138aefa..5be52c4 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -6668,10 +6668,7 @@
if (mInputContentType != null) {
mInputContentType.enterDown = false;
}
- hideInsertionPointCursorController();
- if (mSelectionModifierCursorController != null) {
- mSelectionModifierCursorController.hide();
- }
+ hideControllers();
}
startStopMarquee(hasWindowFocus);
@@ -6681,10 +6678,7 @@
protected void onVisibilityChanged(View changedView, int visibility) {
super.onVisibilityChanged(changedView, visibility);
if (visibility != VISIBLE) {
- hideInsertionPointCursorController();
- if (mSelectionModifierCursorController != null) {
- mSelectionModifierCursorController.hide();
- }
+ hideControllers();
}
}
@@ -7643,10 +7637,7 @@
private void stopTextSelectionMode() {
if (mIsInTextSelectionMode) {
Selection.setSelection((Spannable) mText, getSelectionEnd());
- if (mSelectionModifierCursorController != null) {
- mSelectionModifierCursorController.hide();
- }
-
+ hideSelectionModifierCursorController();
mIsInTextSelectionMode = false;
}
}
@@ -8182,9 +8173,15 @@
}
}
+ private void hideSelectionModifierCursorController() {
+ if (mSelectionModifierCursorController != null) {
+ mSelectionModifierCursorController.hide();
+ }
+ }
+
private void hideControllers() {
hideInsertionPointCursorController();
- stopTextSelectionMode();
+ hideSelectionModifierCursorController();
}
private int getOffsetForHorizontal(int line, int x) {