The role of the Binder

Binders are primarily used for interprocess communication (IPC).

Binder of architecture

Binder uses a C/S architecture (Client/Server architecture).

The Client sends messages and the Server receives messages.

Binder mechanism

The Client and Server belong to different processes and need ServiceManager to communicate with each other.

The Server registers services with the ServiceManager by inserting Server information into binder_procs, a binder-driven global list. The ServiceManager’s SvCInfo list is used to cache registered services.

The Client passes the request parameters to the ServiceManager through BinderProxy.

The ServiceManager queries the service registered on the Server in the SVCInfo table and returns the proxy on the Server.

The Client gets the proxy object on the Server side and can call the method on the Server side.

This enables cross-process communication between Client and Server.