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

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

Use createFromPdu() in common



Replace newFromCMT() and newFromCDS() with createFromPdu().

Bug: 160847655
Test: build and MT SMS

Signed-off-by: default avatarTaesu Lee <taesu82.lee@samsung.com>
Change-Id: I2a21020b44a0b3829e72927211dabf8d00b659ee
parent ade0160e
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -166,9 +166,10 @@ public class RadioIndication extends IRadioIndication.Stub {
        byte[] pduArray = RIL.arrayListToPrimitiveArray(pdu);
        if (RIL.RILJ_LOGD) mRil.unsljLog(RIL_UNSOL_RESPONSE_NEW_SMS);

        SmsMessage sms = SmsMessage.newFromCMT(pduArray);
        SmsMessageBase smsb = com.android.internal.telephony.gsm.SmsMessage.createFromPdu(pduArray);
        if (mRil.mGsmSmsRegistrant != null) {
            mRil.mGsmSmsRegistrant.notifyRegistrant(new AsyncResult(null, sms, null));
            mRil.mGsmSmsRegistrant.notifyRegistrant(
                    new AsyncResult(null, smsb == null ? null : new SmsMessage(smsb), null));
        }
    }

+1 −1
Original line number Diff line number Diff line
@@ -827,7 +827,7 @@ public class SmsDispatchersController extends Handler {
    private Pair<Boolean, Boolean> handleGsmStatusReport(SMSDispatcher.SmsTracker tracker,
            String format, byte[] pdu) {
        com.android.internal.telephony.gsm.SmsMessage sms =
                com.android.internal.telephony.gsm.SmsMessage.newFromCDS(pdu);
                com.android.internal.telephony.gsm.SmsMessage.createFromPdu(pdu);
        boolean complete = false;
        boolean success = false;
        if (sms != null) {
+5 −5
Original line number Diff line number Diff line
@@ -132,15 +132,15 @@ public final class GsmSMSDispatcher extends SMSDispatcher {
    }

    /**
     * Called when a status report is received.  This should correspond to
     * a previously successful SEND.
     * Called when a status report is received. This should correspond to a previously successful
     * SEND.
     *
     * @param ar AsyncResult passed into the message handler.  ar.result should
     *           be a String representing the status report PDU, as ASCII hex.
     * @param ar AsyncResult passed into the message handler. ar.result should be a byte array for
     *           the status report PDU.
     */
    private void handleStatusReport(AsyncResult ar) {
        byte[] pdu = (byte[]) ar.result;
        SmsMessage sms = SmsMessage.newFromCDS(pdu);
        SmsMessage sms = SmsMessage.createFromPdu(pdu);
        boolean handled = false;

        if (sms != null) {
+0 −1
Original line number Diff line number Diff line
@@ -31,6 +31,5 @@ public class SmsMessageTest {
        assertEquals(null, SmsMessage.createFromPdu(null, SmsConstants.FORMAT_3GPP2));
        assertEquals(null, SmsMessage.createFromPdu(null, SmsConstants.FORMAT_3GPP));
        assertEquals(null, SmsMessage.createFromPdu(null));
        assertEquals(null, SmsMessage.newFromCMT(null));
    }
}