libbinder: simplify setIpcSetDataReference
This deduplicates part of 'freeInit', so that if a reply parcel is
re-used by a client, its previous state may leak into the next step.
Client code essentially look like this:
Parcel reply;
...->transact(..., &reply, ...);
// inside this call, in waitForResponse
reply->ipcSetDataReference(...);
However, if multiple transact calls are sent, then other data in Parcel
might be undesirably mutated. Specifically, any field of Parcel which is
currently not set here. However, when receiving a reply from another
process, we want it in a very particular state (and any options on that
Parcel which we want to set on that Parcel should be set by libbinder
itself, if there are every any).
Bug: 167966510
Test: boot & test mapping tests here
Change-Id: Ib834b94c78ac4f481eba280dcec150f53127ce3e
1 file changed