diff options
author | 2021-06-03 21:40:45 +0000 | |
---|---|---|
committer | 2021-06-03 23:14:16 +0000 | |
commit | 14e4cfae36aa878c6a9838299bc7b9aa42a16dfa (patch) | |
tree | 590d31fa3496c13af2ec5820a01f16229195161f /libs/binder/Parcel.cpp | |
parent | 8617ad805609e2d92de58b351342fc98aefa035c (diff) |
libbinder: +2 bytes in BBinder from stability rep
sizeof(BBinder) may not be changed unless 1,000s of people in many
different companies fundamentally change the way they work. So, with
precious few bits to spare, we make room by changing the way that
binder stability reserves space on the wire. Now, it uses the least
significant 16-bits of the 32-bits which is reserved on the wire.
The sideeffect of this straightforward implementation is that the wire
protocol is slightly changed. This is an intentional change in order to
exercise its instability, perhaps as an early warning.
Bug: 166282674
Test: boot, binderLibTest
Change-Id: I654fcd2cc9d20cbac557d1a176a5095c491d88cf
Diffstat (limited to 'libs/binder/Parcel.cpp')
-rw-r--r-- | libs/binder/Parcel.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp index d19b4d83fb..10188fee6e 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; |