fix(android): expose voice diagnostics safely

This commit is contained in:
Edison Jwa
2026-05-20 14:52:33 +09:00
parent d6763787aa
commit 26b06ce786
3 changed files with 16 additions and 20 deletions
+4 -8
View File
@@ -100,14 +100,9 @@ pub(crate) fn publish_permission_state(permission: String, state: PermissionStat
// 2. Fan out to Dart subscribers. Best-effort: a send error
// means no current subscriber (Dart side not yet attached
// or already torn down) which is fine.
let _ = permission_events().send(BridgeEvent::PermissionState {
permission,
state,
});
let _ = permission_events().send(BridgeEvent::PermissionState { permission, state });
}
/// Default tracing filter. Suppresses the chatty
/// `tsproto::resend` and `tsproto::packet_codec` paths that
/// flood the diagnostic export during transient packet loss;
@@ -768,8 +763,9 @@ pub fn export_diagnostics() -> String {
// diagnostics snapshot from the process-global slot published
// by AndroidVoiceUnit::open(). Returns None on non-Android and
// before any voice session has opened.
let android_audio_yaml = chanora_audio::mobile_voice_backend::current_android_audio_diagnostics()
.map(|d| d.to_yaml_fragment());
let android_audio_yaml =
chanora_audio::mobile_voice_backend::current_android_audio_diagnostics()
.map(|d| d.to_yaml_fragment());
match chanora_core::DiagnosticExport::from_sink(log_sink(), metadata) {
Ok(exp) => exp.with_android_audio(android_audio_yaml).to_text(),
Err(e) => format!("(diagnostic export failed: {e})"),