1.makeDefaultPhones
frameworks\opt\telephony\src\java\com\android\internal\telephony\PhoneFactory.java
public static void makeDefaultPhones(Context context) {
makeDefaultPhone(context);
}
2.makeDefaultPhone
frameworks\opt\telephony\src\java\com\android\internal\telephony\PhoneFactory.java
public static void makeDefaultPhone(Context context) {
for (int i = 0; i < numPhones; i++) {
Phone phone = null;
int phoneType = TelephonyManager.getPhoneType(networkModes[i]);
if (phoneType == PhoneConstants.PHONE_TYPE_GSM) {
phone = new GsmCdmaPhone(context, sCommandsInterfaces[i], sPhoneNotifier, i, PhoneConstants.PHONE_TYPE_GSM,
TelephonyComponentFactory.getInstance());
} else if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
phone = new GsmCdmaPhone(context, sCommandsInterfaces[i], sPhoneNotifier, i,
PhoneConstants.PHONE_TYPE_CDMA_LTE, TelephonyComponentFactory.getInstance());
}
Rlog.i(LOG_TAG, "Creating Phone with type = " + phoneType + " sub = " + i);
sPhones[i] = phone;
}
}
3. GsmCdmaPhone
frameworks\opt\telephony\src\java\com\android\internal\telephony\GsmCdmaPhone.java
public GsmCdmaPhone(Context context, CommandsInterface ci, PhoneNotifier notifier, int phoneId,
int precisePhoneType, TelephonyComponentFactory telephonyComponentFactory) {
this(context, ci, notifier, false, phoneId, precisePhoneType, telephonyComponentFactory);
}
4.GsmCdmaPhone
frameworks\opt\telephony\src\java\com\android\internal\telephony\GsmCdmaPhone.java
public GsmCdmaPhone(Context context, CommandsInterface ci, PhoneNotifier notifier,
boolean unitTestMode, int phoneId, int precisePhoneType,
TelephonyComponentFactory telephonyComponentFactory) {
super(precisePhoneType == PhoneConstants.PHONE_TYPE_GSM ? "GSM" : "CDMA",
notifier, context, ci, unitTestMode, phoneId, telephonyComponentFactory);
initOnce(ci);
}
5.initOnce
frameworks\opt\telephony\src\java\com\android\internal\telephony\GsmCdmaPhone.java
private void initOnce(CommandsInterface ci) {
mIccSmsInterfaceManager = mTelephonyComponentFactory.makeIccSmsInterfaceManager(this);
}
6.makeIccSmsInterfaceManager
frameworks\opt\telephony\src\java\com\android\internal\telephony\TelephonyComponentFactory.java
public IccSmsInterfaceManager makeIccSmsInterfaceManager(Phone phone) {
return new IccSmsInterfaceManager(phone);
}
7.IccSmsInterfaceManager
frameworks\opt\telephony\src\java\com\android\internal\telephony\IccSmsInterfaceManager.java
protected IccSmsInterfaceManager(Phone phone) {
mPhone = phone;
mContext = phone.getContext();
mAppOps = (AppOpsManager) mContext.getSystemService(Context.APP_OPS_SERVICE);
mUserManager = (UserManager) mContext.getSystemService(Context.USER_SERVICE);
mDispatcher = new ImsSMSDispatcher(phone, phone.mSmsStorageMonitor, phone.mSmsUsageMonitor);
}
8.ImsSMSDispatcher
frameworks\opt\telephony\src\java\com\android\internal\telephony\ImsSMSDispatcher.java
public ImsSMSDispatcher(Phone phone, SmsStorageMonitor storageMonitor, SmsUsageMonitor usageMonitor) {
mGsmInboundSmsHandler = GsmInboundSmsHandler.makeInboundSmsHandler(phone.getContext(),
storageMonitor, phone);
mCdmaInboundSmsHandler = CdmaInboundSmsHandler.makeInboundSmsHandler(phone.getContext(),
storageMonitor, phone, (CdmaSMSDispatcher) mCdmaDispatcher);
}
9.makeInboundSmsHandler
frameworks\opt\telephony\src\java\com\android\internal\telephony\gsm\GsmInboundSmsHandler.java
public static GsmInboundSmsHandler makeInboundSmsHandler(Context context,
SmsStorageMonitor storageMonitor, Phone phone) {
GsmInboundSmsHandler handler = new GsmInboundSmsHandler(context, storageMonitor, phone);
handler.start();
return handler;
}
frameworks\opt\telephony\src\java\com\android\internal\telephony\gsm\GsmInboundSmsHandler.java
private GsmInboundSmsHandler(Context context, SmsStorageMonitor storageMonitor,
Phone phone) {
super("GsmInboundSmsHandler", context, storageMonitor, phone,
GsmCellBroadcastHandler.makeGsmCellBroadcastHandler(context, phone));
phone.mCi.setOnNewGsmSms(getHandler(), EVENT_NEW_SMS, null);
mDataDownloadHandler = new UsimDataDownloadHandler(phone.mCi);
}
frameworks\opt\telephony\src\java\com\android\internal\telephony\BaseCommands.java
public void setOnNewGsmSms(Handler h, int what, Object obj) {
mGsmSmsRegistrant = new Registrant (h, what, obj);
}
10. makeInboundSmsHandler
frameworks\opt\telephony\src\java\com\android\internal\telephony\cdma\CdmaInboundSmsHandler.java
public static CdmaInboundSmsHandler makeInboundSmsHandler(Context context,
SmsStorageMonitor storageMonitor, Phone phone, CdmaSMSDispatcher smsDispatcher) {
CdmaInboundSmsHandler handler = new CdmaInboundSmsHandler(context, storageMonitor, phone, smsDispatcher);
handler.start();
return handler;
}
frameworks\opt\telephony\src\java\com\android\internal\telephony\cdma\CdmaInboundSmsHandler.java
private CdmaInboundSmsHandler(Context context, SmsStorageMonitor storageMonitor,
Phone phone, CdmaSMSDispatcher smsDispatcher) {
super("CdmaInboundSmsHandler", context, storageMonitor, phone,
CellBroadcastHandler.makeCellBroadcastHandler(context, phone));
mSmsDispatcher = smsDispatcher;
mServiceCategoryProgramHandler = CdmaServiceCategoryProgramHandler.makeScpHandler(context, phone.mCi);
phone.mCi.setOnNewCdmaSms(getHandler(), EVENT_NEW_SMS, null);
}
frameworks\opt\telephony\src\java\com\android\internal\telephony\BaseCommands.java
public void setOnNewCdmaSms(Handler h, int what, Object obj) {
mCdmaSmsRegistrant = new Registrant (h, what, obj);
}