style(android): fix voice ktlint formatting

This commit is contained in:
Ayaan Zaidi 2026-05-18 18:04:22 +05:30
parent 4712931e71
commit d204ec0cc9
No known key found for this signature in database
4 changed files with 23 additions and 14 deletions

View file

@ -1166,8 +1166,10 @@ internal fun shouldPauseGatewayReconnectAfterAuthFailure(
role?.trim() == "node" &&
scopes.isEmpty() &&
error.details.reason == "not-paired" &&
(error.details.pauseReconnect == false ||
error.details.recommendedNextStep == "wait_then_retry")
(
error.details.pauseReconnect == false ||
error.details.recommendedNextStep == "wait_then_retry"
)
)
"AUTH_TOKEN_MISMATCH" -> deviceTokenRetryBudgetUsed && !pendingDeviceTokenRetry
else -> false

View file

@ -759,10 +759,10 @@ class MicCaptureManager(
var outputIndex = 0
while (inputIndex + 1 < pcm16.size) {
val sample =
((pcm16[inputIndex].toInt() and 0xff) or
(pcm16[inputIndex + 1].toInt() shl 8))
.toShort()
.toInt()
(
(pcm16[inputIndex].toInt() and 0xff) or
(pcm16[inputIndex + 1].toInt() shl 8)
).toShort().toInt()
output[outputIndex] = linear16ToPcmu(sample)
inputIndex += 2
outputIndex += 1

View file

@ -169,11 +169,15 @@ class TalkModeManager internal constructor(
private val realtimePlaybackLock = Any()
private var realtimeAudioTrack: AudioTrack? = null
private var realtimePlaybackIdleJob: Job? = null
@Volatile private var realtimePlaybackEndsAtMs = 0L
@Volatile private var realtimeOutputSuppressed = false
@Volatile
private var realtimePlaybackEndsAtMs = 0L
@Volatile private var playbackEnabled = true
@Volatile
private var realtimeOutputSuppressed = false
@Volatile
private var playbackEnabled = true
private val playbackGeneration = AtomicLong(0L)
private var ttsJob: Job? = null
@ -755,11 +759,9 @@ class TalkModeManager internal constructor(
}
}
private fun shouldAppendRealtimeCapturedFrame(length: Int): Boolean =
!isRealtimePlaybackActive() && length > 0
private fun shouldAppendRealtimeCapturedFrame(length: Int): Boolean = !isRealtimePlaybackActive() && length > 0
private fun isRealtimePlaybackActive(): Boolean =
_isSpeaking.value || SystemClock.elapsedRealtime() < realtimePlaybackEndsAtMs
private fun isRealtimePlaybackActive(): Boolean = _isSpeaking.value || SystemClock.elapsedRealtime() < realtimePlaybackEndsAtMs
private fun handleRealtimeTalkEvent(payloadJson: String?) {
if (payloadJson.isNullOrBlank()) return

View file

@ -151,7 +151,12 @@ class MicCaptureManagerTest {
)
runCurrent()
assertEquals("testing testing 1 2 3", manager.conversation.value.single().text)
assertEquals(
"testing testing 1 2 3",
manager.conversation.value
.single()
.text,
)
assertEquals("transcription-1", privateField<String?>(manager, "transcriptionSessionId"))
privateField<Job?>(manager, "transcriptionDrainJob")?.cancel()
}