fix(audio): don't treat AppLifecycleState.inactive as backgrounded
inactive is a transient state — on Android it fires during MQTT push wake-up,
system dialogs, and app-switcher previews while the app is still visible. By
flipping _isBackgrounded=true on inactive, the auto-play gate in
_handleIncomingVoice silently skipped incoming voice messages on Android even
when the user was viewing the matching session. Only paused/detached should
mark backgrounded; leave inactive alone so the real edge governs.
| .. | .. |
|---|
| 285 | 285 | void didChangeAppLifecycleState(AppLifecycleState state) { |
|---|
| 286 | 286 | switch (state) { |
|---|
| 287 | 287 | case AppLifecycleState.paused: |
|---|
| 288 | | - case AppLifecycleState.inactive: |
|---|
| 289 | 288 | case AppLifecycleState.detached: |
|---|
| 290 | 289 | AudioService._isBackgrounded = true; |
|---|
| 291 | 290 | case AppLifecycleState.resumed: |
|---|
| 292 | 291 | AudioService._isBackgrounded = false; |
|---|
| 292 | + // AppLifecycleState.inactive is transient (Android push wake-up, system |
|---|
| 293 | + // dialogs, app switcher preview) — the app is still visible. Treating it |
|---|
| 294 | + // as backgrounded silently blocked auto-play of incoming voice on Android, |
|---|
| 295 | + // where `inactive` fires more often around MQTT push delivery. Leave the |
|---|
| 296 | + // current value untouched so a real paused/resumed edge governs it. |
|---|
| 293 | 297 | default: |
|---|
| 294 | 298 | break; |
|---|
| 295 | 299 | } |
|---|