summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Leon Scroggins <scroggo@google.com> 2010-03-01 11:20:31 -0500
committer Leon Scroggins <scroggo@google.com> 2010-03-01 12:50:12 -0500
commit1be40985283e77d3fc5d98268f9f6453bcc7223e (patch)
treea0b7d5f35a2ea3b3c912e988736e53081ab57d62
parentb4e193991f9efc74978c004bcd9463cc5e85250c (diff)
Make nativeMoveCursorToNextInput return a boolean and use it.
If nativeMoveCursorToNextTextInput does not succeed, do not set the default selection or perform the other actions which assumed that the move worked. Part of fix for http://b/issue?id=2478052 Requires a change to external/webkit.
-rw-r--r--core/java/android/webkit/WebTextView.java19
-rw-r--r--core/java/android/webkit/WebView.java2
2 files changed, 11 insertions, 10 deletions
diff --git a/core/java/android/webkit/WebTextView.java b/core/java/android/webkit/WebTextView.java
index d1ad61fa9bdc..db19bcacc19c 100644
--- a/core/java/android/webkit/WebTextView.java
+++ b/core/java/android/webkit/WebTextView.java
@@ -304,15 +304,16 @@ import java.util.ArrayList;
public void onEditorAction(int actionCode) {
switch (actionCode) {
case EditorInfo.IME_ACTION_NEXT:
- // Since the cursor will no longer be in the same place as the
- // focus, set the focus controller back to inactive
- mWebView.setFocusControllerInactive();
- mWebView.nativeMoveCursorToNextTextInput();
- // Preemptively rebuild the WebTextView, so that the action will
- // be set properly.
- mWebView.rebuildWebTextView();
- setDefaultSelection();
- mWebView.invalidate();
+ if (mWebView.nativeMoveCursorToNextTextInput()) {
+ // Since the cursor will no longer be in the same place as the
+ // focus, set the focus controller back to inactive
+ mWebView.setFocusControllerInactive();
+ // Preemptively rebuild the WebTextView, so that the action will
+ // be set properly.
+ mWebView.rebuildWebTextView();
+ setDefaultSelection();
+ mWebView.invalidate();
+ }
break;
case EditorInfo.IME_ACTION_DONE:
super.onEditorAction(actionCode);
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index d29d6f378274..897bd75fe1aa 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -6807,7 +6807,7 @@ public class WebView extends AbsoluteLayout
private native void nativeHideCursor();
private native String nativeImageURI(int x, int y);
private native void nativeInstrumentReport();
- /* package */ native void nativeMoveCursorToNextTextInput();
+ /* package */ native boolean nativeMoveCursorToNextTextInput();
// return true if the page has been scrolled
private native boolean nativeMotionUp(int x, int y, int slop);
// returns false if it handled the key