From 33c63fb5627487b8a6b234ddff0b0475b5b1a8c1 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Wed, 14 Feb 2024 12:09:08 +0100 Subject: [PATCH] fixup: access Android_id only on push --- src/main/java/eu/siacs/conversations/utils/PhoneHelper.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/utils/PhoneHelper.java b/src/main/java/eu/siacs/conversations/utils/PhoneHelper.java index edb181f4f..d76be537b 100644 --- a/src/main/java/eu/siacs/conversations/utils/PhoneHelper.java +++ b/src/main/java/eu/siacs/conversations/utils/PhoneHelper.java @@ -18,7 +18,8 @@ public class PhoneHelper { } public static Uri getProfilePictureUri(final Context context) { - if (context.checkSelfPermission(Manifest.permission.READ_CONTACTS) != PackageManager.PERMISSION_GRANTED) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M + && context.checkSelfPermission(Manifest.permission.READ_CONTACTS) != PackageManager.PERMISSION_GRANTED) { return null; } final String[] projection = new String[] {Profile._ID, Profile.PHOTO_URI};