title: CoroutineWorker crashes with no getForegroundInfo
body: <p>I'm attempting to migrate some network calls to WorkManager CoroutineWorkers, to take advantage of the automatic retries on failure and scheduling powers.</p>
  <p>This is the worker I wrote:</p>
  <pre><code>@HiltWorker
  class RefreshSubscriptionDetailsWorker
  @AssistedInject constructor(
      @Assisted appContext: Context,
      @Assisted workerParams: WorkerParameters
  ) :
      CoroutineWorker(appContext, workerParams) {
  
      override suspend fun doWork(): Result {
          return Result.success()
      }
  }
  </code></pre>
  <p>The code in BaseApplication which configures the request:</p>
  <pre><code>        val refreshSubscriptionDetailsRequest =
              OneTimeWorkRequestBuilder&lt;RefreshSubscriptionDetailsWorker&gt;()
                  .build()
  
          WorkManager
              .getInstance(applicationContext)
              .enqueue(refreshSubscriptionDetailsRequest)
  </code></pre>
  <p>I've followed the instructions in the documentation to ensure Hilt is injected correctly:</p>
  <pre><code>&lt;provider
              android:name=&quot;androidx.startup.InitializationProvider&quot;
              android:authorities=&quot;${applicationId}.androidx-startup&quot;
              tools:node=&quot;remove&quot;&gt;
          &lt;/provider&gt;
  </code></pre>
  <pre><code>    @Inject lateinit var workerFactory: HiltWorkerFactory
  
      override fun getWorkManagerConfiguration() =
          Configuration.Builder()
              .setWorkerFactory(workerFactory)
              .build()
  </code></pre>
  <p>The problem I'm having is that when it's queued, it crashes with the below exception:</p>
  <pre><code>Fatal Exception: java.lang.IllegalStateException: Not implemented
         at androidx.work.CoroutineWorker.getForegroundInfo$suspendImpl(CoroutineWorker.kt:100)
         at androidx.work.CoroutineWorker.getForegroundInfo()
         at androidx.work.CoroutineWorker$getForegroundInfoAsync$1.invokeSuspend(CoroutineWorker.kt:134)
         at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
         at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
         at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
         at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
         at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
         at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
  </code></pre>
  <p>I would expect that I would need to implement the getForegroundInfo function if I was going to be using an Expedited request, but I shouldn't need to in this instance, as I'm not asking for an expedited request, or so I've been led to believe by the absense of getForegroundInfo implementations in tutorials, and the patch notes which indicate that you need a ForegroundService for Expedited requests: <a href="https://developer.android.com/jetpack/androidx/releases/work#2.7.0" rel="noreferrer">Patch notes</a></p>
  <p>I'm using WorkManager 2.7.1, Hilt 2.41, trying to run it on Android versions 8 through 12.</p>