|
|
@ -2256,7 +2256,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
|
|
|
private static void start(Context context, Intent intent) {
|
|
|
|
private static void start(Context context, Intent intent) {
|
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
|
|
|
boolean background_service = prefs.getBoolean("background_service", false);
|
|
|
|
boolean background_service = prefs.getBoolean("background_service", false);
|
|
|
|
if (background_service && Build.VERSION.SDK_INT < Build.VERSION_CODES.O)
|
|
|
|
if (background_service)
|
|
|
|
context.startService(intent);
|
|
|
|
context.startService(intent);
|
|
|
|
else
|
|
|
|
else
|
|
|
|
ContextCompat.startForegroundService(context, intent);
|
|
|
|
ContextCompat.startForegroundService(context, intent);
|
|
|
|