File tree Expand file tree Collapse file tree
android/app/src/main/java/com/httpsms/receivers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,11 +10,15 @@ import timber.log.Timber
1010class BootReceiver : BroadcastReceiver () {
1111 override fun onReceive (context : Context , intent : Intent ) {
1212 if (intent.action == Intent .ACTION_BOOT_COMPLETED ) {
13- Intent (context, StickyNotificationService ::class .java).also {
14- context.startForegroundService(it)
15- }
13+ startStickyNotification(context)
1614 } else {
1715 Timber .e(" invalid intent [${intent.action} ]" )
1816 }
1917 }
20- }
18+ private fun startStickyNotification (context : Context ) {
19+ Timber .d(" starting foreground service" )
20+ val notificationIntent = Intent (context, StickyNotificationService ::class .java)
21+ val service = context.startForegroundService(notificationIntent)
22+ Timber .d(" foreground service started [${service?.className} ]" )
23+ }
24+ }
You can’t perform that action at this time.
0 commit comments