Skip to content

Commit 50c78c1

Browse files
authored
Remove isRecording from constructor (#6817)
It's an internal tracker that should not be modified while instantiating.
1 parent e8495d5 commit 50c78c1

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/LiveGenerativeModel.kt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,7 @@ internal constructor(
100100
val receivedJson = webSession.incoming.receive().readBytes().toString(Charsets.UTF_8)
101101
// TODO: Try to decode the json instead of string matching.
102102
return if (receivedJson.contains("setupComplete")) {
103-
LiveSession(
104-
session = webSession,
105-
backgroundDispatcher = backgroundDispatcher,
106-
isRecording = false
107-
)
103+
LiveSession(session = webSession, backgroundDispatcher = backgroundDispatcher)
108104
} else {
109105
webSession.close()
110106
throw GeminiConnectionHandshakeFailed()

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ public class LiveSession
4444
internal constructor(
4545
private val session: ClientWebSocketSession?,
4646
@Background private val backgroundDispatcher: CoroutineContext,
47-
private var isRecording: Boolean,
4847
private var audioHelper: AudioHelper? = null
4948
) {
5049

5150
private val audioQueue = ConcurrentLinkedQueue<ByteArray>()
5251
private val playBackQueue = ConcurrentLinkedQueue<ByteArray>()
5352
private var startedReceiving = false
5453
private var receiveChannel: Channel<Frame> = Channel()
54+
private var isRecording: Boolean = false
5555

5656
private companion object {
5757
val TAG = LiveSession::class.java.simpleName

0 commit comments

Comments
 (0)