From c65ce85fe1d3a44471440cf296c0d3eb8aef4be8 Mon Sep 17 00:00:00 2001 From: Ryan Pavlik Date: Tue, 9 Feb 2021 15:32:55 -0600 Subject: [PATCH] ipc/android: Clean up MonadoService --- .../freedesktop/monado/ipc/MonadoService.kt | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/xrt/ipc/android/src/main/java/org/freedesktop/monado/ipc/MonadoService.kt b/src/xrt/ipc/android/src/main/java/org/freedesktop/monado/ipc/MonadoService.kt index 7bebdedfd..fcd1943c0 100644 --- a/src/xrt/ipc/android/src/main/java/org/freedesktop/monado/ipc/MonadoService.kt +++ b/src/xrt/ipc/android/src/main/java/org/freedesktop/monado/ipc/MonadoService.kt @@ -53,23 +53,27 @@ class MonadoService : Service() { } private fun handleStart() { - val pendingShutdownIntent = PendingIntent.getForegroundService(this, - 0, - Intent(BuildConfig.SHUTDOWN_ACTION).setPackage(packageName), - 0) + val pendingShutdownIntent = PendingIntent.getForegroundService( + this, + 0, + Intent(BuildConfig.SHUTDOWN_ACTION).setPackage(packageName), + 0 + ) val notification = serviceNotification.buildNotification(this, pendingShutdownIntent) - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { - startForeground(serviceNotification.getNotificationId(), - notification, - ServiceInfo.FOREGROUND_SERVICE_TYPE_MANIFEST) + startForeground( + serviceNotification.getNotificationId(), + notification, + ServiceInfo.FOREGROUND_SERVICE_TYPE_MANIFEST + ) } else { - startForeground(serviceNotification.getNotificationId(), - notification) + startForeground( + serviceNotification.getNotificationId(), + notification + ) } - } companion object {