From 46677cf46e723cfc6b1b1f838bed1911d10ee840 Mon Sep 17 00:00:00 2001 From: autosequence Date: Fri, 4 Sep 2026 16:01:42 +0100 Subject: [PATCH] Disable silent audio keep-alive --- StikDebug/App/AppBootstrapper.swift | 9 --------- StikDebug/Services/DebugKeepAliveLease.swift | 2 -- StikDebug/Views/SettingsView.swift | 13 ------------- 3 files changed, 24 deletions(-) diff --git a/StikDebug/App/AppBootstrapper.swift b/StikDebug/App/AppBootstrapper.swift index ffb94ac..c20bc34 100644 --- a/StikDebug/App/AppBootstrapper.swift +++ b/StikDebug/App/AppBootstrapper.swift @@ -10,7 +10,6 @@ import UIKit enum AppBootstrapper { static func configure() { registerDefaultSettings() - startConfiguredKeepAliveServices() applyDocumentPickerCopyWorkaround() } @@ -22,18 +21,10 @@ enum AppBootstrapper { "enableAdvancedOptions": enableAdvancedOptions, UserDefaults.Keys.txmOverride: false, UserDefaults.Keys.confirmExternalJITRequests: true, - "keepAliveAudio": true, "keepAliveLocation": true ]) } - private static func startConfiguredKeepAliveServices() { - guard UserDefaults.standard.bool(forKey: "keepAliveAudio") else { - return - } - BackgroundAudioManager.shared.start() - } - private static func applyDocumentPickerCopyWorkaround() { let fixedSelector = NSSelectorFromString("fix_initForOpeningContentTypes:asCopy:") let originalSelector = #selector(UIDocumentPickerViewController.init(forOpeningContentTypes:asCopy:)) diff --git a/StikDebug/Services/DebugKeepAliveLease.swift b/StikDebug/Services/DebugKeepAliveLease.swift index 41659a5..a04ffb3 100644 --- a/StikDebug/Services/DebugKeepAliveLease.swift +++ b/StikDebug/Services/DebugKeepAliveLease.swift @@ -25,7 +25,6 @@ final class DebugKeepAliveLease { stateLock.unlock() runOnMain { - BackgroundAudioManager.shared.requestStop() BackgroundLocationManager.shared.requestStop() if self.backgroundTaskID != .invalid { @@ -45,7 +44,6 @@ final class DebugKeepAliveLease { stateLock.unlock() runOnMain { - BackgroundAudioManager.shared.requestStart() BackgroundLocationManager.shared.requestStart() self.backgroundTaskID = UIApplication.shared.beginBackgroundTask(withName: "StikDebugDebugSession") { [weak self] in LogManager.shared.addWarningLog("Debug session background task expired") diff --git a/StikDebug/Views/SettingsView.swift b/StikDebug/Views/SettingsView.swift index c876037..7bf7ff9 100644 --- a/StikDebug/Views/SettingsView.swift +++ b/StikDebug/Views/SettingsView.swift @@ -16,7 +16,6 @@ private enum SettingsLinks { struct SettingsView: View { @AppStorage(UserDefaults.Keys.txmOverride) private var overrideTXMDetection = false @AppStorage(UserDefaults.Keys.confirmExternalJITRequests) private var confirmExternalJITRequests = true - @AppStorage("keepAliveAudio") private var keepAliveAudio = true @AppStorage("keepAliveLocation") private var keepAliveLocation = true @AppStorage(UserDefaults.Keys.targetDeviceIP) private var targetDeviceIP = DeviceConnectionContext.defaultTargetIPAddress @@ -86,18 +85,6 @@ struct SettingsView: View { } Section { - Toggle(isOn: $keepAliveAudio) { - VStack(alignment: .leading, spacing: 2) { - Text("Silent Audio") - Text("Plays inaudible audio so iOS keeps the app running.") - .font(.caption).foregroundStyle(.secondary) - } - } - .onChange(of: keepAliveAudio) { _, enabled in - if enabled { BackgroundAudioManager.shared.start() } - else { BackgroundAudioManager.shared.stop() } - } - Toggle(isOn: $keepAliveLocation) { VStack(alignment: .leading, spacing: 2) { Text("Background Location")