@@ -63,9 +63,7 @@ class LightningNodeService : Service() {
6363 super .onCreate()
6464 startForeground(ID_NOTIFICATION_NODE , createNotification())
6565 setupService()
66- lifecycleObserver = AppLifecycleObserver ().also {
67- ProcessLifecycleOwner .get().lifecycle.addObserver(it)
68- }
66+ lifecycleObserver = AppLifecycleObserver ().also { ProcessLifecycleOwner .get().lifecycle.addObserver(it) }
6967 }
7068
7169 private fun setupService () {
@@ -116,9 +114,7 @@ class LightningNodeService : Service() {
116114 val pendingIntent = PendingIntent .getActivity(this , 0 , notificationIntent, PendingIntent .FLAG_IMMUTABLE )
117115
118116 // Create stop action that will close both service and app
119- val stopIntent = Intent (this , LightningNodeService ::class .java).apply {
120- action = ACTION_STOP_SERVICE_AND_APP
121- }
117+ val stopIntent = Intent (this , LightningNodeService ::class .java).apply { action = ACTION_STOP_SERVICE_AND_APP }
122118 val stopPendingIntent = PendingIntent .getService(this , 0 , stopIntent, PendingIntent .FLAG_IMMUTABLE )
123119
124120 return NotificationCompat .Builder (this , CHANNEL_ID_NODE )
@@ -128,11 +124,7 @@ class LightningNodeService : Service() {
128124 .setColor(ContextCompat .getColor(this , R .color.brand))
129125 .setContentIntent(pendingIntent)
130126 .setOngoing(true )
131- .addAction(
132- R .drawable.ic_x,
133- getString(R .string.notification__service__stop),
134- stopPendingIntent
135- )
127+ .addAction(R .drawable.ic_x, getString(R .string.notification__service__stop), stopPendingIntent)
136128 .build()
137129 }
138130
@@ -192,8 +184,8 @@ class LightningNodeService : Service() {
192184 }
193185
194186 companion object {
195- const val CHANNEL_ID_NODE = " bitkit_notification_channel_node"
196187 const val TAG = " LightningNodeService"
188+ const val CHANNEL_ID_NODE = " bitkit_notification_channel_node"
197189 const val ACTION_STOP_SERVICE_AND_APP = " to.bitkit.androidServices.action.STOP_SERVICE_AND_APP"
198190 }
199191}
0 commit comments