diff options
author | 2016-03-29 16:37:14 -0600 | |
---|---|---|
committer | 2016-03-29 16:38:55 -0600 | |
commit | 297017d1548530a0444637b02e01371ba3acf7b6 (patch) | |
tree | ad29a056398fba5efd59bd7a29e95d311e78b24b | |
parent | cd57599273738c30cc209894d1f87731c9defb16 (diff) |
AccessibilityNodeInfo shouldn't touch extras.
The extras may contain custom Parcelables which aren't in the
system's default classpath, so touching them would end up clobbering
the contents.
Update code to leave the parcelled data untouched inside the bundle
until someone tries reading the extras.
Bug: 27897919
Change-Id: I99381dd50c9a0e8887667076362ea98805f0437c
-rw-r--r-- | core/java/android/view/accessibility/AccessibilityNodeInfo.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/core/java/android/view/accessibility/AccessibilityNodeInfo.java b/core/java/android/view/accessibility/AccessibilityNodeInfo.java index bdaf291a2d3c..14821118f728 100644 --- a/core/java/android/view/accessibility/AccessibilityNodeInfo.java +++ b/core/java/android/view/accessibility/AccessibilityNodeInfo.java @@ -2926,8 +2926,10 @@ public class AccessibilityNodeInfo implements Parcelable { mInputType = other.mInputType; mLiveRegion = other.mLiveRegion; mDrawingOrderInParent = other.mDrawingOrderInParent; - if (other.mExtras != null && !other.mExtras.isEmpty()) { - getExtras().putAll(other.mExtras); + if (other.mExtras != null) { + mExtras = new Bundle(other.mExtras); + } else { + mExtras = null; } mRangeInfo = (other.mRangeInfo != null) ? RangeInfo.obtain(other.mRangeInfo) : null; @@ -3006,7 +3008,9 @@ public class AccessibilityNodeInfo implements Parcelable { mDrawingOrderInParent = parcel.readInt(); if (parcel.readInt() == 1) { - getExtras().putAll(parcel.readBundle()); + mExtras = parcel.readBundle(); + } else { + mExtras = null; } if (parcel.readInt() == 1) { @@ -3073,9 +3077,7 @@ public class AccessibilityNodeInfo implements Parcelable { mTextSelectionEnd = UNDEFINED_SELECTION_INDEX; mInputType = InputType.TYPE_NULL; mLiveRegion = View.ACCESSIBILITY_LIVE_REGION_NONE; - if (mExtras != null) { - mExtras.clear(); - } + mExtras = null; if (mRangeInfo != null) { mRangeInfo.recycle(); mRangeInfo = null; |