I'm trying to find the implementation of remote(), as in:
remote()->transact(CODE, data, &reply);
Do you guys know where it is? Searching Google turned out futile. Or if you know what that function does, it would be a big help for me. Many thanks
Update: it seems remote() will return a pointer to an object of type BBinder, IBinder, BpBinder, or IPCThreadState but I'm not sure which one.
The implementation of
remote
is simple:The
ServiceManager
will manage all the registered service, for how it works, check an existing answer. When yougetService
fromServiceManager
, it will return anIBinder
object represents that service, then thisIBinder
object will be put into aBpInterface
. That is your remote. Then you can use thatBpInterface
to start binder transaction with the actualservice(BnInterface)
.All familiar
BpXXX
likeBpCamera
,BpCameraService
extends fromBpInterface
.