Android 电话相关架构及源代码分析和学习

来源:互联网 发布:新浪微博微数据没有了 编辑:程序博客网 时间:2024/05/16 05:53

分析com.android.internal.telephony,这是android系统内部实现的一些类。

1、ITelephony.aidl

 

interface ITelephony

/**
 * Interface used to interact with the phone.  Mostly this is used by the
 * TelephonyManager class.  A few places are still using this directly.
 * Please clean them up if possible and use TelephonyManager insteadl.

 */

这是一个接口,提供了一些和phone交互的一些函数,没有实现具体的功能比如:

void dial(String number);

 void call(String number);

boolean showCallScreen();

等等

 

从import语句:import android.telephony.NeighboringCellInfo来看,这个接口还使用了NeighboringCellInfo,因为ITelephony接口提供了下面这个函数方法:

/**
     * Returns the neighboring cell information of the device.
     */
    List<NeighboringCellInfo> getNeighboringCellInfo();

 

 

com.android.phone

 

1、PhoneInterfaceManager.java

 

public class PhoneInterfaceManager extends ITelephony.Stub

 


/**
 * Implementation of the ITelephony interface.
 */

 

这个类是对ITelephony中所有方法的实现,同时也添加了一些处理phone消息的方法。

 

2、PhoneUtils.java

 

/**
 * Misc utilities for the Phone app.
 */
public class PhoneUtils

 

主要提供了phone应用程序中所要使用的各种utilities

 

 

3、PhoneApp.java

 

/**
 * Top-level Application class for the Phone app.
 */
public class PhoneApp extends Application

 

这个类是最上层应用程序类。

 

4、BluetoothAtPhonebook.java

 

/**
 * Helper for managing phonebook presentation over AT commands
 * @hide
 */
public class BluetoothAtPhonebook

 

通过AT命令提供电话本的管理

原创粉丝点击