Commit 156ff344 authored by Daniel Wolf's avatar Daniel Wolf

Always use startForegroundService() on Android 8

parent a1dda6a5
......@@ -230,9 +230,11 @@ public final class Util {
public static void startService(Context context, Intent intent){
if(PreferencesAccessor.isEverythingDisabled(context))return;
if(intent.getComponent() != null && intent.getComponent().getClassName().equals(DNSVpnService.class.getName()) &&
PreferencesAccessor.isNotificationEnabled(context) && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){
context.startForegroundService(intent);
if((intent.getComponent() != null && intent.getComponent().getClassName().equals(DNSVpnService.class.getName()) &&
(PreferencesAccessor.isNotificationEnabled(context)) || Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)){
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
context.startForegroundService(intent);
} else context.startService(intent);
}else context.startService(intent);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment