Loading telephony/java/android/telephony/SmsMessage.java +9 −0 Original line number Original line Diff line number Diff line Loading @@ -981,4 +981,13 @@ public class SmsMessage { return false; return false; } } /** * {@hide} * Returns the recipient address(receiver) of this SMS message in String form or null if * unavailable. */ public String getRecipientAddress() { return mWrappedSmsMessage.getRecipientAddress(); } } } telephony/java/com/android/internal/telephony/SmsMessageBase.java +16 −0 Original line number Original line Diff line number Diff line Loading @@ -41,6 +41,9 @@ public abstract class SmsMessageBase { @UnsupportedAppUsage @UnsupportedAppUsage protected SmsAddress mOriginatingAddress; protected SmsAddress mOriginatingAddress; /** {@hide} The address of the receiver */ protected SmsAddress mRecipientAddress; /** {@hide} The message body as a string. May be null if the message isn't text */ /** {@hide} The message body as a string. May be null if the message isn't text */ @UnsupportedAppUsage @UnsupportedAppUsage protected String mMessageBody; protected String mMessageBody; Loading Loading @@ -457,4 +460,17 @@ public abstract class SmsMessageBase { return ted; return ted; } } /** * {@hide} * Returns the receiver address of this SMS message in String * form or null if unavailable */ public String getRecipientAddress() { if (mRecipientAddress == null) { return null; } return mRecipientAddress.getAddressString(); } } } telephony/java/com/android/internal/telephony/cdma/SmsMessage.java +28 −12 Original line number Original line Diff line number Diff line Loading @@ -601,18 +601,24 @@ public class SmsMessage extends SmsMessageBase { } else if (addr.numberMode == CdmaSmsAddress.NUMBER_MODE_DATA_NETWORK) { } else if (addr.numberMode == CdmaSmsAddress.NUMBER_MODE_DATA_NETWORK) { if (numberType == 2) if (numberType == 2) Rlog.e(LOG_TAG, "TODO: Originating Addr is email id"); Rlog.e(LOG_TAG, "TODO: Addr is email id"); else else Rlog.e(LOG_TAG, Rlog.e(LOG_TAG, "TODO: Originating Addr is data network address"); "TODO: Addr is data network address"); } else { } else { Rlog.e(LOG_TAG, "Originating Addr is of incorrect type"); Rlog.e(LOG_TAG, "Addr is of incorrect type"); } } } else { } else { Rlog.e(LOG_TAG, "Incorrect Digit mode"); Rlog.e(LOG_TAG, "Incorrect Digit mode"); } } addr.origBytes = data; addr.origBytes = data; Rlog.i(LOG_TAG, "Originating Addr=" + addr.toString()); Rlog.pii(LOG_TAG, "Addr=" + addr.toString()); mOriginatingAddress = addr; if (parameterId == DESTINATION_ADDRESS) { // Original address awlays indicates one sender's address for 3GPP2 // Here add recipient address support along with 3GPP mRecipientAddress = addr; } break; break; case ORIGINATING_SUB_ADDRESS: case ORIGINATING_SUB_ADDRESS: case DESTINATION_SUB_ADDRESS: case DESTINATION_SUB_ADDRESS: Loading Loading @@ -667,7 +673,7 @@ public class SmsMessage extends SmsMessageBase { } } /** /** * Parses a SMS message from its BearerData stream. (mobile-terminated only) * Parses a SMS message from its BearerData stream. */ */ public void parseSms() { public void parseSms() { // Message Waiting Info Record defined in 3GPP2 C.S-0005, 3.7.5.6 // Message Waiting Info Record defined in 3GPP2 C.S-0005, 3.7.5.6 Loading Loading @@ -697,16 +703,15 @@ public class SmsMessage extends SmsMessageBase { } } if (mOriginatingAddress != null) { if (mOriginatingAddress != null) { mOriginatingAddress.address = new String(mOriginatingAddress.origBytes); decodeSmsDisplayAddress(mOriginatingAddress); if (mOriginatingAddress.ton == CdmaSmsAddress.TON_INTERNATIONAL_OR_IP) { if (mOriginatingAddress.address.charAt(0) != '+') { mOriginatingAddress.address = "+" + mOriginatingAddress.address; } } if (VDBG) Rlog.v(LOG_TAG, "SMS originating address: " if (VDBG) Rlog.v(LOG_TAG, "SMS originating address: " + mOriginatingAddress.address); + mOriginatingAddress.address); } } if (mRecipientAddress != null) { decodeSmsDisplayAddress(mRecipientAddress); } if (mBearerData.msgCenterTimeStamp != null) { if (mBearerData.msgCenterTimeStamp != null) { mScTimeMillis = mBearerData.msgCenterTimeStamp.toMillis(true); mScTimeMillis = mBearerData.msgCenterTimeStamp.toMillis(true); } } Loading @@ -731,7 +736,8 @@ public class SmsMessage extends SmsMessageBase { status = mBearerData.errorClass << 8; status = mBearerData.errorClass << 8; status |= mBearerData.messageStatus; status |= mBearerData.messageStatus; } } } else if (mBearerData.messageType != BearerData.MESSAGE_TYPE_DELIVER) { } else if (mBearerData.messageType != BearerData.MESSAGE_TYPE_DELIVER && mBearerData.messageType != BearerData.MESSAGE_TYPE_SUBMIT) { throw new RuntimeException("Unsupported message type: " + mBearerData.messageType); throw new RuntimeException("Unsupported message type: " + mBearerData.messageType); } } Loading @@ -743,6 +749,16 @@ public class SmsMessage extends SmsMessageBase { } } } } private void decodeSmsDisplayAddress(SmsAddress addr) { addr.address = new String(addr.origBytes); if (addr.ton == CdmaSmsAddress.TON_INTERNATIONAL_OR_IP) { if (addr.address.charAt(0) != '+') { addr.address = "+" + addr.address; } } Rlog.pii(LOG_TAG, " decodeSmsDisplayAddress = " + addr.address); } /** /** * Parses a broadcast SMS, possibly containing a CMAS alert. * Parses a broadcast SMS, possibly containing a CMAS alert. * * Loading telephony/java/com/android/internal/telephony/gsm/SmsMessage.java +0 −3 Original line number Original line Diff line number Diff line Loading @@ -71,9 +71,6 @@ public class SmsMessage extends SmsMessageBase { // e.g. 23.040 9.2.2.1 // e.g. 23.040 9.2.2.1 private boolean mReplyPathPresent = false; private boolean mReplyPathPresent = false; /** The address of the receiver. */ private GsmSmsAddress mRecipientAddress; /** /** * TP-Status - status of a previously submitted SMS. * TP-Status - status of a previously submitted SMS. * This field applies to SMS-STATUS-REPORT messages. 0 indicates success; * This field applies to SMS-STATUS-REPORT messages. 0 indicates success; Loading Loading
telephony/java/android/telephony/SmsMessage.java +9 −0 Original line number Original line Diff line number Diff line Loading @@ -981,4 +981,13 @@ public class SmsMessage { return false; return false; } } /** * {@hide} * Returns the recipient address(receiver) of this SMS message in String form or null if * unavailable. */ public String getRecipientAddress() { return mWrappedSmsMessage.getRecipientAddress(); } } }
telephony/java/com/android/internal/telephony/SmsMessageBase.java +16 −0 Original line number Original line Diff line number Diff line Loading @@ -41,6 +41,9 @@ public abstract class SmsMessageBase { @UnsupportedAppUsage @UnsupportedAppUsage protected SmsAddress mOriginatingAddress; protected SmsAddress mOriginatingAddress; /** {@hide} The address of the receiver */ protected SmsAddress mRecipientAddress; /** {@hide} The message body as a string. May be null if the message isn't text */ /** {@hide} The message body as a string. May be null if the message isn't text */ @UnsupportedAppUsage @UnsupportedAppUsage protected String mMessageBody; protected String mMessageBody; Loading Loading @@ -457,4 +460,17 @@ public abstract class SmsMessageBase { return ted; return ted; } } /** * {@hide} * Returns the receiver address of this SMS message in String * form or null if unavailable */ public String getRecipientAddress() { if (mRecipientAddress == null) { return null; } return mRecipientAddress.getAddressString(); } } }
telephony/java/com/android/internal/telephony/cdma/SmsMessage.java +28 −12 Original line number Original line Diff line number Diff line Loading @@ -601,18 +601,24 @@ public class SmsMessage extends SmsMessageBase { } else if (addr.numberMode == CdmaSmsAddress.NUMBER_MODE_DATA_NETWORK) { } else if (addr.numberMode == CdmaSmsAddress.NUMBER_MODE_DATA_NETWORK) { if (numberType == 2) if (numberType == 2) Rlog.e(LOG_TAG, "TODO: Originating Addr is email id"); Rlog.e(LOG_TAG, "TODO: Addr is email id"); else else Rlog.e(LOG_TAG, Rlog.e(LOG_TAG, "TODO: Originating Addr is data network address"); "TODO: Addr is data network address"); } else { } else { Rlog.e(LOG_TAG, "Originating Addr is of incorrect type"); Rlog.e(LOG_TAG, "Addr is of incorrect type"); } } } else { } else { Rlog.e(LOG_TAG, "Incorrect Digit mode"); Rlog.e(LOG_TAG, "Incorrect Digit mode"); } } addr.origBytes = data; addr.origBytes = data; Rlog.i(LOG_TAG, "Originating Addr=" + addr.toString()); Rlog.pii(LOG_TAG, "Addr=" + addr.toString()); mOriginatingAddress = addr; if (parameterId == DESTINATION_ADDRESS) { // Original address awlays indicates one sender's address for 3GPP2 // Here add recipient address support along with 3GPP mRecipientAddress = addr; } break; break; case ORIGINATING_SUB_ADDRESS: case ORIGINATING_SUB_ADDRESS: case DESTINATION_SUB_ADDRESS: case DESTINATION_SUB_ADDRESS: Loading Loading @@ -667,7 +673,7 @@ public class SmsMessage extends SmsMessageBase { } } /** /** * Parses a SMS message from its BearerData stream. (mobile-terminated only) * Parses a SMS message from its BearerData stream. */ */ public void parseSms() { public void parseSms() { // Message Waiting Info Record defined in 3GPP2 C.S-0005, 3.7.5.6 // Message Waiting Info Record defined in 3GPP2 C.S-0005, 3.7.5.6 Loading Loading @@ -697,16 +703,15 @@ public class SmsMessage extends SmsMessageBase { } } if (mOriginatingAddress != null) { if (mOriginatingAddress != null) { mOriginatingAddress.address = new String(mOriginatingAddress.origBytes); decodeSmsDisplayAddress(mOriginatingAddress); if (mOriginatingAddress.ton == CdmaSmsAddress.TON_INTERNATIONAL_OR_IP) { if (mOriginatingAddress.address.charAt(0) != '+') { mOriginatingAddress.address = "+" + mOriginatingAddress.address; } } if (VDBG) Rlog.v(LOG_TAG, "SMS originating address: " if (VDBG) Rlog.v(LOG_TAG, "SMS originating address: " + mOriginatingAddress.address); + mOriginatingAddress.address); } } if (mRecipientAddress != null) { decodeSmsDisplayAddress(mRecipientAddress); } if (mBearerData.msgCenterTimeStamp != null) { if (mBearerData.msgCenterTimeStamp != null) { mScTimeMillis = mBearerData.msgCenterTimeStamp.toMillis(true); mScTimeMillis = mBearerData.msgCenterTimeStamp.toMillis(true); } } Loading @@ -731,7 +736,8 @@ public class SmsMessage extends SmsMessageBase { status = mBearerData.errorClass << 8; status = mBearerData.errorClass << 8; status |= mBearerData.messageStatus; status |= mBearerData.messageStatus; } } } else if (mBearerData.messageType != BearerData.MESSAGE_TYPE_DELIVER) { } else if (mBearerData.messageType != BearerData.MESSAGE_TYPE_DELIVER && mBearerData.messageType != BearerData.MESSAGE_TYPE_SUBMIT) { throw new RuntimeException("Unsupported message type: " + mBearerData.messageType); throw new RuntimeException("Unsupported message type: " + mBearerData.messageType); } } Loading @@ -743,6 +749,16 @@ public class SmsMessage extends SmsMessageBase { } } } } private void decodeSmsDisplayAddress(SmsAddress addr) { addr.address = new String(addr.origBytes); if (addr.ton == CdmaSmsAddress.TON_INTERNATIONAL_OR_IP) { if (addr.address.charAt(0) != '+') { addr.address = "+" + addr.address; } } Rlog.pii(LOG_TAG, " decodeSmsDisplayAddress = " + addr.address); } /** /** * Parses a broadcast SMS, possibly containing a CMAS alert. * Parses a broadcast SMS, possibly containing a CMAS alert. * * Loading
telephony/java/com/android/internal/telephony/gsm/SmsMessage.java +0 −3 Original line number Original line Diff line number Diff line Loading @@ -71,9 +71,6 @@ public class SmsMessage extends SmsMessageBase { // e.g. 23.040 9.2.2.1 // e.g. 23.040 9.2.2.1 private boolean mReplyPathPresent = false; private boolean mReplyPathPresent = false; /** The address of the receiver. */ private GsmSmsAddress mRecipientAddress; /** /** * TP-Status - status of a previously submitted SMS. * TP-Status - status of a previously submitted SMS. * This field applies to SMS-STATUS-REPORT messages. 0 indicates success; * This field applies to SMS-STATUS-REPORT messages. 0 indicates success; Loading