mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-11 20:49:25 +01:00
Also check work profile for number lookup
This commit is contained in:
parent
f01c9414f5
commit
aa6b0b7d5f
@ -23,6 +23,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.provider.ContactsContract;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -406,7 +407,12 @@ public class GBDeviceService implements DeviceService {
|
||||
* @return contact DisplayName, if found it
|
||||
*/
|
||||
private String getContactDisplayNameByNumber(String number) {
|
||||
Uri uri = Uri.withAppendedPath(ContactsContract.PhoneLookup.CONTENT_FILTER_URI, Uri.encode(number));
|
||||
Uri uri;
|
||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
uri = Uri.withAppendedPath(ContactsContract.PhoneLookup.ENTERPRISE_CONTENT_FILTER_URI, Uri.encode(number));
|
||||
} else {
|
||||
uri = Uri.withAppendedPath(ContactsContract.PhoneLookup.CONTENT_FILTER_URI, Uri.encode(number));
|
||||
}
|
||||
String name = number;
|
||||
|
||||
if (number == null || number.equals("")) {
|
||||
|
Loading…
Reference in New Issue
Block a user