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

Commit b97addd5 authored by Jesse Fuentes's avatar Jesse Fuentes
Browse files

SMS: Add UT case for getting recipient address of SubmitPdu

The method getDisplayOriginatingAddress() return null for submit
pdu, it will cause applicatoin can not get address of sent message.
Thread ID unable be created for this invalid message record.

Add UT case for new API getRecipientAddress().

Bug: 73012819
Change-Id: I81b377f3950fc271fe82b7d974ec6a21cca2316c
parent 161a5586
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -47,6 +47,14 @@ public class GsmSmsTest extends AndroidTestCase {
        assertEquals("*#abc#*51", sms.getOriginatingAddress());
    }

    @SmallTest
    public void testRecipientAddress() throws Exception {
        String pdu = "0891683108200505F011000D91683196032930F000000006C8329BFD0E01";
        SmsMessage sms = SmsMessage.createFromPdu(HexDump.hexStringToByteArray(pdu));
        assertEquals("+8613800250500", sms.getServiceCenterAddress());
        assertEquals("+8613693092030", sms.getRecipientAddress());
    }

    @SmallTest
    public void testUdh() throws Exception {
        String pdu = "07914140279510F6440A8111110301003BF56080207130138A8C0B05040B8423F"
+8 −0
Original line number Diff line number Diff line
@@ -114,6 +114,14 @@ public class CdmaSmsTest extends AndroidTestCase {
        assertEquals(CdmaSmsAddress.parse("f\u0080oo bar"), null);
    }

    @SmallTest
    public void testRecipientAddress() throws Exception {
        String pdu = "011a0000001002080d0003100160010610262d5ab500040401448888";
        SmsMessage sms = SmsMessage.createFromEfRecord(0,
                HexDump.hexStringToByteArray(pdu));
        assertEquals("12222", sms.getRecipientAddress());
    }

    @SmallTest
    public void testUserData7bitGsm() throws Exception {
        String pdu = "00031040900112488ea794e074d69e1b7392c270326cde9e98";