From 72bba588079e17eb425c4926d22ffcf301693bab Mon Sep 17 00:00:00 2001 From: Svetoslav Ganov Date: Mon, 5 Nov 2012 13:53:43 -0800 Subject: [PATCH] TextView not respecting "speak passwords" setting when adding before text to events. 1. If the speak passwords settings is on, the accessibility events emitted from a TextView should contain the text and before text of the source. The settings shows the users consent to put the source's text in the event. While the code that populates the current text in the accessibility event respects the setting, the one that populates the before text does not. As a result the fact that the user has typed a letter cannot be echoed by an accessibility service. bug:7468768 Change-Id: I7580c37936d742f42653315b2591e268a634d22b --- core/java/android/widget/TextView.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index a46481c3c88e3..5d904004cf027 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -8780,8 +8780,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener + " before=" + before + " after=" + after + ": " + buffer); if (AccessibilityManager.getInstance(mContext).isEnabled() - && !isPasswordInputType(getInputType()) - && !hasPasswordTransformationMethod()) { + && ((!isPasswordInputType(getInputType()) && !hasPasswordTransformationMethod()) + || shouldSpeakPasswordsForAccessibility())) { mBeforeText = buffer.toString(); }