Internal mechanism _ Review Binder framework key points
When the server registers the service, it provides different ptr/cookie for each service.
The driver constructs a binder_node for each service, and it also contains Ptr/cookie
Client must first GetService before using the service: it constructs a binder_ref in the driver,
BINDER_REF contains DESC, node member, DESC is an integer, node points to the binder_node of the corresponding service
When using the service, the client constructs the data and invokes the IOCTL: the data contains handle
The driver finds Binder_ref (Desc==handle) based on handle, finds Binder_node, and then finds the server,
Remove Ptr/cookie from Binder_node and send the data to the server
Server according to Ptr/cookie know which service to invoke, ....
The core function: IOCTL
The core data of the client is: handle
The core data for the server is: Ptr/cookie
Android-driven learning-internal mechanism review Binder framework key points