4165
- 收藏
- 点赞
- 分享
- 举报
在Android framework中支持第二个modem
在Android framework中支持第二个modem
1. Overview
在android系统基础上采用双rild方案、最小化的修改framework中的telephony模块来实现第二个modem的支持。主要构造如下:
此改动不影响原有功能的运行,也就是说单模和双模使用同一套代码,第二个模是否支持完全取决于HW的功能,最终通过系统配置来完成的。
新增的API都是在原有的函数功能基础上变化而来,要么变化函数名增加‘Second’关键字,要么增加phone ID函数参数,因此相应的API说明可以参考原有对应功能的API即可,如:
1)PhoneFactory.java:
原有的API为:
public static void makeDefaultPhones(Context context)
public static Phone getDefaultPhone()
为second phone增加的API为:
public static void makeSecondPhone(Context context)
public static Phone getSecondPhone()
2)SmsMessage.java:
原有的API为:
public static int getTPLayerLengthForPDU(String pdu)
为second phone增加的API为:
public static int getTPLayerLengthForPDU(String pdu, int phoneId)
2. framework中的telephony针对应用层的改动点或接口
1) Phone.java
a) Add two ID to match default phone or second phone
static final int PHONE_ID_MAIN;
static final int PHONE_ID_SUB;
b) Add API to return phone ID of phone class instance
public int getPhoneID()
2) StkService.java
Add API to return the StkService instance of second phone
public static getSecondInstance()
3) PhoneFactory.java
a) Add API to create Phone Class instance of second phone
public static void makeSecondPhone(Context context)
b) Add API to return Phone Class instance of second phone
public static Phone getSecondPhone ()
4) TelephonyManager.java
Add API to return the TeleponyManager instance of second phone
public static getSecond()
5) SmsManager.jav
Add API to return the SmsManager instance of second phone
public static getSecond()
6) IccProvider.java
Add ‘icc2’ provider to access second phone book
7) SmsMessage.java
Add lists of the following function with phoneId parameter(based on orignal defines) to support second phone. When use SMS APIs of the following for second phone. phoneId must be applied with Phone.PHONE_ID_SUB( it also can be return with API of getPhoneID())
public static SmsMessage createFromPdu(byte[] pdu, int phoneId)
public static SmsMessage newFromCMT(String[] lines, int phoneId)
protected static SmsMessage newFromCMTI(String line, int phoneId)
public static SmsMessage newFromCDS(String line, int phoneId)
public static SmsMessage newFromParcel(Parcel p, int phoneId)
public static SmsMessage createFromEfRecord(int index, byte[] data, int phoneId)
public static int getTPLayerLengthForPDU(String pdu, int phoneId)
public static int[] calculateLength(CharSequence msgBody, boolean use7bitOnly, int phoneId)
public static int[] calculateLength(String messageBody, boolean use7bitOnly, int phoneId)
public static ArrayList fragmentText(String text, int phoneId)
public static SubmitPdu getSubmitPdu(String scAddress, String destinationAddress, String message, boolean statusReportRequested, byte[] header, int phoneId)
public static SubmitPdu getSubmitPdu(String scAddress, String destinationAddress, String message, boolean statusReportRequested, int phoneId)
public static SubmitPdu getSubmitPdu(String scAddress, String destinationAddress, short destinationPort, byte[] data, boolean statusReportRequested, int phoneId)
3. Phone 应用程序的要求
Phone 应用程序必须要完成两件事才成让framework的telephony模块支持second phone:
a) 调用PhoneFactory中的makeSecondPhone来创建second phone instance
b) create instance of PhoneInterfaceManager with phone parameter which from PhoneFactory.getSecondPhone
4. Emulator的使用
原来的emulator不支持双模运行,为了能够让双模能够在emulator上运行,对emulator进行了修改。目前的定义为:缺省的模走原有功能(通过emulator中的模拟modem来响应AT命令),第二模走PC 串口和手机相连(把手机当成独立的modem来响应AT命令), 因此要在emulator调试双模应用程序需要在运行emulator时增加两个命令选项:
-prop rw.baseband=dualmodem
-radio COM1
调试的过程中要确保手机不要进入sleep模式。
1. Overview
在android系统基础上采用双rild方案、最小化的修改framework中的telephony模块来实现第二个modem的支持。主要构造如下:
此改动不影响原有功能的运行,也就是说单模和双模使用同一套代码,第二个模是否支持完全取决于HW的功能,最终通过系统配置来完成的。
新增的API都是在原有的函数功能基础上变化而来,要么变化函数名增加‘Second’关键字,要么增加phone ID函数参数,因此相应的API说明可以参考原有对应功能的API即可,如:
1)PhoneFactory.java:
原有的API为:
public static void makeDefaultPhones(Context context)
public static Phone getDefaultPhone()
为second phone增加的API为:
public static void makeSecondPhone(Context context)
public static Phone getSecondPhone()
2)SmsMessage.java:
原有的API为:
public static int getTPLayerLengthForPDU(String pdu)
为second phone增加的API为:
public static int getTPLayerLengthForPDU(String pdu, int phoneId)
2. framework中的telephony针对应用层的改动点或接口
1) Phone.java
a) Add two ID to match default phone or second phone
static final int PHONE_ID_MAIN;
static final int PHONE_ID_SUB;
b) Add API to return phone ID of phone class instance
public int getPhoneID()
2) StkService.java
Add API to return the StkService instance of second phone
public static getSecondInstance()
3) PhoneFactory.java
a) Add API to create Phone Class instance of second phone
public static void makeSecondPhone(Context context)
b) Add API to return Phone Class instance of second phone
public static Phone getSecondPhone ()
4) TelephonyManager.java
Add API to return the TeleponyManager instance of second phone
public static getSecond()
5) SmsManager.jav
Add API to return the SmsManager instance of second phone
public static getSecond()
6) IccProvider.java
Add ‘icc2’ provider to access second phone book
7) SmsMessage.java
Add lists of the following function with phoneId parameter(based on orignal defines) to support second phone. When use SMS APIs of the following for second phone. phoneId must be applied with Phone.PHONE_ID_SUB( it also can be return with API of getPhoneID())
public static SmsMessage createFromPdu(byte[] pdu, int phoneId)
public static SmsMessage newFromCMT(String[] lines, int phoneId)
protected static SmsMessage newFromCMTI(String line, int phoneId)
public static SmsMessage newFromCDS(String line, int phoneId)
public static SmsMessage newFromParcel(Parcel p, int phoneId)
public static SmsMessage createFromEfRecord(int index, byte[] data, int phoneId)
public static int getTPLayerLengthForPDU(String pdu, int phoneId)
public static int[] calculateLength(CharSequence msgBody, boolean use7bitOnly, int phoneId)
public static int[] calculateLength(String messageBody, boolean use7bitOnly, int phoneId)
public static ArrayList
public static SubmitPdu getSubmitPdu(String scAddress, String destinationAddress, String message, boolean statusReportRequested, byte[] header, int phoneId)
public static SubmitPdu getSubmitPdu(String scAddress, String destinationAddress, String message, boolean statusReportRequested, int phoneId)
public static SubmitPdu getSubmitPdu(String scAddress, String destinationAddress, short destinationPort, byte[] data, boolean statusReportRequested, int phoneId)
3. Phone 应用程序的要求
Phone 应用程序必须要完成两件事才成让framework的telephony模块支持second phone:
a) 调用PhoneFactory中的makeSecondPhone来创建second phone instance
b) create instance of PhoneInterfaceManager with phone parameter which from PhoneFactory.getSecondPhone
4. Emulator的使用
原来的emulator不支持双模运行,为了能够让双模能够在emulator上运行,对emulator进行了修改。目前的定义为:缺省的模走原有功能(通过emulator中的模拟modem来响应AT命令),第二模走PC 串口和手机相连(把手机当成独立的modem来响应AT命令), 因此要在emulator调试双模应用程序需要在运行emulator时增加两个命令选项:
-prop rw.baseband=dualmodem
-radio COM1
调试的过程中要确保手机不要进入sleep模式。
我来回答
回答0个
时间排序
认可量排序
暂无数据
或将文件直接拖到这里
悬赏:
E币
网盘
* 网盘链接:
* 提取码:
悬赏:
E币
Markdown 语法
- 加粗**内容**
- 斜体*内容*
- 删除线~~内容~~
- 引用> 引用内容
- 代码`代码`
- 代码块```编程语言↵代码```
- 链接[链接标题](url)
- 无序列表- 内容
- 有序列表1. 内容
- 缩进内容
- 图片
相关问答
-
2015-05-13 14:11:14
-
2018-12-13 09:01:44
-
2019-01-28 15:09:41
-
2020-12-08 15:52:00
-
2020-10-29 11:09:36
-
2023-04-07 09:10:07
-
2019-01-31 10:01:45
-
2019-01-24 10:24:24
-
2019-01-29 14:29:53
-
2020-07-06 18:49:01
-
2025-08-19 17:10:02
-
2019-01-22 16:39:22
-
2010-04-12 22:33:05
-
2017-02-14 15:34:18
-
2020-07-31 16:56:35
-
02018-12-12 10:49:32
-
2019-08-01 17:34:08
-
2019-08-06 10:05:30
-
2015-09-22 14:06:31
无更多相似问答 去提问
点击登录
-- 积分
-- E币
提问
—
收益
—
被采纳
—
我要提问
切换马甲
上一页
下一页
悬赏问答
-
100Hi3519DV500移植阿里云aliyun-oss-c-sdk-3.11.2
-
10【悬赏】Hi3519DV500在新打板的硬件上调用svp_acl_mdl_execute 会宕机
-
10海思 PQTools 使用时显示无法注册ae库 awb库
-
50求imx291 mclk37.125M 4lane 1920x1080@30fps WDR的初始化系列
-
5Hi3516DV500-DMEBPLUS_6L_T_LPDDR4_2400M-2GB_32bit-A55_850M.xlsm
-
25鸿鸥派【Hi3519DV500】双摄sc450ai+10.1显示屏点不亮
-
5SS626接WCH HUB芯片CH335F问题
-
10求一份RK3588下IMX586摄像头的IQ json文件
-
50Hi3519DV500+OS04A10 slave驱动 (双目同步问题)
-
103616 3403 FPN标定黑斑问题
举报反馈
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明
提醒
你的问题还没有最佳答案,是否结题,结题后将扣除20%的悬赏金
取消
确认
提醒
你的问题还没有最佳答案,是否结题,结题后将根据回答情况扣除相应悬赏金(1回答=1E币)
取消
确认

微信扫码分享
QQ好友