diff options
author | Leon Scroggins III <scroggo@google.com> | 2010-09-02 12:53:08 -0400 |
---|---|---|
committer | Leon Scroggins III <scroggo@google.com> | 2010-09-02 12:53:08 -0400 |
commit | 71d17e40714407296d0d8c83d35c20f591bb0386 (patch) | |
tree | 2137cc9665f8a1b857ca3890ba41ced011fb7bcf /core | |
parent | e93a49216654037e39b704249a5ad01ea1b34ecb (diff) | |
download | frameworks_base-71d17e40714407296d0d8c83d35c20f591bb0386.zip frameworks_base-71d17e40714407296d0d8c83d35c20f591bb0386.tar.gz frameworks_base-71d17e40714407296d0d8c83d35c20f591bb0386.tar.bz2 |
Only close the IME if it is Active on the WebView.
Bug: 2955391
Some applications want to leave the IME open even though
the WebView is loading a page. Only hide the IME if it
is Active on the WebView or the WebTextView.
Change-Id: I1e7f973f649d78561bd8585c628a83c9b18a66ad
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/webkit/WebTextView.java | 6 | ||||
-rw-r--r-- | core/java/android/webkit/WebView.java | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/core/java/android/webkit/WebTextView.java b/core/java/android/webkit/WebTextView.java index 990f891..4d85046 100644 --- a/core/java/android/webkit/WebTextView.java +++ b/core/java/android/webkit/WebTextView.java @@ -594,8 +594,10 @@ import java.util.ArrayList; */ /* package */ void remove() { // hide the soft keyboard when the edit text is out of focus - InputMethodManager.getInstance(mContext).hideSoftInputFromWindow( - getWindowToken(), 0); + InputMethodManager imm = InputMethodManager.getInstance(mContext); + if (imm.isActive(this)) { + imm.hideSoftInputFromWindow(getWindowToken(), 0); + } mWebView.removeView(this); mWebView.requestFocus(); } diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index 0b236af..b83edc7 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -3701,8 +3701,10 @@ public class WebView extends AbsoluteLayout private void hideSoftKeyboard() { InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE); - - imm.hideSoftInputFromWindow(this.getWindowToken(), 0); + if (imm.isActive(this) + || (inEditingMode() && imm.isActive(mWebTextView))) { + imm.hideSoftInputFromWindow(this.getWindowToken(), 0); + } } /* |