- Renamed deepcopy to deepCopy.
- Clarified docs about when a shallow vs. deep copy happens.
Test: booted and ran
Change-Id: I2b4400770d781ff51423cd1c860454742e1d3c9c
ctor public Bundle(android.os.Bundle);
ctor public Bundle(android.os.PersistableBundle);
method public java.lang.Object clone();
- method public android.os.Bundle deepcopy();
+ method public android.os.Bundle deepCopy();
method public int describeContents();
method public android.os.IBinder getBinder(java.lang.String);
method public android.os.Bundle getBundle(java.lang.String);
ctor public PersistableBundle(int);
ctor public PersistableBundle(android.os.PersistableBundle);
method public java.lang.Object clone();
- method public android.os.PersistableBundle deepcopy();
+ method public android.os.PersistableBundle deepCopy();
method public int describeContents();
method public android.os.PersistableBundle getPersistableBundle(java.lang.String);
method public void putPersistableBundle(java.lang.String, android.os.PersistableBundle);
ctor public Bundle(android.os.Bundle);
ctor public Bundle(android.os.PersistableBundle);
method public java.lang.Object clone();
- method public android.os.Bundle deepcopy();
+ method public android.os.Bundle deepCopy();
method public int describeContents();
method public android.os.IBinder getBinder(java.lang.String);
method public android.os.Bundle getBundle(java.lang.String);
ctor public PersistableBundle(int);
ctor public PersistableBundle(android.os.PersistableBundle);
method public java.lang.Object clone();
- method public android.os.PersistableBundle deepcopy();
+ method public android.os.PersistableBundle deepCopy();
method public int describeContents();
method public android.os.PersistableBundle getPersistableBundle(java.lang.String);
method public void putPersistableBundle(java.lang.String, android.os.PersistableBundle);
ctor public Bundle(android.os.Bundle);
ctor public Bundle(android.os.PersistableBundle);
method public java.lang.Object clone();
- method public android.os.Bundle deepcopy();
+ method public android.os.Bundle deepCopy();
method public int describeContents();
method public android.os.IBinder getBinder(java.lang.String);
method public android.os.Bundle getBundle(java.lang.String);
ctor public PersistableBundle(int);
ctor public PersistableBundle(android.os.PersistableBundle);
method public java.lang.Object clone();
- method public android.os.PersistableBundle deepcopy();
+ method public android.os.PersistableBundle deepCopy();
method public int describeContents();
method public android.os.PersistableBundle getPersistableBundle(java.lang.String);
method public void putPersistableBundle(java.lang.String, android.os.PersistableBundle);
private JobInfo(JobInfo.Builder b) {
jobId = b.mJobId;
- extras = b.mExtras.deepcopy();
- transientExtras = b.mTransientExtras.deepcopy();
+ extras = b.mExtras.deepCopy();
+ transientExtras = b.mTransientExtras.deepCopy();
service = b.mJobService;
constraintFlags = b.mConstraintFlags;
triggerContentUris = b.mTriggerContentUris != null
final int N = fromMap.size();
mMap = new ArrayMap<>(N);
for (int i = 0; i < N; i++) {
- mMap.append(fromMap.keyAt(i), deepcopyValue(fromMap.valueAt(i)));
+ mMap.append(fromMap.keyAt(i), deepCopyValue(fromMap.valueAt(i)));
}
}
} else {
}
}
- Object deepcopyValue(Object value) {
+ Object deepCopyValue(Object value) {
if (value == null) {
return null;
}
if (value instanceof Bundle) {
- return ((Bundle)value).deepcopy();
+ return ((Bundle)value).deepCopy();
} else if (value instanceof PersistableBundle) {
- return ((PersistableBundle)value).deepcopy();
+ return ((PersistableBundle)value).deepCopy();
} else if (value instanceof ArrayList) {
return deepcopyArrayList((ArrayList) value);
} else if (value.getClass().isArray()) {
final int N = from.size();
ArrayList out = new ArrayList(N);
for (int i=0; i<N; i++) {
- out.add(deepcopyValue(from.get(i)));
+ out.add(deepCopyValue(from.get(i)));
}
return out;
}
/**
* Constructs a Bundle containing a copy of the mappings from the given
- * Bundle.
+ * Bundle. Does only a shallow copy of the original Bundle -- see
+ * {@link #deepCopy()} if that is not what you want.
*
* @param b a Bundle to be copied.
+ *
+ * @see #deepCopy()
*/
public Bundle(Bundle b) {
super(b);
/**
* Constructs a Bundle containing a copy of the mappings from the given
- * PersistableBundle.
+ * PersistableBundle. Does only a shallow copy of the PersistableBundle -- see
+ * {@link PersistableBundle#deepCopy()} if you don't want that.
*
- * @param b a Bundle to be copied.
+ * @param b a PersistableBundle to be copied.
*/
public Bundle(PersistableBundle b) {
super(b);
* primitive arrays. Other types of objects (such as Parcelable or Serializable)
* are referenced as-is and not copied in any way.
*/
- public Bundle deepcopy() {
+ public Bundle deepCopy() {
Bundle b = new Bundle(false);
b.copyInternal(this, true);
return b;
/**
* Constructs a PersistableBundle containing a copy of the mappings from the given
- * PersistableBundle.
+ * PersistableBundle. Does only a shallow copy of the original PersistableBundle -- see
+ * {@link #deepCopy()} if that is not what you want.
*
* @param b a PersistableBundle to be copied.
+ *
+ * @see #deepCopy()
*/
public PersistableBundle(PersistableBundle b) {
super(b);
/**
- * Constructs a PersistableBundle from a Bundle.
+ * Constructs a PersistableBundle from a Bundle. Does only a shallow copy of the Bundle.
*
* @param b a Bundle to be copied.
*
* primitive arrays. Other types of objects (such as Parcelable or Serializable)
* are referenced as-is and not copied in any way.
*/
- public PersistableBundle deepcopy() {
+ public PersistableBundle deepCopy() {
PersistableBundle b = new PersistableBundle(false);
b.copyInternal(this, true);
return b;