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

Commit b35b8c13 authored by Amith Yamasani's avatar Amith Yamasani Committed by Android (Google) Code Review
Browse files

Merge "Security fix in accessibility - don't read out password. # 2371557" into eclair

parents 88e653f6 91ccdb5f
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -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();