Skip to content

Commit

Permalink
Don't start the android app if incoming and outgoing is disabled. closes
Browse files Browse the repository at this point in the history
  • Loading branch information
AchoArnold committed Sep 29, 2023
1 parent 6e38e05 commit 1147c3c
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package com.httpsms.receivers
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import com.httpsms.Constants
import com.httpsms.Settings
import com.httpsms.services.StickyNotificationService
import timber.log.Timber

Expand All @@ -16,6 +18,11 @@ class BootReceiver : BroadcastReceiver() {
}
}
private fun startStickyNotification(context: Context) {
if(!Settings.getActiveStatus(context, Constants.SIM1) && !Settings.getActiveStatus(context, Constants.SIM2)) {
Timber.d("active status is false, not starting foreground service")
return
}

Timber.d("starting foreground service")
val notificationIntent = Intent(context, StickyNotificationService::class.java)
val service = context.startForegroundService(notificationIntent)
Expand Down

0 comments on commit 1147c3c

Please sign in to comment.