mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-09-02 07:05:09 +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();
|
mutex.unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Intent serviceIntent = new Intent(c, BackgroundService.class);
|
ContextCompat.startForegroundService(c, new Intent(c, BackgroundService.class));
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
||||||
c.startForegroundService(serviceIntent);
|
|
||||||
} else {
|
|
||||||
c.startService(serviceIntent);
|
|
||||||
}
|
|
||||||
}).start();
|
}).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user