Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ abstract class TaskerPluginRunnerAction<TInput : Any, TOutput : Any>() : TaskerP
internal fun runWithIntent(context: IntentServiceParallel?, taskerIntent: Intent?) :RunnerActionResult{
if (context == null) return RunnerActionResult(false)
if (taskerIntent == null) return RunnerActionResult(false)
context.startForegroundIfNeeded()
startForegroundIfNeeded(context)
try {
val input = taskerIntent.getTaskerInput(context, getInputClass(taskerIntent))
var result = run(context, input)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ abstract class TaskerPluginRunner<TInput : Any, TOutput : Any> {
TaskerPluginRunner.startForegroundIfNeeded(this, notificationProperties)
}

@TargetApi(Build.VERSION_CODES.O)
fun startForegroundIfNeeded(intentServiceParallel: IntentServiceParallel) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not use an extension function here as it would clash with IntentServiceParallel.startForegroundIfNeeded

TaskerPluginRunner.startForegroundIfNeeded(intentServiceParallel, notificationProperties)
}


companion object {
const val NOTIFICATION_CHANNEL_ID = "taskerpluginforegroundd"
Expand Down