Skip to content

Commit

Permalink
fix: remove actions check as it's already in AppManifest
Browse files Browse the repository at this point in the history
  • Loading branch information
ohassine committed Aug 21, 2024
1 parent a2e0c26 commit cc1e09d
Showing 1 changed file with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,7 @@ class StartServiceReceiver : BroadcastReceiver() {

override fun onReceive(context: Context?, intent: Intent?) {
appLogger.i("$TAG: onReceive called with action ${intent?.action}")
/**
* We may get any event from the system, so we need to check if the action is ACTION_BOOT_COMPLETED or
* ACTION_LOCKED_BOOT_COMPLETED to start the persistentWebSocketService otherwise
* ForegroundServiceStartNotAllowedException will be thrown.
*/
if (intent?.action == Intent.ACTION_BOOT_COMPLETED || intent?.action == Intent.ACTION_LOCKED_BOOT_COMPLETED) {
scope.launch { startPersistentWebSocketService() }
}
scope.launch { startPersistentWebSocketService() }
}

companion object {
Expand Down

0 comments on commit cc1e09d

Please sign in to comment.