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

Commit a2b94d78 authored by Taesu Lee's avatar Taesu Lee
Browse files

Use correct PLMN info for an incoming CB-SMS



Create SmsCbMessage for an incoming CDMA CB-SMS with PLMN info
associated with a phone in multi-SIM.

Test: Manual
      run atest FrameworksTelephonyTests:CdmaSmsCbTest

Change-Id: Ic177e45e3ab3550e8c32ed9e2c74e64b85af34c4
Signed-off-by: default avatarTaesu Lee <taesu82.lee@samsung.com>
parent 5cf41e47
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@ import android.os.SystemProperties;
import android.telephony.PhoneNumberUtils;
import android.telephony.SmsCbLocation;
import android.telephony.SmsCbMessage;
import android.telephony.TelephonyManager;
import android.telephony.cdma.CdmaSmsCbProgramData;
import android.telephony.Rlog;
import android.util.Log;
@@ -746,8 +745,10 @@ public class SmsMessage extends SmsMessageBase {

    /**
     * Parses a broadcast SMS, possibly containing a CMAS alert.
     *
     * @param plmn the PLMN for a broadcast SMS
     */
    public SmsCbMessage parseBroadcastSms() {
    public SmsCbMessage parseBroadcastSms(String plmn) {
        BearerData bData = BearerData.decode(mEnvelope.bearerData, mEnvelope.serviceCategory);
        if (bData == null) {
            Rlog.w(LOG_TAG, "BearerData.decode() returned null");
@@ -758,7 +759,6 @@ public class SmsMessage extends SmsMessageBase {
            Rlog.d(LOG_TAG, "MT raw BearerData = " + HexDump.toHexString(mEnvelope.bearerData));
        }

        String plmn = TelephonyManager.getDefault().getNetworkOperator();
        SmsCbLocation location = new SmsCbLocation(plmn);

        return new SmsCbMessage(SmsCbMessage.MESSAGE_FORMAT_3GPP2,