Loading core/java/android/webkit/WebView.java +38 −14 Original line number Diff line number Diff line Loading @@ -467,6 +467,7 @@ public class WebView extends AbsoluteLayout static final int WEBCORE_NEED_TOUCH_EVENTS = 25; // obj=Rect in doc coordinates static final int INVAL_RECT_MSG_ID = 26; static final int REQUEST_KEYBOARD = 27; static final String[] HandlerDebugString = { "REMEMBER_PASSWORD", // = 1; Loading Loading @@ -494,7 +495,8 @@ public class WebView extends AbsoluteLayout "LONG_PRESS_CENTER", // = 23; "PREVENT_TOUCH_ID", // = 24; "WEBCORE_NEED_TOUCH_EVENTS", // = 25; "INVAL_RECT_MSG_ID" // = 26; "INVAL_RECT_MSG_ID", // = 26; "REQUEST_KEYBOARD" // = 27; }; // width which view is considered to be fully zoomed out Loading Loading @@ -3002,9 +3004,11 @@ public class WebView extends AbsoluteLayout } // Called by JNI when a touch event puts a textfield into focus. private void displaySoftKeyboard() { private void displaySoftKeyboard(boolean isTextView) { InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE); if (isTextView) { imm.showSoftInput(mWebTextView, 0); mWebTextView.enableScrollOnScreen(true); // Now we need to fake a touch event to place the cursor where the Loading @@ -3019,6 +3023,18 @@ public class WebView extends AbsoluteLayout mWebTextView.fakeTouchEvent(x, y); } } else { // used by plugins imm.showSoftInput(this, 0); } } // Called by WebKit to instruct the UI to hide the keyboard private void hideSoftKeyboard() { InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(this.getWindowToken(), 0); } /* * This method checks the current focus and cursor and potentially rebuilds Loading Loading @@ -4920,6 +4936,14 @@ public class WebView extends AbsoluteLayout } break; case REQUEST_KEYBOARD: if (msg.arg1 == 0) { hideSoftKeyboard(); } else { displaySoftKeyboard(false); } break; default: super.handleMessage(msg); break; Loading core/java/android/webkit/WebViewCore.java +9 −0 Original line number Diff line number Diff line Loading @@ -1780,6 +1780,15 @@ final class WebViewCore { } // called by JNI private void requestKeyboard(boolean showKeyboard) { if (mWebView != null) { Message.obtain(mWebView.mPrivateHandler, WebView.REQUEST_KEYBOARD, showKeyboard ? 1 : 0, 0) .sendToTarget(); } } private native void nativePause(); private native void nativeResume(); private native void nativeFreeMemory(); Loading Loading
core/java/android/webkit/WebView.java +38 −14 Original line number Diff line number Diff line Loading @@ -467,6 +467,7 @@ public class WebView extends AbsoluteLayout static final int WEBCORE_NEED_TOUCH_EVENTS = 25; // obj=Rect in doc coordinates static final int INVAL_RECT_MSG_ID = 26; static final int REQUEST_KEYBOARD = 27; static final String[] HandlerDebugString = { "REMEMBER_PASSWORD", // = 1; Loading Loading @@ -494,7 +495,8 @@ public class WebView extends AbsoluteLayout "LONG_PRESS_CENTER", // = 23; "PREVENT_TOUCH_ID", // = 24; "WEBCORE_NEED_TOUCH_EVENTS", // = 25; "INVAL_RECT_MSG_ID" // = 26; "INVAL_RECT_MSG_ID", // = 26; "REQUEST_KEYBOARD" // = 27; }; // width which view is considered to be fully zoomed out Loading Loading @@ -3002,9 +3004,11 @@ public class WebView extends AbsoluteLayout } // Called by JNI when a touch event puts a textfield into focus. private void displaySoftKeyboard() { private void displaySoftKeyboard(boolean isTextView) { InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE); if (isTextView) { imm.showSoftInput(mWebTextView, 0); mWebTextView.enableScrollOnScreen(true); // Now we need to fake a touch event to place the cursor where the Loading @@ -3019,6 +3023,18 @@ public class WebView extends AbsoluteLayout mWebTextView.fakeTouchEvent(x, y); } } else { // used by plugins imm.showSoftInput(this, 0); } } // Called by WebKit to instruct the UI to hide the keyboard private void hideSoftKeyboard() { InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(this.getWindowToken(), 0); } /* * This method checks the current focus and cursor and potentially rebuilds Loading Loading @@ -4920,6 +4936,14 @@ public class WebView extends AbsoluteLayout } break; case REQUEST_KEYBOARD: if (msg.arg1 == 0) { hideSoftKeyboard(); } else { displaySoftKeyboard(false); } break; default: super.handleMessage(msg); break; Loading
core/java/android/webkit/WebViewCore.java +9 −0 Original line number Diff line number Diff line Loading @@ -1780,6 +1780,15 @@ final class WebViewCore { } // called by JNI private void requestKeyboard(boolean showKeyboard) { if (mWebView != null) { Message.obtain(mWebView.mPrivateHandler, WebView.REQUEST_KEYBOARD, showKeyboard ? 1 : 0, 0) .sendToTarget(); } } private native void nativePause(); private native void nativeResume(); private native void nativeFreeMemory(); Loading