Set mOriginatingAddress and mRecipientAddress separately
Properly assign the address according to the parameters in the PDU for 3GPP2 SMS. mOriginatingAddress or mRecipientAddress should be used to get the address according to the actual message type. And the destination subaddress is added also. Test: Manual Change-Id: Ide734b7348ea5eb8cf460dac046e96609ed9d8b3 Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
This commit is contained in:
@@ -96,6 +96,12 @@ public final class SmsEnvelope {
|
||||
*/
|
||||
public CdmaSmsSubaddress origSubaddress;
|
||||
|
||||
/**
|
||||
* The destination subaddress identifies the target of the SMS message.
|
||||
* (See 3GPP2 C.S0015-B, v2, 3.4.3.4)
|
||||
*/
|
||||
public CdmaSmsSubaddress destSubaddress;
|
||||
|
||||
/**
|
||||
* The 6-bit bearer reply parameter is used to request the return of a
|
||||
* SMS Acknowledge Message.
|
||||
|
||||
@@ -613,10 +613,11 @@ public class SmsMessage extends SmsMessageBase {
|
||||
}
|
||||
addr.origBytes = data;
|
||||
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
|
||||
if (parameterId == ORIGINATING_ADDRESS) {
|
||||
env.origAddress = addr;
|
||||
mOriginatingAddress = addr;
|
||||
} else {
|
||||
env.destAddress = addr;
|
||||
mRecipientAddress = addr;
|
||||
}
|
||||
break;
|
||||
@@ -634,6 +635,11 @@ public class SmsMessage extends SmsMessageBase {
|
||||
subdata[index] = convertDtmfToAscii(b);
|
||||
}
|
||||
subAddr.origBytes = subdata;
|
||||
if (parameterId == ORIGINATING_SUB_ADDRESS) {
|
||||
env.origSubaddress = subAddr;
|
||||
} else {
|
||||
env.destSubaddress = subAddr;
|
||||
}
|
||||
break;
|
||||
case BEARER_REPLY_OPTION:
|
||||
dis.read(parameterData, 0, parameterLen);
|
||||
@@ -663,9 +669,6 @@ public class SmsMessage extends SmsMessageBase {
|
||||
}
|
||||
|
||||
// link the filled objects to this SMS
|
||||
mOriginatingAddress = addr;
|
||||
env.origAddress = addr;
|
||||
env.origSubaddress = subAddr;
|
||||
mEnvelope = env;
|
||||
mPdu = pdu;
|
||||
|
||||
@@ -704,12 +707,12 @@ public class SmsMessage extends SmsMessageBase {
|
||||
|
||||
if (mOriginatingAddress != null) {
|
||||
decodeSmsDisplayAddress(mOriginatingAddress);
|
||||
if (VDBG) Rlog.v(LOG_TAG, "SMS originating address: "
|
||||
+ mOriginatingAddress.address);
|
||||
if (VDBG) Rlog.v(LOG_TAG, "SMS originating address: " + mOriginatingAddress.address);
|
||||
}
|
||||
|
||||
if (mRecipientAddress != null) {
|
||||
decodeSmsDisplayAddress(mRecipientAddress);
|
||||
if (VDBG) Rlog.v(LOG_TAG, "SMS destination address: " + mRecipientAddress.address);
|
||||
}
|
||||
|
||||
if (mBearerData.msgCenterTimeStamp != null) {
|
||||
|
||||
Reference in New Issue
Block a user