Merge "Add isStable in Parcelable interface" am: 9bb27b0311 am: a5ace2e7be am: 27bfb77024 am: 6c310a5a1e

Change-Id: I2eec8edbbecaf197731505ecd282ddb2928f8e05
This commit is contained in:
Treehugger Robot
2020-05-18 22:49:19 +00:00
committed by Automerger Merge Worker

View File

@@ -118,7 +118,21 @@ public interface Parcelable {
* by this Parcelable object instance.
*/
public @ContentsFlags int describeContents();
/**
* 'Stable' means this parcelable is guaranteed to be stable for multiple years.
* It must be guaranteed by setting stability field in aidl_interface,
* OR explicitly override this method from @JavaOnlyStableParcelable marked Parcelable.
* WARNING: isStable() is only expected to be overridden by auto-generated code,
* OR @JavaOnlyStableParcelable marked Parcelable only if there is guaranteed to
* be only once copy of the parcelable on the system.
* @return true if this parcelable is stable.
* @hide
*/
default boolean isStable() {
return false;
}
/**
* Flatten this object in to a Parcel.
*