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

Commit ef955ad3 authored by Phil Weaver's avatar Phil Weaver
Browse files

Make deep copies of a11y data.

Make sure we don't get exposed to changes make to text
after the setter on the node or event is called. Such
changes mean, among other things, that we can't move the
nodes to different threads.

Bug: 31042124
Change-Id: I12921ff7e50a200b8140994a237040d01a31b6f5
parent b67b8a6d
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -2230,7 +2230,7 @@ public class AccessibilityNodeInfo implements Parcelable {
     */
    public void setText(CharSequence text) {
        enforceNotSealed();
        mText = text;
        mText = (text == null) ? null : text.subSequence(0, text.length());
    }

    /**
@@ -2247,7 +2247,7 @@ public class AccessibilityNodeInfo implements Parcelable {
     */
    public void setError(CharSequence error) {
        enforceNotSealed();
        mError = error;
        mError = (error == null) ? null : error.subSequence(0, error.length());
    }

    /**
@@ -2282,7 +2282,8 @@ public class AccessibilityNodeInfo implements Parcelable {
     */
    public void setContentDescription(CharSequence contentDescription) {
        enforceNotSealed();
        mContentDescription = contentDescription;
        mContentDescription = (contentDescription == null) ? null
                : contentDescription.subSequence(0, contentDescription.length());
    }

    /**
+4 −2
Original line number Diff line number Diff line
@@ -572,7 +572,8 @@ public class AccessibilityRecord {
     */
    public void setBeforeText(CharSequence beforeText) {
        enforceNotSealed();
        mBeforeText = beforeText;
        mBeforeText = (beforeText == null) ? null
                : beforeText.subSequence(0, beforeText.length());
    }

    /**
@@ -593,7 +594,8 @@ public class AccessibilityRecord {
     */
    public void setContentDescription(CharSequence contentDescription) {
        enforceNotSealed();
        mContentDescription = contentDescription;
        mContentDescription = (contentDescription == null) ? null
                : contentDescription.subSequence(0, contentDescription.length());
    }

    /**