2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-31 14:15:14 +00:00

Use ContextCompat.startForegroundService().

This commit is contained in:
Isira Seneviratne
2020-07-07 18:14:39 +05:30
committed by Nicolas Fella
parent fe3cbeb65b
commit 39b8c571e3

View File

@@ -455,12 +455,7 @@ public class BackgroundService extends Service {
mutex.unlock();
}
}
Intent serviceIntent = new Intent(c, BackgroundService.class);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
c.startForegroundService(serviceIntent);
} else {
c.startService(serviceIntent);
}
ContextCompat.startForegroundService(c, new Intent(c, BackgroundService.class));
}).start();
}