summaryrefslogtreecommitdiffstats
path: root/core/java/android/view/accessibility
diff options
context:
space:
mode:
authorSvetoslav Ganov <svetoslavganov@google.com>2013-09-09 21:06:37 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-09-09 21:06:38 +0000
commit3bbd3aea604e6132c95a2f1f6e10c993ecc70d8b (patch)
tree93175905cb6a802e7bd66d6306d29a9e655a2803 /core/java/android/view/accessibility
parent91c8111d3ae654e7646e9cbcf486554a8810b47c (diff)
parent6685f1bacead5f765c71a49f5cf0dc88750344d5 (diff)
downloadframeworks_base-3bbd3aea604e6132c95a2f1f6e10c993ecc70d8b.zip
frameworks_base-3bbd3aea604e6132c95a2f1f6e10c993ecc70d8b.tar.gz
frameworks_base-3bbd3aea604e6132c95a2f1f6e10c993ecc70d8b.tar.bz2
Merge "AccessibilityNodeInfo incorrectly cloned." into klp-dev
Diffstat (limited to 'core/java/android/view/accessibility')
-rw-r--r--core/java/android/view/accessibility/AccessibilityNodeInfo.java44
1 files changed, 41 insertions, 3 deletions
diff --git a/core/java/android/view/accessibility/AccessibilityNodeInfo.java b/core/java/android/view/accessibility/AccessibilityNodeInfo.java
index ba63421..c61516b 100644
--- a/core/java/android/view/accessibility/AccessibilityNodeInfo.java
+++ b/core/java/android/view/accessibility/AccessibilityNodeInfo.java
@@ -2279,9 +2279,12 @@ public class AccessibilityNodeInfo implements Parcelable {
if (other.mExtras != null && !other.mExtras.isEmpty()) {
getExtras().putAll(other.mExtras);
}
- mRangeInfo = other.mRangeInfo;
- mCollectionInfo = other.mCollectionInfo;
- mCollectionItemInfo = other.mCollectionItemInfo;
+ mRangeInfo = (other.mRangeInfo != null)
+ ? RangeInfo.obtain(other.mRangeInfo) : null;
+ mCollectionInfo = (other.mCollectionInfo != null)
+ ? CollectionInfo.obtain(other.mCollectionInfo) : null;
+ mCollectionItemInfo = (other.mCollectionItemInfo != null)
+ ? CollectionItemInfo.obtain(other.mCollectionItemInfo) : null;
}
/**
@@ -2602,6 +2605,17 @@ public class AccessibilityNodeInfo implements Parcelable {
private float mCurrent;
/**
+ * Obtains a pooled instance that is a clone of another one.
+ *
+ * @param other The instance to clone.
+ *
+ * @hide
+ */
+ public static RangeInfo obtain(RangeInfo other) {
+ return obtain(other.mType, other.mMin, other.mMax, other.mCurrent);
+ }
+
+ /**
* Obtains a pooled instance.
*
* @param type The type of the range.
@@ -2708,6 +2722,18 @@ public class AccessibilityNodeInfo implements Parcelable {
private boolean mHierarchical;
/**
+ * Obtains a pooled instance that is a clone of another one.
+ *
+ * @param other The instance to clone.
+ *
+ * @hide
+ */
+ public static CollectionInfo obtain(CollectionInfo other) {
+ return CollectionInfo.obtain(other.mRowCount, other.mColumnCount,
+ other.mHierarchical);
+ }
+
+ /**
* Obtains a pooled instance.
*
* @param rowCount The number of rows.
@@ -2796,6 +2822,18 @@ public class AccessibilityNodeInfo implements Parcelable {
new SynchronizedPool<CollectionItemInfo>(MAX_POOL_SIZE);
/**
+ * Obtains a pooled instance that is a clone of another one.
+ *
+ * @param other The instance to clone.
+ *
+ * @hide
+ */
+ public static CollectionItemInfo obtain(CollectionItemInfo other) {
+ return CollectionItemInfo.obtain(other.mRowIndex, other.mRowSpan,
+ other.mColumnIndex, other.mColumnSpan, other.mHeading);
+ }
+
+ /**
* Obtains a pooled instance.
*
* @param rowIndex The row index at which the item is located.