Example analysis of Android 4. X reading SIM card SMS and contact related classes

This article gives an example of Android 4. X reading SIM card SMS and contact related classes. Share with you for your reference, as follows:

1. IccSmsInterfaceManager

There are two main functions of this class

<1> Send SMS data < 2 > through smsdispatcher to update and query the SMS data of SIM card

Iccsinterfacemanager is a binder service class, and the binder interface is isms. When iccsinterfacemanager is created, the binder service will be registered. Iccssminterfacemanager is created in phonproxy and holds the corresponding phonebase object. When reading the SMS data on the SIM card, it is read through the iccfilehandler of phonebase. The iccfilehandler calls the RIL object to send a command to the modem. The relevant code is as follows:

fh.loadEFLinearFixedAll(IccConstants.EF_SMS,response);

When saving SMS data to the SIM card, it is operated through the RIL object of phonebase, which sends a command to the modem. Relevant codes are as follows:

2. IccPhoneBookInterfaceManagerProxy

This class is mainly used to update and query the contact data on the SIM card. It is the agent of iccpphonebookinterfacemanager. Iccphone bookinterface manager is a binder service. According to the difference of phonebase, iccphone bookinterfacemanager has two implementation classes, simphonebookinterfacemanager and ruimphone bookinterfacemanager. Iccphone bookinterfacemanager is constructed during the creation of phonebase object, and it will hold a phonebase object.

Iccphonebookinterfacemanagerproxy is constructed during the creation of phoneproxy objects. During the creation of the iccphone bookinterfacemanagerproxy, the binder service iccphone bookinterfacemanager is registered and holds the iccphone bookinterfacemanager object. Iccphone bookinterfacemanager holds an adnrecordcache. Object. This object comes from iccrcords. Iccrcords comes from the phonebase object. Phonebase updates the ICC records of the corresponding SIM card by monitoring the status of uicccontroller

It can be understood that each time the SIM card status changes, the uicccontroller first updates the SIM card status and the data read from the SIM card through the uicccardapplication. Then, notify the listener (phonebase, iccccardproxy) of uicccontroller that the relevant data of SIM card has changed, and they can update these data (iccrcords).

I hope this article will help you in Android programming.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>