Skip to content

Commit 9a4bb42

Browse files
committed
Revert "refactor: only expose the await function"
This reverts commit eea8af6.
1 parent eea8af6 commit 9a4bb42

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

firebase-common/ktx/ktx.gradle

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@ dependencies {
4141
implementation project(':firebase-common')
4242
implementation project(':firebase-components')
4343
implementation 'androidx.annotation:annotation:1.1.0'
44-
implementation "com.google.android.gms:play-services-tasks:18.0.2"
45-
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-play-services:$coroutinesVersion"
44+
45+
// We're exposing this library as a transitive dependency so developers can
46+
// get Kotlin Coroutines support out-of-the-box for methods that return a Task
47+
api "org.jetbrains.kotlinx:kotlinx-coroutines-play-services:$coroutinesVersion"
4648

4749
testImplementation "org.robolectric:robolectric:$robolectricVersion"
4850
testImplementation 'junit:junit:4.12'

firebase-common/ktx/src/main/kotlin/com/google/firebase/ktx/Firebase.kt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,11 @@ package com.google.firebase.ktx
1515

1616
import android.content.Context
1717
import androidx.annotation.Keep
18-
import com.google.android.gms.tasks.Task
1918
import com.google.firebase.FirebaseApp
2019
import com.google.firebase.FirebaseOptions
2120
import com.google.firebase.components.Component
2221
import com.google.firebase.components.ComponentRegistrar
2322
import com.google.firebase.platforminfo.LibraryVersionComponent
24-
import kotlinx.coroutines.tasks.await
2523

2624
/**
2725
* Single access point to all firebase SDKs from Kotlin.
@@ -52,15 +50,6 @@ fun Firebase.initialize(context: Context, options: FirebaseOptions, name: String
5250
val Firebase.options: FirebaseOptions
5351
get() = Firebase.app.options
5452

55-
/**
56-
* Awaits the completion of the task without blocking a thread.
57-
*
58-
* This suspending function is cancellable.
59-
* If the [Job] of the current coroutine is cancelled or completed while this suspending function is waiting, this function
60-
* stops waiting for the completion stage and immediately resumes with [CancellationException].
61-
*/
62-
suspend fun <T> Task<T>.await(): T = await()
63-
6453
internal const val LIBRARY_NAME: String = "fire-core-ktx"
6554

6655
/** @suppress */

0 commit comments

Comments
 (0)