From 5b377d823819d2bed125d50ea41bf8f6c3a0fef4 Mon Sep 17 00:00:00 2001 From: xynngh Date: Sat, 31 Jul 2021 21:48:53 +0400 Subject: [PATCH] Use proper "limit" param in call log queries starting from Android 8.1 --- CHANGELOG.md | 4 ++++ .../dummydomain/yetanothercallblocker/data/CallLogHelper.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be69c08..10b4c80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Updated Hebrew translation thanks to Tzvika ([@shiloni](https://hosted.weblate.org/user/shiloni/)). - Updated Slovenian translation thanks to bojanopatje (@bojanopatje). +### Fixed + +- Fixed a startup crash on [a recent update](https://review.lineageos.org/c/LineageOS/android_packages_providers_ContactsProvider/+/313438/) of LineageOS 15.1-17.1 (introduced in [0.5.7](#057-2020-10-02)). + ## [0.5.15] - 2021-06-07 diff --git a/app/src/main/java/dummydomain/yetanothercallblocker/data/CallLogHelper.java b/app/src/main/java/dummydomain/yetanothercallblocker/data/CallLogHelper.java index 555ad29..53a287a 100644 --- a/app/src/main/java/dummydomain/yetanothercallblocker/data/CallLogHelper.java +++ b/app/src/main/java/dummydomain/yetanothercallblocker/data/CallLogHelper.java @@ -47,7 +47,7 @@ public class CallLogHelper { String sortOrder = CallLog.Calls.DATE + " " + (reverseOrder ? "ASC" : "DESC"); // should probably work since JELLY_BEAN_MR1 - if (Build.VERSION.SDK_INT > Build.VERSION_CODES.Q) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) { uri = uri.buildUpon() .appendQueryParameter(CallLog.Calls.LIMIT_PARAM_KEY, String.valueOf(limit)) .build();