Merge "Add some comments about thread-safety" am: d0c6e0fa08
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1503391 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I547e6031e095b5d70e288332dd451635b048333f
This commit is contained in:
@@ -63,6 +63,8 @@ import android.util.MathUtils;
|
|||||||
* op.y = ...;
|
* op.y = ...;
|
||||||
* ap.extension.setParcelable(op);}</pre>
|
* ap.extension.setParcelable(op);}</pre>
|
||||||
*
|
*
|
||||||
|
* <p class="note">ParcelableHolder is <strong>not</strong> thread-safe.</p>
|
||||||
|
*
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@SystemApi
|
@SystemApi
|
||||||
@@ -120,6 +122,7 @@ public final class ParcelableHolder implements Parcelable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Write a parcelable into ParcelableHolder, the previous parcelable will be removed.
|
* Write a parcelable into ParcelableHolder, the previous parcelable will be removed.
|
||||||
|
* (@link #setParcelable} and (@link #getParcelable} are not thread-safe.
|
||||||
* @throws BadParcelableException if the parcelable's stability is more unstable
|
* @throws BadParcelableException if the parcelable's stability is more unstable
|
||||||
* ParcelableHolder.
|
* ParcelableHolder.
|
||||||
*/
|
*/
|
||||||
@@ -139,6 +142,8 @@ public final class ParcelableHolder implements Parcelable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Read a parcelable from ParcelableHolder.
|
||||||
|
* (@link #setParcelable} and (@link #getParcelable} are not thread-safe.
|
||||||
* @return the parcelable that was written by {@link #setParcelable} or {@link #readFromParcel},
|
* @return the parcelable that was written by {@link #setParcelable} or {@link #readFromParcel},
|
||||||
* or {@code null} if the parcelable has not been written.
|
* or {@code null} if the parcelable has not been written.
|
||||||
* @throws BadParcelableException if T is different from the type written by
|
* @throws BadParcelableException if T is different from the type written by
|
||||||
|
|||||||
Reference in New Issue
Block a user