Android lint продолжает сообщать о пропущенных разрешениях, хотя я добавил @RequiresPermission в свой метод.Код:
@NonNull
@RequiresPermission(Manifest.permission.READ_CONTACTS)
public static Map<String, Integer> selectContactVersions(@Nullable Collection<String> contactIds) {
if (!PermissionUtils.isPermissonGranted(ApplicationKeeper.getApplication(), Manifest.permission.READ_CONTACTS)) {
return Collections.emptyMap();
}
Сообщение об ошибке:
AddressAccesssor.java:41: Call requires permission which may be rejected by user: code should explicitly check to see if permission is available (with checkPermission) or explicitly handle a potential SecurityException
38 @RequiresPermission(Manifest.permission.READ_CONTACTS)
39 public static Map<String, Integer> selectContactVersions(@Nullable Collection<String> contactIds) {
40 if (!PermissionUtils.isPermissonGranted(ApplicationKeeper.getApplication(), Manifest.permission.READ_CONTACTS)) {
41 return Collections.emptyMap();
42 }
AddressAccessor.java:126: Call requires permission which may be rejected by user: code should explicitly check to see if permission is available (with checkPermission) or explicitly handle a potential SecurityException
123 return Collections.emptyMap();
124 }
125
126 Map<String, List<String>> contactIdPhoneListMap = selectPhones(contactIds);
127
128 Map<String, AddressbookContact> addressbookContactMap = new HashMap<String, AddressbookContact>();
129 Cursor cursor = null;
Я что-то здесь упустил?