BpHwRefBase: expose 'remote' field.
In order to safely allow getting an IBinder from a remote IFoo.
We have the following class hierarchies:
IBase : RefBase
BpHwBase : BpInterface<IBase>, HidlInstrumentor
template<typename T> BpInterface : T, BpRefBase
IFoo : IBase
BpHwFoo : BpInterface<IFoo>, HidlInstrumentor
BpInterface<T> exposes IBinder by calling protected remote on
BpHwRefBase, however BpInterface<T> is different for each type, so in
order to get a binder w/o invoking UB, you would have to know the type
of the proxy object.
Now, you can safely do:
(remote) IBase -> BpHwBase -> BpHwRefBase -> IBinder.
Bug: 66921961
Test: hidl_test
Change-Id: I94733940a4ce015901c2d3df013d6d3afbaf37e5
1 file changed