Skip to content

Commit

Permalink
Start uploadService as foreground service
Browse files Browse the repository at this point in the history
  • Loading branch information
malinajirka committed Jun 6, 2019
1 parent 4fab9e7 commit 656e726
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.wordpress.android.ui.uploads

import android.content.Context
import androidx.core.content.ContextCompat
import org.wordpress.android.fluxc.model.PostModel
import javax.inject.Inject

Expand All @@ -13,7 +14,7 @@ import javax.inject.Inject
class UploadServiceFacade @Inject constructor() {
fun uploadPost(context: Context, post: PostModel, trackAnalytics: Boolean, publish: Boolean, isRetry: Boolean) {
val intent = UploadService.getUploadPostServiceIntent(context, post, trackAnalytics, publish, isRetry)
context.startService(intent)
ContextCompat.startForegroundService(context, intent)
}

fun isPostUploadingOrQueued(post: PostModel) = UploadService.isPostUploadingOrQueued(post)
Expand Down

0 comments on commit 656e726

Please sign in to comment.