Refactoring

This commit is contained in:
M66B
2022-11-24 10:06:53 +01:00
parent de3b9b2df5
commit 8c252db09c
3 changed files with 11 additions and 9 deletions

View File

@@ -3427,14 +3427,14 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
}
private static void start(Context context, Intent intent) {
if (isBackgroundService(context))
context.startService(intent);
else
try {
try {
if (isBackgroundService(context))
context.startService(intent);
else
ContextCompat.startForegroundService(context, intent);
} catch (Throwable ex) {
Log.e(ex);
}
} catch (Throwable ex) {
Log.e(ex);
}
}
private static boolean isBackgroundService(Context context) {