From f5e2164c8a52c38510345dde273fd87927815ae5 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 27 May 2020 11:40:38 +0200 Subject: [PATCH] Allow background service pre Android 8 only --- app/src/main/java/eu/faircode/email/ApplicationEx.java | 4 ++++ app/src/main/res/layout/fragment_options_notifications.xml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/ApplicationEx.java b/app/src/main/java/eu/faircode/email/ApplicationEx.java index bf3ab46669..4909c3142b 100644 --- a/app/src/main/java/eu/faircode/email/ApplicationEx.java +++ b/app/src/main/java/eu/faircode/email/ApplicationEx.java @@ -30,6 +30,7 @@ import android.content.Intent; import android.content.IntentFilter; import android.content.SharedPreferences; import android.content.res.Configuration; +import android.os.Build; import android.util.Printer; import android.webkit.CookieManager; @@ -274,6 +275,9 @@ public class ApplicationEx extends Application { editor.putBoolean("experiments", true); } else if (version < 1124) { editor.remove("experiments"); + } else if (version < 1181) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && !BuildConfig.DEBUG) + editor.remove("background_service"); } if (version < BuildConfig.VERSION_CODE) diff --git a/app/src/main/res/layout/fragment_options_notifications.xml b/app/src/main/res/layout/fragment_options_notifications.xml index 92687b32a8..0b391901f0 100644 --- a/app/src/main/res/layout/fragment_options_notifications.xml +++ b/app/src/main/res/layout/fragment_options_notifications.xml @@ -503,6 +503,6 @@ android:id="@+id/grpNotification" android:layout_width="0dp" android:layout_height="0dp" - app:constraint_referenced_ids="swLight,btnSound" /> + app:constraint_referenced_ids="swBackground,tvBackgroundHint,swLight,btnSound" />