Android 2.3发短信详细流程(2)
3. 第二阶段:IccSmsInterfaceManagerProxy.java(frameworks/base/telephony/java/com/android/internal/telephony/IccSmsInterfaceManagerProxy)
我们看IccSmsInterfaceManagerProxy的sendText()方法核心代码:
view plaincopy to clipboardprint?private IccSmsInterfaceManager mIccSmsInterfaceManager;
......
public void sendText(String destAddr, String scAddr,
String text, PendingIntent sentIntent, PendingIntent deliveryIntent) {
mIccSmsInterfaceManager.sendText(destAddr, scAddr, text, sentIntent, deliveryIntent);
}
private IccSmsInterfaceManager mIccSmsInterfaceManager;
......
public void sendText(String destAddr, String scAddr,
String text, PendingIntent sentIntent, PendingIntent deliveryIntent) {
mIccSmsInterfaceManager.sendText(destAddr, scAddr, text, sentIntent, deliveryIntent);
}
继续调用,此时调用的是IccSmsInterfaceManager对象的sendText()方法,那IccSmsInterfaceManager是什么玩意??
4. 第三阶段:IccSmsInterfaceManager.java(frameworks/base/telephony/java/com/android/internal/telephony/IccSmsInterfaceManager.java)
从代码看出IccSmsInterfaceManager是一个继承了ISms.Stub的抽象类,相关核心代码如下:
view plaincopy to clipboardprint?protected SMSDispatcher mDispatcher;
public void sendText(String destAddr, String scAddr,
String text, PendingIntent sentIntent, PendingIntent deliveryIntent) {
mPhone.getContext().enforceCallingPermission(
"android.permission.SEND_SMS",
"Sending SMS message");
if (Log.isLoggable("SMS", Log.VERBOSE)) {
log("sendText: destAddr=" + destAddr + " scAddr=" + scAddr +
" text='"+ text + "' sentIntent=" +
sentIntent + " deliveryIntent=" + deliveryIntent);
}
mDispatcher.sendText(destAddr, scAddr, text, sentIntent, deliveryIntent);
}
protected SMSDispatcher mDispatcher;
相关新闻>>
- 发表评论
-
- 最新评论 更多>>