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:
committed by
Nicolas Fella
parent
fe3cbeb65b
commit
39b8c571e3
@@ -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();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user