This repository was archived by the owner on Dec 18, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
topl-service/src/main/java/io/matthewnelson/topl_service/lifecycle Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -320,14 +320,16 @@ class BackgroundManager internal constructor(
320320 private fun applicationMovedToBackground () {
321321 taskIsInForeground = false
322322 if (! ServiceActionProcessor .wasLastAcceptedServiceActionStop()) {
323- // System automatically unbinds when app is sent to the background. This prevents
324- // it so that we maintain a started, bound service.
325- BaseService .bindService(
326- BaseService .getAppContext(),
327- serviceClass,
328- bindServiceFlag = bindServiceFlag
329- )
330- TorServiceConnection .serviceBinder?.executeBackgroundPolicyJob(policy, executionDelay)
323+ TorServiceConnection .serviceBinder?.let { binder ->
324+ // System automatically unbinds when app is sent to the background. This prevents
325+ // it so that we maintain a started, bound service.
326+ BaseService .bindService(
327+ BaseService .getAppContext(),
328+ serviceClass,
329+ bindServiceFlag = bindServiceFlag
330+ )
331+ binder.executeBackgroundPolicyJob(policy, executionDelay)
332+ }
331333 }
332334 }
333335}
You can’t perform that action at this time.
0 commit comments