Android-Binder Mechanism-interaction between client and common service

Source: Internet
Author: User

The following articlesArticleIs a more in-depth analysis of the binder mechanism.

Directory

 

1.Android-Binder Mechanism-servicemanager

2. Android-Binder Mechanism-General Service Registration

3. Android-Binder Mechanism-get common service

4. Android-Binder Mechanism-interaction between client and common service

5. Android-Binder Mechanism-binder framework Summary

6. Android-Binder Mechanism-processstate and ipcthreadstate

7. Android-Binder Mechanism-driver

Android-Binder Mechanism-interaction between client and common service UML and description

The structure is basically the same as that in the previous two articles. Only a few special points are described:

1. The camera client executes startpreview () through bpcamera;

2. icamera defines the camera operation interface, which is an abstract class and bpcamera is the implementation of the client;

3. cameraservice: the client is the server. Each camera client corresponds to a cameraservice: client;

4. Implementation of icamera on the bncamera server;

5. bbinder has never been seen before. It implements ibinder on the server. The main interface is ontransact ();

6. In this figure, bpbinder and bbinder correspond to a group of processstate and ipcthreadstate, because they exist in each binder process, whether it is a client or a server;

Interaction Process

1. The startpreview () of camera calls the startpreview () of bpcamera ();
2. bpcamera executes remote ()-> transact (start_preview, Data, & reply), while remote () is bpbinder;
3. The mhandle in bpbinder is the handle index of cameraservice: client;
4. The camera process's ipcthreadstate transact forwarding request;
5. The server ipcthreadstate receives the above request through talkwithdriver. Of course, mhandle plays a very important role;
6. The ontransact of bbinder and ontransact and bncamera are executed in sequence;
7. The ontransact of bncamera calls the startpreview () function, which is the startpreview () function of cameraservice: client ();
8. return values are returned in the opposite path;

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.