ContactsHelper: Do not split in lines to then join them again

This commit is contained in:
Albert Vaca Cintora
2025-10-04 19:59:59 +02:00
parent 647dd6ca27
commit e2756a113d

View File

@@ -152,10 +152,10 @@ public class ContactsHelper {
try (InputStream input = context.getContentResolver().openInputStream(vcardURI)) { try (InputStream input = context.getContentResolver().openInputStream(vcardURI)) {
if (input == null) { if (input == null) {
throw new NullPointerException("ContentResolver did not give us a stream for the VCard for uID " + ID); Log.w("Contacts", "ContentResolver did not give us a stream for the VCard for uID " + ID);
continue;
} }
final List<String> lines = IOUtils.readLines(input, Charsets.UTF_8); toReturn.put(ID, new VCardBuilder(IOUtils.toString(input, Charsets.UTF_8)));
toReturn.put(ID, new VCardBuilder(StringUtils.join(lines, '\n')));
} catch (Exception e) { } catch (Exception e) {
// If you are experiencing this, please open a bug report indicating how you got here // If you are experiencing this, please open a bug report indicating how you got here
Log.e("Contacts", "Exception while fetching vcards", e); Log.e("Contacts", "Exception while fetching vcards", e);