mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-19 13:18:32 +00:00
ipc/android: Clean up MonadoService
This commit is contained in:
parent
a1aa5611fe
commit
c65ce85fe1
|
@ -53,23 +53,27 @@ class MonadoService : Service() {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun handleStart() {
|
private fun handleStart() {
|
||||||
val pendingShutdownIntent = PendingIntent.getForegroundService(this,
|
val pendingShutdownIntent = PendingIntent.getForegroundService(
|
||||||
|
this,
|
||||||
0,
|
0,
|
||||||
Intent(BuildConfig.SHUTDOWN_ACTION).setPackage(packageName),
|
Intent(BuildConfig.SHUTDOWN_ACTION).setPackage(packageName),
|
||||||
0)
|
0
|
||||||
|
)
|
||||||
|
|
||||||
val notification = serviceNotification.buildNotification(this, pendingShutdownIntent)
|
val notification = serviceNotification.buildNotification(this, pendingShutdownIntent)
|
||||||
|
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||||
startForeground(serviceNotification.getNotificationId(),
|
startForeground(
|
||||||
|
serviceNotification.getNotificationId(),
|
||||||
notification,
|
notification,
|
||||||
ServiceInfo.FOREGROUND_SERVICE_TYPE_MANIFEST)
|
ServiceInfo.FOREGROUND_SERVICE_TYPE_MANIFEST
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
startForeground(serviceNotification.getNotificationId(),
|
startForeground(
|
||||||
notification)
|
serviceNotification.getNotificationId(),
|
||||||
|
notification
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
Loading…
Reference in a new issue