Add isStable in Parcelable interface

Bug: 156242606
Test: m
Change-Id: I353958ebe24911ac9fb684878931aecad7e09b97
This commit is contained in:
Jeongik Cha
2020-05-14 00:50:53 +09:00
parent 8adff7229c
commit 7782abe5d2

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.
*