Telephonymanager
The telephonymanager class provides a series of get methods for accessing the status and information related to mobile communication. Including the status and information of the phone SIM,
The status of the Telecom Network and the information of the mobile phone users. In the ApplicationProgramYou can use these get methods to obtain relevant data.
The telephonymanager class object can be passed through:The context. getsystemservice (context. telephony_service) method,
Note that some communication information is obtained.There are certain restrictions on the permissions of the application. You need to add the corresponding permissions to the application during development.
Telephonymanager is not a framework layer service, which belongs to the context and exists in every application.
Take a look at the telephonymanager class structure:
The service on the three framework layers is displayed. The remote proxy object obtains the status information.
Phoneinterfacemanager
Implement the itelephony interface, which is the related interface of the framework layer telephony to implement the phone control operation.
The implementation of this class is indeed completed in phoneapp, but the remote call is implemented and added
Servicemanager.
Phoneinterfacemanager constructor:
PrivatePhoneinterfacemanager (phoneapp app, phone) {Mapp=APP; mphone=Phone; MCM=Phoneapp. getinstance (). MCM; mmainthreadhandler=NewMainthreadhandler (); publish ();}Private VoidPublish () {servicemanager. addservice ("Phone",This);}
Telephonymanager and phoneinterfacemanager applications:
From: http://blog.163.com/my_ywj/blog/static/181203559201222384039340/