mirror of
https://github.com/xweiba/location-spoofer.git
synced 2026-09-25 08:01:55 +08:00
fix: harden startup proxy and coordinate handling
This commit is contained in:
@@ -17,7 +17,7 @@ final class BackgroundKeepAlive {
|
||||
guard isActive, let info = notification.userInfo,
|
||||
let type = info[AVAudioSessionInterruptionTypeKey] as? UInt,
|
||||
type == AVAudioSession.InterruptionType.ended.rawValue else { return }
|
||||
start()
|
||||
restartAfterInterruption()
|
||||
RuntimeLogger.info("APP", "KeepAlive", "音频中断恢复")
|
||||
}
|
||||
|
||||
@@ -50,6 +50,16 @@ final class BackgroundKeepAlive {
|
||||
RuntimeLogger.info("APP", "KeepAlive", "后台保活已启动(静音音频)")
|
||||
}
|
||||
|
||||
private func restartAfterInterruption() {
|
||||
guard isActive else { return }
|
||||
playerNode?.stop()
|
||||
engine?.stop()
|
||||
playerNode = nil
|
||||
engine = nil
|
||||
isActive = false
|
||||
start()
|
||||
}
|
||||
|
||||
func stop() {
|
||||
guard isActive else { return }
|
||||
isActive = false
|
||||
|
||||
Reference in New Issue
Block a user