mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-25 12:38:39 +00:00
Publish TURN-only ICE candidates in some situations
1) Incoming call is from a number not in user's address book 2) Turn-only preference is enabled for all incoming/outgoing calls // FREEBIE
This commit is contained in:
@@ -61,6 +61,23 @@ public class ContactAccessor {
|
||||
return instance;
|
||||
}
|
||||
|
||||
public boolean isSystemContact(Context context, String number) {
|
||||
Uri uri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, Uri.encode(number));
|
||||
String[] projection = new String[]{PhoneLookup.DISPLAY_NAME, PhoneLookup.LOOKUP_KEY,
|
||||
PhoneLookup._ID, PhoneLookup.NUMBER};
|
||||
Cursor cursor = context.getContentResolver().query(uri, projection, null, null, null);
|
||||
|
||||
try {
|
||||
if (cursor != null && cursor.moveToFirst()) {
|
||||
return true;
|
||||
}
|
||||
} finally {
|
||||
if (cursor != null) cursor.close();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public Collection<ContactData> getContactsWithPush(Context context) {
|
||||
final ContentResolver resolver = context.getContentResolver();
|
||||
final String[] inProjection = new String[]{PhoneLookup._ID, PhoneLookup.DISPLAY_NAME};
|
||||
|
||||
Reference in New Issue
Block a user