diff --git a/WordPress/src/main/java/org/wordpress/android/ui/uploads/UploadServiceFacade.kt b/WordPress/src/main/java/org/wordpress/android/ui/uploads/UploadServiceFacade.kt index 6df4fe9f738d..3b14fa7b246a 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/uploads/UploadServiceFacade.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/uploads/UploadServiceFacade.kt @@ -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 @@ -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)