(M)SIM卡开机流程分析之主线分析
2017-01-10 21:00
330 查看
首先,PhoneFactory.java中通过方法makeDefaultPhone方法创建Phone对象,以及其他的对象,看一下PhoneFactory.makeDefaultPhone方法:
/** * FIXME replace this with some other way of making these * instances */ public static void makeDefaultPhone(Context context) { ...... // use UNIX domain socket to // prevent subsequent initialization // 创建Socket,和Telephony进行通信 new LocalServerSocket("com.android.internal.telephony"); ...... /* In case of multi SIM mode two instances of PhoneProxy, RIL are created, where as in single SIM mode only instance. isMultiSimEnabled() function checks whether it is single SIM or multi SIM mode */ // 取得手机最大支持的SIM卡数量 int numPhones = TelephonyManager.getDefault().getPhoneCount(); // 网络模式,Preferred Network Mode int[] networkModes = new int[numPhones]; // Phone代理 sProxyPhones = new PhoneProxy[numPhones]; // 创建RIL sCommandsInterfaces = new RIL[numPhones]; for (int i = 0; i < numPhones; i++) { // reads the system properties and makes commandsinterface // Get preferred network type. // 默认的Preferred Network Mode networkModes[i] = RILConstants.PREFERRED_NETWORK_MODE; Rlog.i(LOG_TAG, "Network Mode set to " + Integer.toString(networkModes[i])); // 初始化RIL,后续会经常遇到这个,需要注意 sCommandsInterfaces[i] = new RIL(context, networkModes[i], cdmaSubscription, i); } Rlog.i(LOG_TAG, "Creating SubscriptionController"); SubscriptionController.init(context, sCommandsInterfaces); // Instantiate UiccController so that all other classes can just // call getInstance() // 创建UiccController对象,注意单例模式,注意传入的参数为RIL数组 mUiccController = UiccController.make(context, sCommandsInterfaces); for (int i = 0; i < numPhones; i++) { PhoneBase phone = null; int phoneType = TelephonyManager.getPhoneType(networkModes[i]); if (phoneType == PhoneConstants.PHONE_TYPE_GSM) { phone = new GSMPhone(context, sCommandsInterfaces[i], sPhoneNotifier, i); } else if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) { phone = new CDMALTEPhone(context, sCommandsInterfaces[i], sPhoneNotifier, i); } // 创建Phone代理 sProxyPhones[i] = new PhoneProxy(phone); } mProxyController = ProxyController.getInstance(context, sProxyPhones, mUiccController, sCommandsInterfaces); ...... }
相关文章推荐
- (M)SIM卡开机流程分析之UiccController类分析
- (M)SIM卡开机流程分析之显示名称加载
- Android 4.4Telephony流程分析SIM卡开机时的初始化
- (M)SIM卡开机流程分析之RIL类分析
- Android4.4 Telephony流程分析——SIM卡开机时的数据加载
- (M)SIM卡开机流程分析之SubscriptionController类分析
- (M)SIM卡开机流程分析之TelephonyDevController类分析
- (M)SIM卡开机流程分析之默认APN设置
- Android4.4 Telephony流程分析——SIM卡开机时的初始化
- Android4.4 Telephony流程分析——SIM卡开机时的初始化
- Android 4.4Telephony流程分析SIM卡开机时的数据加载
- (M)SIM卡开机流程分析之DefaultPhoneNotifier类分析
- (M)SIM卡开机流程分析之TelephonyManager类分析
- 浅析android锁屏开机绘制流程(基于android4.0源码分析)
- Android开机流程分析 -- init进程之配置文件解析
- 【LTE基础知识】LTE信令流程之开机附着、去附着流程分析
- [Android5.1]开机动画显示工作流程分析
- Linux之RHEL6的开机流程分析
- android开机锁屏流程分析
- Android开机流程分析 -- 概述