[snapshot] skip onChanged() in Watched* snapshot()
During snapshot building we should directly modify mStorage and skip those onChanged() calls in the wrapper classes. BUG: 231373522 Test: builds Change-Id: Idc00332a681d83b9588e564f1ad8303c374a0948
This commit is contained in:
@@ -416,7 +416,7 @@ public class WatchedArrayList<E> extends WatchableImpl
|
||||
dst.mStorage.ensureCapacity(end);
|
||||
for (int i = 0; i < end; i++) {
|
||||
final E val = Snapshots.maybeSnapshot(src.get(i));
|
||||
dst.add(val);
|
||||
dst.mStorage.add(val);
|
||||
}
|
||||
dst.seal();
|
||||
}
|
||||
|
||||
@@ -465,7 +465,7 @@ public class WatchedArrayMap<K, V> extends WatchableImpl
|
||||
for (int i = 0; i < end; i++) {
|
||||
final V val = Snapshots.maybeSnapshot(src.valueAt(i));
|
||||
final K key = src.keyAt(i);
|
||||
dst.put(key, val);
|
||||
dst.mStorage.put(key, val);
|
||||
}
|
||||
dst.seal();
|
||||
}
|
||||
|
||||
@@ -427,7 +427,7 @@ public class WatchedArraySet<E> extends WatchableImpl
|
||||
dst.mStorage.ensureCapacity(end);
|
||||
for (int i = 0; i < end; i++) {
|
||||
final E val = Snapshots.maybeSnapshot(src.valueAt(i));
|
||||
dst.append(val);
|
||||
dst.mStorage.append(val);
|
||||
}
|
||||
dst.seal();
|
||||
}
|
||||
|
||||
@@ -410,7 +410,7 @@ public class WatchedLongSparseArray<E> extends WatchableImpl
|
||||
for (int i = 0; i < end; i++) {
|
||||
final E val = Snapshots.maybeSnapshot(src.valueAt(i));
|
||||
final long key = src.keyAt(i);
|
||||
dst.put(key, val);
|
||||
dst.mStorage.put(key, val);
|
||||
}
|
||||
dst.seal();
|
||||
}
|
||||
|
||||
@@ -490,7 +490,7 @@ public class WatchedSparseArray<E> extends WatchableImpl
|
||||
for (int i = 0; i < end; i++) {
|
||||
final E val = Snapshots.maybeSnapshot(src.valueAt(i));
|
||||
final int key = src.keyAt(i);
|
||||
dst.put(key, val);
|
||||
dst.mStorage.put(key, val);
|
||||
}
|
||||
dst.seal();
|
||||
}
|
||||
|
||||
@@ -310,7 +310,7 @@ public class WatchedSparseBooleanArray extends WatchableImpl
|
||||
}
|
||||
final int end = src.size();
|
||||
for (int i = 0; i < end; i++) {
|
||||
dst.put(src.keyAt(i), src.valueAt(i));
|
||||
dst.mStorage.put(src.keyAt(i), src.valueAt(i));
|
||||
}
|
||||
dst.seal();
|
||||
}
|
||||
|
||||
@@ -315,7 +315,7 @@ public class WatchedSparseIntArray extends WatchableImpl
|
||||
}
|
||||
final int end = src.size();
|
||||
for (int i = 0; i < end; i++) {
|
||||
dst.put(src.keyAt(i), src.valueAt(i));
|
||||
dst.mStorage.put(src.keyAt(i), src.valueAt(i));
|
||||
}
|
||||
dst.seal();
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ public class WatchedSparseSetArray<T> extends WatchableImpl implements Snappable
|
||||
final ArraySet set = src.get(i);
|
||||
final int setSize = set.size();
|
||||
for (int j = 0; j < setSize; j++) {
|
||||
dst.add(src.keyAt(i), set.valueAt(j));
|
||||
dst.mStorage.add(src.keyAt(i), set.valueAt(j));
|
||||
}
|
||||
}
|
||||
dst.seal();
|
||||
|
||||
Reference in New Issue
Block a user