From 9e8086658da6109ff9e9666f32eb019fb048a536 Mon Sep 17 00:00:00 2001 From: Jeongik Cha Date: Thu, 14 May 2020 00:52:15 +0900 Subject: [PATCH] Add isStable in Parcelable interface Bug: 156242606 Test: m Change-Id: I0edc64c8c7f8c9c08384f9d48832549eb026b9d0 --- libs/binder/include/binder/Parcelable.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libs/binder/include/binder/Parcelable.h b/libs/binder/include/binder/Parcelable.h index a9166e2408..c1132795de 100644 --- a/libs/binder/include/binder/Parcelable.h +++ b/libs/binder/include/binder/Parcelable.h @@ -52,6 +52,12 @@ public: // // Returns android::OK on success and an appropriate error otherwise. virtual status_t readFromParcel(const Parcel* parcel) = 0; + + // 'Stable' means this parcelable is guaranteed to be stable for multiple years. + // It must be guaranteed by setting stability field in aidl_interface. + // WARNING: isStable() is only expected to be overridden by auto-generated code. + // Returns true if this parcelable is stable. + virtual bool isStable() const { return false; } }; // class Parcelable #if defined(__clang__)