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 @@ -3,6 +3,8 @@ package com.httpsms.receivers
33import android.content.BroadcastReceiver
44import android.content.Context
55import android.content.Intent
6+ import com.httpsms.Constants
7+ import com.httpsms.Settings
68import com.httpsms.services.StickyNotificationService
79import timber.log.Timber
810
@@ -16,6 +18,11 @@ class BootReceiver : BroadcastReceiver() {
1618 }
1719 }
1820 private fun startStickyNotification (context : Context ) {
21+ if (! Settings .getActiveStatus(context, Constants .SIM1 ) && ! Settings .getActiveStatus(context, Constants .SIM2 )) {
22+ Timber .d(" active status is false, not starting foreground service" )
23+ return
24+ }
25+
1926 Timber .d(" starting foreground service" )
2027 val notificationIntent = Intent (context, StickyNotificationService ::class .java)
2128 val service = context.startForegroundService(notificationIntent)
You can’t perform that action at this time.
0 commit comments