mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-19 08:58:37 +00:00
feat(ios): add background listening core toggle (#18261)
Co-authored-by: Mariano Belinky <mariano@mb-server-643.local>
This commit is contained in:
@@ -219,8 +219,12 @@ final class TalkModeManager: NSObject {
|
||||
|
||||
/// Suspends microphone usage without disabling Talk Mode.
|
||||
/// Used when the app backgrounds (or when we need to temporarily release the mic).
|
||||
func suspendForBackground() -> Bool {
|
||||
func suspendForBackground(keepActive: Bool = false) -> Bool {
|
||||
guard self.isEnabled else { return false }
|
||||
if keepActive {
|
||||
self.statusText = self.isListening ? "Listening" : self.statusText
|
||||
return false
|
||||
}
|
||||
let wasActive = self.isListening || self.isSpeaking || self.isPushToTalkActive
|
||||
|
||||
self.isListening = false
|
||||
@@ -247,7 +251,8 @@ final class TalkModeManager: NSObject {
|
||||
return wasActive
|
||||
}
|
||||
|
||||
func resumeAfterBackground(wasSuspended: Bool) async {
|
||||
func resumeAfterBackground(wasSuspended: Bool, wasKeptActive: Bool = false) async {
|
||||
if wasKeptActive { return }
|
||||
guard wasSuspended else { return }
|
||||
guard self.isEnabled else { return }
|
||||
await self.start()
|
||||
|
||||
Reference in New Issue
Block a user