上一篇已经了解了phone的关系图,是否好奇phone是如何创建的呢,接下来我们看下phone的创建流程:
- GsmCdmaPhone: PhoneFactory ->new GsmCdmaPhone
- ImsPhone: ImsPhoneFactory -> new ImsPhone
这里关注下ImsPhone创建过程的备注,default phone ready后才能创建Imsphone:
// Start monitoring after defaults have been made.
// Default phone must be ready before ImsPhone is created
// because ImsService might need it when it is being opened.
for (int i = 0; i < numPhones; i++) {
sPhones[i].startMonitoringImsService();
}