From 69fd709718c5321b527b2bf8768efbddb2880c9e Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 15 Jul 2021 10:11:17 +0200 Subject: [PATCH] Target SDK 31 --- app/build.gradle | 6 +++--- .../main/java/eu/faircode/email/AlarmManagerCompatEx.java | 5 ++--- app/src/main/java/eu/faircode/email/Log.java | 4 ++++ .../main/java/eu/faircode/email/PendingIntentCompat.java | 2 -- app/src/main/java/eu/faircode/email/WidgetUnified.java | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index c2c0481db6..8306bed495 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,12 +12,12 @@ def keystoreProperties = new Properties() keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) android { - compileSdkVersion 30 + compileSdkVersion 31 defaultConfig { applicationId "eu.faircode.email" minSdkVersion 21 - targetSdkVersion 30 + targetSdkVersion 31 versionCode getVersionCode() versionName "1." + getVersionCode() archivesBaseName = "FairEmail-v$versionName" @@ -279,7 +279,7 @@ dependencies { def requery_version = "3.36.0" def paging_version = "2.1.2" // 3.0.0 def preference_version = "1.1.1" - def work_version = "2.6.0-beta01" + def work_version = "2.7.0-alpha04" def exif_version = "1.3.2" def biometric_version = "1.2.0-alpha03" def billingclient_version = "3.0.3" diff --git a/app/src/main/java/eu/faircode/email/AlarmManagerCompatEx.java b/app/src/main/java/eu/faircode/email/AlarmManagerCompatEx.java index a5981eca19..cdcb264289 100644 --- a/app/src/main/java/eu/faircode/email/AlarmManagerCompatEx.java +++ b/app/src/main/java/eu/faircode/email/AlarmManagerCompatEx.java @@ -52,9 +52,8 @@ public class AlarmManagerCompatEx { if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) return true; else { - //AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); - //return am.canScheduleExactAlarms(); - return true; + AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); + return am.canScheduleExactAlarms(); } } } diff --git a/app/src/main/java/eu/faircode/email/Log.java b/app/src/main/java/eu/faircode/email/Log.java index bd2664522b..4c9cba590f 100644 --- a/app/src/main/java/eu/faircode/email/Log.java +++ b/app/src/main/java/eu/faircode/email/Log.java @@ -1698,6 +1698,10 @@ public class Log { .append(" night=").append(Helper.isNight(context)) .append("\r\n"); + sb.append("canScheduleExactAlarms=") + .append(AlarmManagerCompatEx.canScheduleExactAlarms(context)) + .append("\r\n"); + sb.append("Transliterate: ") .append(TextHelper.canTransliterate()) .append("\r\n"); diff --git a/app/src/main/java/eu/faircode/email/PendingIntentCompat.java b/app/src/main/java/eu/faircode/email/PendingIntentCompat.java index 5f6c45a40c..49b268e493 100644 --- a/app/src/main/java/eu/faircode/email/PendingIntentCompat.java +++ b/app/src/main/java/eu/faircode/email/PendingIntentCompat.java @@ -30,8 +30,6 @@ public class PendingIntentCompat { private PendingIntentCompat() { } - public static int FLAG_MUTABLE = 0x02000000; - public static PendingIntent getActivity(Context context, int requestCode, Intent intent, int flags) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) return PendingIntent.getActivity(context, requestCode, intent, flags); diff --git a/app/src/main/java/eu/faircode/email/WidgetUnified.java b/app/src/main/java/eu/faircode/email/WidgetUnified.java index 904588c022..3e0e147582 100644 --- a/app/src/main/java/eu/faircode/email/WidgetUnified.java +++ b/app/src/main/java/eu/faircode/email/WidgetUnified.java @@ -91,7 +91,7 @@ public class WidgetUnified extends AppWidgetProvider { thread.putExtra("filter_archive", !EntityFolder.ARCHIVE.equals(type)); thread.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); PendingIntent piItem = PendingIntent.getActivity( - context, ActivityView.PI_WIDGET, thread, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntentCompat.FLAG_MUTABLE); + context, ActivityView.PI_WIDGET, thread, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_MUTABLE); views.setPendingIntentTemplate(R.id.lv, piItem);