Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 092f7543 authored by Phil Weaver's avatar Phil Weaver
Browse files

Use on-screen text in a11y text changed event

The beforeText in a text changed event was coming from
the underlying CharSequence, not what was on the screen.
As a result, it was not sent for password fields. Now
we just provide whatever is on the screen, which is
obfuscated to the same degree it is for a user looking
at the screen.

Bug: 75324441
Test: Verified with password field in TalkBack sample app.
Also atest CtsAccessibilityServiceTestCases

Change-Id: Ib7a10313d2f9d0e44d2052e81e47f19967a67bc4
parent 9859c29a
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -12406,9 +12406,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                        + " before=" + before + " after=" + after + ": " + buffer);
            }

            if (AccessibilityManager.getInstance(mContext).isEnabled()
                    && !isPasswordInputType(getInputType()) && !hasPasswordTransformationMethod()) {
                mBeforeText = buffer.toString();
            if (AccessibilityManager.getInstance(mContext).isEnabled() && (mTransformed != null)) {
                mBeforeText = mTransformed.toString();
            }

            TextView.this.sendBeforeTextChanged(buffer, start, before, after);