File tree Expand file tree Collapse file tree 1 file changed +14
-13
lines changed
app/src/main/java/me/capcom/smsgateway/modules/orchestrator Expand file tree Collapse file tree 1 file changed +14
-13
lines changed Original file line number Diff line number Diff line change 11package me.capcom.smsgateway.modules.orchestrator
22
3- import android.app.ForegroundServiceStartNotAllowedException
43import android.content.Context
5- import android.os.Build
64import me.capcom.smsgateway.helpers.SettingsHelper
75import me.capcom.smsgateway.modules.gateway.GatewayService
86import me.capcom.smsgateway.modules.localserver.LocalServerService
@@ -38,18 +36,21 @@ class OrchestratorService(
3836 pingSvc.start(context)
3937 receiverService.start(context)
4038 } catch (e: Throwable ) {
41- if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .S
42- && e is ForegroundServiceStartNotAllowedException
43- ) {
44- logsSvc.insert(
45- LogEntry .Priority .WARN ,
46- MODULE_NAME ,
47- " Can't start foreground services while the app is running in the background"
48- )
49- return
50- }
39+ logsSvc.insert(
40+ LogEntry .Priority .WARN ,
41+ MODULE_NAME ,
42+ " Can't start foreground services while the app is running in the background"
43+ )
44+ }
5145
52- throw e
46+ try {
47+ receiverService.start(context)
48+ } catch (e: Throwable ) {
49+ logsSvc.insert(
50+ LogEntry .Priority .WARN ,
51+ MODULE_NAME ,
52+ " Can't register receiver"
53+ )
5354 }
5455 }
5556
You can’t perform that action at this time.
0 commit comments