Bug 1248408 - Preserve text from previous a11y event if new event does not provide any. r=mfinkle
MozReview-Commit-ID: 3hIquiKLvl7
--- a/mobile/android/base/java/org/mozilla/gecko/GeckoAccessibility.java
+++ b/mobile/android/base/java/org/mozilla/gecko/GeckoAccessibility.java
@@ -203,18 +203,18 @@ public class GeckoAccessibility {
final JSONArray textArray = message.optJSONArray("text");
StringBuilder sb = new StringBuilder();
if (textArray != null && textArray.length() > 0) {
sb.append(textArray.optString(0));
for (int i = 1; i < textArray.length(); i++) {
sb.append(" ").append(textArray.optString(i));
}
+ sVirtualCursorNode.setText(sb.toString());
}
- sVirtualCursorNode.setText(sb.toString());
sVirtualCursorNode.setContentDescription(message.optString("description"));
JSONObject bounds = message.optJSONObject("bounds");
if (bounds != null) {
Rect relativeBounds = new Rect(bounds.optInt("left"), bounds.optInt("top"),
bounds.optInt("right"), bounds.optInt("bottom"));
sVirtualCursorNode.setBoundsInParent(relativeBounds);
int[] locationOnScreen = new int[2];