Skip to content

Commit 1147c3c

Browse files
committed
Don't start the android app if incoming and outgoing is disabled. closes NdoleStudio#279
1 parent 6e38e05 commit 1147c3c

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

android/app/src/main/java/com/httpsms/receivers/BootReceiver.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ package com.httpsms.receivers
33
import android.content.BroadcastReceiver
44
import android.content.Context
55
import android.content.Intent
6+
import com.httpsms.Constants
7+
import com.httpsms.Settings
68
import com.httpsms.services.StickyNotificationService
79
import 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)

0 commit comments

Comments
 (0)