Updated background start mode

master
M66B 5 months ago
parent b5ecff9a39
commit 34a722e68d

@ -20,6 +20,7 @@ package eu.faircode.email;
*/ */
import static android.app.ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED; import static android.app.ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED;
import static android.app.ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS;
import static android.os.Process.THREAD_PRIORITY_BACKGROUND; import static android.os.Process.THREAD_PRIORITY_BACKGROUND;
import static androidx.browser.customtabs.CustomTabsService.ACTION_CUSTOM_TABS_CONNECTION; import static androidx.browser.customtabs.CustomTabsService.ACTION_CUSTOM_TABS_CONNECTION;
import static com.google.android.material.textfield.TextInputLayout.END_ICON_NONE; import static com.google.android.material.textfield.TextInputLayout.END_ICON_NONE;
@ -2128,8 +2129,10 @@ public class Helper {
ActivityOptions options = ActivityOptions.makeBasic(); ActivityOptions options = ActivityOptions.makeBasic();
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.TIRAMISU) if (Build.VERSION.SDK_INT == Build.VERSION_CODES.TIRAMISU)
options.setPendingIntentBackgroundActivityLaunchAllowed(true); options.setPendingIntentBackgroundActivityLaunchAllowed(true);
else else if (Build.VERSION.SDK_INT < Build.VERSION_CODES.BAKLAVA)
options.setPendingIntentBackgroundActivityStartMode(MODE_BACKGROUND_ACTIVITY_START_ALLOWED); options.setPendingIntentBackgroundActivityStartMode(MODE_BACKGROUND_ACTIVITY_START_ALLOWED);
else
options.setPendingIntentBackgroundActivityStartMode(MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS);
return options.toBundle(); return options.toBundle();
} }
} }

Loading…
Cancel
Save