Merge change 9098

* changes:
  CDMA Message Waiting Indication support
This commit is contained in:
Android (Google) Code Review
2009-07-29 21:47:16 -07:00
3 changed files with 25 additions and 3 deletions

View File

@@ -88,7 +88,7 @@ final class CdmaSMSDispatcher extends SMSDispatcher {
int teleService = sms.getTeleService();
boolean handled = false;
if (sms.getUserData() == null) {
if ((sms.getUserData() == null) && (SmsEnvelope.TELESERVICE_MWI != teleService)) {
if (Config.LOGD) {
Log.d(TAG, "Received SMS without user data");
}
@@ -99,10 +99,11 @@ final class CdmaSMSDispatcher extends SMSDispatcher {
return Intents.RESULT_SMS_HANDLED;
}
if (SmsEnvelope.TELESERVICE_WAP == teleService){
if (SmsEnvelope.TELESERVICE_WAP == teleService) {
return processCdmaWapPdu(sms.getUserData(), sms.messageRef,
sms.getOriginatingAddress());
} else if (SmsEnvelope.TELESERVICE_VMN == teleService) {
} else if ((SmsEnvelope.TELESERVICE_VMN == teleService) ||
(SmsEnvelope.TELESERVICE_MWI == teleService)) {
// handling Voicemail
int voicemailCount = sms.getNumOfVoicemails();
Log.d(TAG, "Voicemail count=" + voicemailCount);

View File

@@ -527,6 +527,19 @@ public class SmsMessage extends SmsMessageBase {
* Parses a SMS message from its BearerData stream. (mobile-terminated only)
*/
protected void parseSms() {
// Message Waiting Info Record defined in 3GPP2 C.S-0005, 3.7.5.6
// It contains only an 8-bit number with the number of messages waiting
if (mEnvelope.teleService == SmsEnvelope.TELESERVICE_MWI) {
mBearerData = new BearerData();
if (mEnvelope.bearerData != null) {
mBearerData.numberOfMessages = 0x000000FF & mEnvelope.bearerData[0];
}
if (Config.DEBUG) {
Log.d(LOG_TAG, "parseSms: get MWI " +
Integer.toString(mBearerData.numberOfMessages));
}
return;
}
mBearerData = BearerData.decode(mEnvelope.bearerData);
messageRef = mBearerData.messageId;
if (mBearerData.userData != null) {

View File

@@ -36,6 +36,14 @@ public final class SmsEnvelope{
static public final int TELESERVICE_WAP = 0x1004;
static public final int TELESERVICE_WEMT = 0x1005;
/**
* The following are defined as extensions to the standard teleservices
*/
// Voice mail notification through Message Waiting Indication in CDMA mode or Analog mode.
// Defined in 3GPP2 C.S-0005, 3.7.5.6, an Info Record containing an 8-bit number with the
// number of messages waiting, it's used by some CDMA carriers for a voice mail count.
static public final int TELESERVICE_MWI = 0x40000;
// ServiceCategories for Cell Broadcast, see 3GPP2 C.R1001 table 9.3.1-1
//static public final int SERVICECATEGORY_EMERGENCY = 0x0010;
//...