mirror of
https://github.com/StikDebug/StikDebug.git
synced 2026-10-16 04:20:30 +00:00
Disable silent audio keep-alive
This commit is contained in:
parent
c5bad70d37
commit
46677cf46e
3 changed files with 0 additions and 24 deletions
|
|
@ -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:))
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue