Skip to content

Commit ffa0ce9

Browse files
committed
Update missed yield
1 parent e7dd7fc commit ffa0ce9

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

firebase-ai/src/main/kotlin/com/google/firebase/ai/type/LiveSession.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ import kotlinx.coroutines.flow.onCompletion
5151
import kotlinx.coroutines.flow.onEach
5252
import kotlinx.coroutines.isActive
5353
import kotlinx.coroutines.launch
54-
import kotlinx.coroutines.yield
5554
import kotlinx.serialization.ExperimentalSerializationApi
5655
import kotlinx.serialization.Serializable
5756
import kotlinx.serialization.encodeToString
@@ -122,7 +121,6 @@ internal constructor(
122121
functionCallHandler: ((FunctionCallPart) -> FunctionResponsePart)? = null,
123122
enableInterruptions: Boolean = false,
124123
) {
125-
126124
val context = firebaseApp.applicationContext
127125
if (
128126
ContextCompat.checkSelfPermission(context, RECORD_AUDIO) != PackageManager.PERMISSION_GRANTED
@@ -203,7 +201,7 @@ internal constructor(
203201
)
204202
}
205203
?.let { emit(it.toPublic()) }
206-
yield()
204+
delay(0)
207205
}
208206
}
209207
.onCompletion { stopAudioConversation() }

0 commit comments

Comments
 (0)