diff options
author | Amith Yamasani <yamasani@google.com> | 2010-01-14 18:56:02 -0800 |
---|---|---|
committer | Amith Yamasani <yamasani@google.com> | 2010-01-14 18:56:02 -0800 |
commit | 91ccdb5f10456d7e47e5307515766e875a521802 (patch) | |
tree | 9b5f1bd0d82e8c30a9ded63510dfcd49de1cee61 | |
parent | 240298f9e4542c487edd0337e84b50c493cbeecd (diff) | |
download | frameworks_base-91ccdb5f10456d7e47e5307515766e875a521802.zip frameworks_base-91ccdb5f10456d7e47e5307515766e875a521802.tar.gz frameworks_base-91ccdb5f10456d7e47e5307515766e875a521802.tar.bz2 |
Security fix in accessibility - don't read out password. # 2371557
Check for password type before send accessibility event.
[Submitting for Svet]
-rw-r--r-- | core/java/android/widget/TextView.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index cdaba8a..876359d 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -6301,7 +6301,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener if (DEBUG_EXTRACT) Log.v(TAG, "beforeTextChanged start=" + start + " before=" + before + " after=" + after + ": " + buffer); - if (AccessibilityManager.getInstance(mContext).isEnabled()) { + if (AccessibilityManager.getInstance(mContext).isEnabled() + && !isPasswordInputType(mInputType)) { mBeforeText = buffer.toString(); } @@ -6972,9 +6973,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener @Override public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) { - boolean isPassword = - (mInputType & (EditorInfo.TYPE_MASK_CLASS | EditorInfo.TYPE_MASK_VARIATION)) == - (EditorInfo.TYPE_CLASS_TEXT | EditorInfo.TYPE_TEXT_VARIATION_PASSWORD); + final boolean isPassword = isPasswordInputType(mInputType); if (!isPassword) { CharSequence text = getText(); |