2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-30 21:55:10 +00:00

Do not return duplicate contact uIDs because it will crash kdeconnectd

This commit is contained in:
Erik Duisters
2019-08-31 11:11:58 +02:00
parent 6fea429fab
commit 779d5e625a

View File

@@ -32,6 +32,10 @@ import android.util.Base64;
import android.util.Base64OutputStream;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
import androidx.collection.LongSparseArray;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -46,10 +50,6 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
import androidx.collection.LongSparseArray;
public class ContactsHelper {
@@ -144,7 +144,9 @@ public class ContactsHelper {
continue;
}
toReturn.add(contactID);
if (!toReturn.contains(contactID)) {
toReturn.add(contactID);
}
} while (contactsCursor.moveToNext());
}
}