Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1d359556 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 9098

* changes:
  CDMA Message Waiting Indication support
parents 6502a380 c84401fb
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -88,7 +88,7 @@ final class CdmaSMSDispatcher extends SMSDispatcher {
        int teleService = sms.getTeleService();
        int teleService = sms.getTeleService();
        boolean handled = false;
        boolean handled = false;


        if (sms.getUserData() == null) {
        if ((sms.getUserData() == null) && (SmsEnvelope.TELESERVICE_MWI != teleService)) {
            if (Config.LOGD) {
            if (Config.LOGD) {
                Log.d(TAG, "Received SMS without user data");
                Log.d(TAG, "Received SMS without user data");
            }
            }
@@ -102,7 +102,8 @@ final class CdmaSMSDispatcher extends SMSDispatcher {
        if (SmsEnvelope.TELESERVICE_WAP == teleService) {
        if (SmsEnvelope.TELESERVICE_WAP == teleService) {
            return processCdmaWapPdu(sms.getUserData(), sms.messageRef,
            return processCdmaWapPdu(sms.getUserData(), sms.messageRef,
                    sms.getOriginatingAddress());
                    sms.getOriginatingAddress());
        } else if (SmsEnvelope.TELESERVICE_VMN == teleService) {
        } else if ((SmsEnvelope.TELESERVICE_VMN == teleService) ||
                   (SmsEnvelope.TELESERVICE_MWI == teleService)) {
            // handling Voicemail
            // handling Voicemail
            int voicemailCount = sms.getNumOfVoicemails();
            int voicemailCount = sms.getNumOfVoicemails();
            Log.d(TAG, "Voicemail count=" + voicemailCount);
            Log.d(TAG, "Voicemail count=" + voicemailCount);
+13 −0
Original line number Original line Diff line number Diff line
@@ -527,6 +527,19 @@ public class SmsMessage extends SmsMessageBase {
     * Parses a SMS message from its BearerData stream. (mobile-terminated only)
     * Parses a SMS message from its BearerData stream. (mobile-terminated only)
     */
     */
    protected void parseSms() {
    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);
        mBearerData = BearerData.decode(mEnvelope.bearerData);
        messageRef = mBearerData.messageId;
        messageRef = mBearerData.messageId;
        if (mBearerData.userData != null) {
        if (mBearerData.userData != null) {
+8 −0
Original line number Original line Diff line number Diff line
@@ -36,6 +36,14 @@ public final class SmsEnvelope{
    static public final int TELESERVICE_WAP               = 0x1004;
    static public final int TELESERVICE_WAP               = 0x1004;
    static public final int TELESERVICE_WEMT              = 0x1005;
    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
    // ServiceCategories for Cell Broadcast, see 3GPP2 C.R1001 table 9.3.1-1
    //static public final int SERVICECATEGORY_EMERGENCY      = 0x0010;
    //static public final int SERVICECATEGORY_EMERGENCY      = 0x0010;
    //...
    //...