diff options
author | 2021-06-04 17:28:21 +0000 | |
---|---|---|
committer | 2021-06-04 17:28:21 +0000 | |
commit | 75f787a119555bce3b3c8bbc27c25f57c97589af (patch) | |
tree | db7d2679ef635a1cc2c7b623fc6afac8dda7c28d /libs/binder/Parcel.cpp | |
parent | 8b59261674c0907456fb3953bc727cfe59dc9a71 (diff) | |
parent | dc246cf8e13def108bb620cc734a622600507bcc (diff) |
Merge changes Id2c1d0dc,I654fcd2c am: ee22bc842b am: dc246cf8e1
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1537303
Change-Id: Ifee05e1c82cfc6beebf6b7396ff42d651d8c89ae
Diffstat (limited to 'libs/binder/Parcel.cpp')
-rw-r--r-- | libs/binder/Parcel.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp index ae61b366fd..7ab3b754b9 100644 --- a/libs/binder/Parcel.cpp +++ b/libs/binder/Parcel.cpp @@ -173,8 +173,8 @@ static void release_object(const sp<ProcessState>& proc, status_t Parcel::finishFlattenBinder(const sp<IBinder>& binder) { internal::Stability::tryMarkCompilationUnit(binder.get()); - auto category = internal::Stability::getCategory(binder.get()); - return writeInt32(category.repr()); + int16_t rep = internal::Stability::getCategory(binder.get()).repr(); + return writeInt32(rep); } status_t Parcel::finishUnflattenBinder( @@ -184,7 +184,8 @@ status_t Parcel::finishUnflattenBinder( status_t status = readInt32(&stability); if (status != OK) return status; - status = internal::Stability::setRepr(binder.get(), stability, true /*log*/); + status = internal::Stability::setRepr(binder.get(), static_cast<int16_t>(stability), + true /*log*/); if (status != OK) return status; *out = binder; @@ -195,8 +196,11 @@ static constexpr inline int schedPolicyMask(int policy, int priority) { return (priority & FLAT_BINDER_FLAG_PRIORITY_MASK) | ((policy & 3) << FLAT_BINDER_FLAG_SCHED_POLICY_SHIFT); } -status_t Parcel::flattenBinder(const sp<IBinder>& binder) -{ +status_t Parcel::flattenBinder(const sp<IBinder>& binder) { + BBinder* local = nullptr; + if (binder) local = binder->localBinder(); + if (local) local->setParceled(); + if (isForRpc()) { if (binder) { status_t status = writeInt32(1); // non-null @@ -222,7 +226,6 @@ status_t Parcel::flattenBinder(const sp<IBinder>& binder) } if (binder != nullptr) { - BBinder *local = binder->localBinder(); if (!local) { BpBinder *proxy = binder->remoteBinder(); if (proxy == nullptr) { |