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

Commit ef4fb5a8 authored by James Lin's avatar James Lin Committed by Automerger Merge Worker
Browse files

Merge "[RCS UCE] Fix the error of the pidf data conversion" am: 23f045d8

Original change: https://android-review.googlesource.com/c/platform/frameworks/opt/net/ims/+/1557443

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I673b6b9e453a5dd117ada4743aac7de23f5e2ee4
parents 0a3be220 23f045d8
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -191,6 +191,12 @@ public class PidfParser {
            builder.addContactUri(Uri.parse(contact));
        }

        // Timestamp
        String timestamp = PidfParserUtils.getTupleTimestamp(tuple);
        if (!TextUtils.isEmpty(timestamp)) {
            builder.addTimeStamp(timestamp);
        }

        // Service description
        if (!TextUtils.isEmpty(description)) {
            builder.addDescription(description);
@@ -227,7 +233,7 @@ public class PidfParser {
                }

                if (notSupportedTypes != null && !notSupportedTypes.isEmpty()) {
                    for (String notSupportedType : supportedTypes) {
                    for (String notSupportedType : notSupportedTypes) {
                        capabilitiesBuilder.addUnsupportedDuplexMode(notSupportedType);
                    }
                }
+4 −2
Original line number Diff line number Diff line
@@ -144,11 +144,13 @@ public class PidfParserUtils {
        }

        // Add the Service Description element into the tuple
        if (serviceIdElement != null && versionElement != null && descriptionElement != null) {
        if (serviceIdElement != null && versionElement != null) {
            ServiceDescription serviceDescription = new ServiceDescription();
            serviceDescription.setServiceId(serviceIdElement);
            serviceDescription.setVersion(versionElement);
            if (descriptionElement != null) {
                serviceDescription.setDescription(descriptionElement);
            }
            tupleElement.setServiceDescription(serviceDescription);
        }
    }
+4 −0
Original line number Diff line number Diff line
@@ -93,6 +93,7 @@ public class PidfParserTest extends ImsTestBase {
        assertEquals("service_id_01", presenceTuple1.getServiceId());
        assertEquals("1.0", presenceTuple1.getServiceVersion());
        assertEquals("description_test1", presenceTuple1.getServiceDescription());
        assertEquals("2001-01-01T01:00:000Z", presenceTuple1.getTimestamp());
        assertEquals(Uri.fromParts("sip", "test", null), presenceTuple1.getContactUri());
        assertTrue(presenceTuple1.getServiceCapabilities().isAudioCapable());
        assertTrue(presenceTuple1.getServiceCapabilities().isVideoCapable());
@@ -101,6 +102,7 @@ public class PidfParserTest extends ImsTestBase {
        assertEquals("service_id_02", presenceTuple2.getServiceId());
        assertEquals("1.0", presenceTuple2.getServiceVersion());
        assertEquals("description_test2", presenceTuple2.getServiceDescription());
        assertEquals("2001-02-02T01:00:000Z", presenceTuple2.getTimestamp());
        assertEquals(Uri.fromParts("sip", "test", null), presenceTuple2.getContactUri());
        assertTrue(presenceTuple2.getServiceCapabilities().isAudioCapable());
        assertFalse(presenceTuple2.getServiceCapabilities().isVideoCapable());
@@ -185,6 +187,7 @@ public class PidfParserTest extends ImsTestBase {
                .append("<caps:video>true</caps:video>")
                .append("</caps:servcaps>")
                .append("<contact>sip:test</contact>")
                .append("<timestamp>2001-01-01T01:00:000Z</timestamp>")
                .append("</tuple>")
                // tuple 2
                .append("<tuple id=\"tid1\"><status><basic>open</basic></status>")
@@ -200,6 +203,7 @@ public class PidfParserTest extends ImsTestBase {
                .append("<caps:video>false</caps:video>")
                .append("</caps:servcaps>")
                .append("<contact>sip:test</contact>")
                .append("<timestamp>2001-02-02T01:00:000Z</timestamp>")
                .append("</tuple></presence>");

        return pidfBuilder.toString();