summaryrefslogtreecommitdiffstats
path: root/core/java/android/webkit/WebTextView.java
diff options
context:
space:
mode:
authorLeon Scroggins <scroggo@google.com>2010-04-22 16:27:21 -0400
committerLeon Scroggins <scroggo@google.com>2010-04-22 17:09:24 -0400
commit69ec5c22d09690d33f0b87a386de13cc61eb9b42 (patch)
tree45a03026d899eb8652ca5471546f851829c48819 /core/java/android/webkit/WebTextView.java
parenta6ece18d95a35acc4fb3f9648403ce42d0d6b2d7 (diff)
downloadframeworks_base-69ec5c22d09690d33f0b87a386de13cc61eb9b42.zip
frameworks_base-69ec5c22d09690d33f0b87a386de13cc61eb9b42.tar.gz
frameworks_base-69ec5c22d09690d33f0b87a386de13cc61eb9b42.tar.bz2
Remove the WebTextView if it is drawing when it shouldn't.
Bug 2614064 Change-Id: Id5d0a27e862bb783299f6fa4863221a27318f52c
Diffstat (limited to 'core/java/android/webkit/WebTextView.java')
-rw-r--r--core/java/android/webkit/WebTextView.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/core/java/android/webkit/WebTextView.java b/core/java/android/webkit/WebTextView.java
index dc952e6..19abec1 100644
--- a/core/java/android/webkit/WebTextView.java
+++ b/core/java/android/webkit/WebTextView.java
@@ -301,6 +301,23 @@ import java.util.ArrayList;
}
@Override
+ protected void onDraw(Canvas canvas) {
+ // onDraw should only be called for password fields. If WebTextView is
+ // still drawing, but is no longer corresponding to a password field,
+ // remove it.
+ if (mWebView == null || !mWebView.nativeFocusCandidateIsPassword()
+ || !isSameTextField(mWebView.nativeFocusCandidatePointer())) {
+ // Although calling remove() would seem to make more sense here,
+ // changing it to not be a password field will make it not draw.
+ // Other code will make sure that it is removed completely, but this
+ // way the user will not see it.
+ setInPassword(false);
+ } else {
+ super.onDraw(canvas);
+ }
+ }
+
+ @Override
public void onEditorAction(int actionCode) {
switch (actionCode) {
case EditorInfo.IME_ACTION_NEXT: