- JNI bridge with 8 extern functions (init, startCall, stopCall, setMute, setSpeaker, getStats, forceProfile, destroy) with panic catching - Kotlin engine layer: WzpEngine JNI wrapper, WzpCallback interface, CallStats data class with JSON deserialization - Jetpack Compose UI: InCallScreen with quality indicator (green/yellow/red), mute/speaker/hangup buttons, stats overlay, duration timer - CallActivity with RECORD_AUDIO permission handling, Material3 theme - CallService foreground service with WakeLock, WiFi lock, notification - AudioRouteManager for speaker/earpiece/Bluetooth SCO switching - AEC wired into CallEncoder pipeline: AEC → AGC → denoise → silence → encode - AEC farend reference fed from decode path to encode path in pipeline - Engine exposes set_aec_enabled/set_agc_enabled via AtomicBool flags Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
33 lines
799 B
Kotlin
33 lines
799 B
Kotlin
package com.wzp.engine
|
|
|
|
/**
|
|
* Callback interface for VoIP engine events.
|
|
*
|
|
* All callbacks are invoked on the main/UI thread.
|
|
*/
|
|
interface WzpCallback {
|
|
|
|
/**
|
|
* Called when the call state changes.
|
|
*
|
|
* @param state one of [CallStateConstants]: IDLE(0), CONNECTING(1), ACTIVE(2),
|
|
* RECONNECTING(3), CLOSED(4)
|
|
*/
|
|
fun onCallStateChanged(state: Int)
|
|
|
|
/**
|
|
* Called when the network quality tier changes.
|
|
*
|
|
* @param tier 0 = Good, 1 = Degraded, 2 = Catastrophic
|
|
*/
|
|
fun onQualityTierChanged(tier: Int)
|
|
|
|
/**
|
|
* Called when an error occurs in the native engine.
|
|
*
|
|
* @param code numeric error code (negative)
|
|
* @param message human-readable description
|
|
*/
|
|
fun onError(code: Int, message: String)
|
|
}
|