Loading src/java/com/android/ims/rcs/uce/presence/pidfparser/PidfParser.java +7 −1 Original line number Diff line number Diff line Loading @@ -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); Loading Loading @@ -227,7 +233,7 @@ public class PidfParser { } if (notSupportedTypes != null && !notSupportedTypes.isEmpty()) { for (String notSupportedType : supportedTypes) { for (String notSupportedType : notSupportedTypes) { capabilitiesBuilder.addUnsupportedDuplexMode(notSupportedType); } } Loading src/java/com/android/ims/rcs/uce/presence/pidfparser/PidfParserUtils.java +4 −2 Original line number Diff line number Diff line Loading @@ -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); } } Loading tests/src/com/android/ims/rcs/uce/presence/pidfparser/PidfParserTest.java +4 −0 Original line number Diff line number Diff line Loading @@ -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()); Loading @@ -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()); Loading Loading @@ -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>") Loading @@ -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(); Loading Loading
src/java/com/android/ims/rcs/uce/presence/pidfparser/PidfParser.java +7 −1 Original line number Diff line number Diff line Loading @@ -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); Loading Loading @@ -227,7 +233,7 @@ public class PidfParser { } if (notSupportedTypes != null && !notSupportedTypes.isEmpty()) { for (String notSupportedType : supportedTypes) { for (String notSupportedType : notSupportedTypes) { capabilitiesBuilder.addUnsupportedDuplexMode(notSupportedType); } } Loading
src/java/com/android/ims/rcs/uce/presence/pidfparser/PidfParserUtils.java +4 −2 Original line number Diff line number Diff line Loading @@ -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); } } Loading
tests/src/com/android/ims/rcs/uce/presence/pidfparser/PidfParserTest.java +4 −0 Original line number Diff line number Diff line Loading @@ -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()); Loading @@ -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()); Loading Loading @@ -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>") Loading @@ -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(); Loading