在PhoneFactory.java内开始实例化RIL类
public static void makeDefaultPhone(Context context) {
...
sCommandsInterfaces[i] = new RIL(context, networkModes[i],
cdmaSubscription, i);
...
}
因为RIL的继承关系如:class RIL extends BaseCommands implements CommandsInterface,上面的代码中sCommandsInterface类型是CommandsInterface。属于向上转型。
下面在进入到RIL中的构造方法:
public RIL(Context context, int preferredNetworkType,
int cdmaSubscription, Integer instanceId) {
//1、调用父类的构造方法
super(context);