1.使长短信不能自动转彩信。
2.当短信页数超过12条,使该短信不能发送,并提示客户删除字符。
[SOLUTION]
1.MmsConfigImpl.java中
private static int sSmsToMmsTextThreshold = 4;
把这个值改为999。
private static int sSmsToMmsTextThreshold = 4;
把这个值改为999。
2.在composemessageactivity.java中
a.在updateCounter函数中,对msgCount做判断,若当前大于12页则提醒客户已超过12页,并要求删除字符。
private void updateCounter(CharSequence text, int start, int before, int count) {
......
......
params = SmsMessage.calculateLength(text, false, encodingType);
/* SmsMessage.calculateLength returns an int[4] with:
* int[0] being the number of SMS's required,
* int[1] the number of code units used,
* int[2] is the number of code units remaining until the next message.
* int[3] is the encoding type that should be used for the message.
*/
final int msgCount = params[0];
/* SmsMessage.calculateLength returns an int[4] with:
* int[0] being the number of SMS's required,
* int[1] the number of code units used,
* int[2] is the number of code units remaining until the next message.
* int[3] is the encoding type that should be used for the message.
*/
final int msgCount = params[0];
在这里添加toast提醒客户,并使用全局变量保存msgCount 。
b.在SendButton的onClick函数:
大概6096行:当v == mSendButtonSms的时候,对全局变量做判断,大于12则直接退出函数。