diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2019-07-19 10:22:51 -0400 |
---|---|---|
committer | Joel Fischer <joeljfischer@gmail.com> | 2019-07-19 10:22:51 -0400 |
commit | 411d0d993ff6f9adb131b3861229610d11aaddc6 (patch) | |
tree | 4cbad8ddff60091172589671cb9a64ef14482bb5 | |
parent | 3a47bb2b7d75658599e5e38213e071c0712a788f (diff) | |
download | sdl_ios-feature/issue_1028_restructure_ios_threading.tar.gz |
Check API availability before using iOS 10 APIfeature/issue_1028_restructure_ios_threading
-rwxr-xr-x | SmartDeviceLink/SDLAudioStreamManager.m | 7 | ||||
-rw-r--r-- | SmartDeviceLink/SDLLifecycleManager.m | 7 | ||||
-rw-r--r-- | SmartDeviceLink/SDLLogManager.m | 6 |
3 files changed, 17 insertions, 3 deletions
diff --git a/SmartDeviceLink/SDLAudioStreamManager.m b/SmartDeviceLink/SDLAudioStreamManager.m index fcdb4cc33..11d39812a 100755 --- a/SmartDeviceLink/SDLAudioStreamManager.m +++ b/SmartDeviceLink/SDLAudioStreamManager.m @@ -39,9 +39,14 @@ NSString *const SDLErrorDomainAudioStreamManager = @"com.sdl.extension.pcmAudioS if (!self) { return nil; } _mutableQueue = [NSMutableArray array]; - _audioQueue = dispatch_queue_create_with_target("com.sdl.audiomanager.transcode", DISPATCH_QUEUE_SERIAL, [SDLGlobals sharedGlobals].sdlProcessingQueue); _shouldPlayWhenReady = NO; + if (@available(iOS 10.0, *)) { + _audioQueue = dispatch_queue_create_with_target("com.sdl.audiomanager.transcode", DISPATCH_QUEUE_SERIAL, [SDLGlobals sharedGlobals].sdlProcessingQueue); + } else { + _audioQueue = [SDLGlobals sharedGlobals].sdlProcessingQueue; + } + _streamManager = streamManager; return self; diff --git a/SmartDeviceLink/SDLLifecycleManager.m b/SmartDeviceLink/SDLLifecycleManager.m index ec9d8f99b..18a73ce05 100644 --- a/SmartDeviceLink/SDLLifecycleManager.m +++ b/SmartDeviceLink/SDLLifecycleManager.m @@ -128,7 +128,12 @@ NSString *const BackgroundTaskTransportName = @"com.sdl.transport.backgroundTask _rpcOperationQueue = [[NSOperationQueue alloc] init]; _rpcOperationQueue.name = @"com.sdl.lifecycle.rpcOperation.concurrent"; _rpcOperationQueue.underlyingQueue = [SDLGlobals sharedGlobals].sdlConcurrentQueue; - _lifecycleQueue = dispatch_queue_create_with_target("com.sdl.lifecycle", DISPATCH_QUEUE_SERIAL, [SDLGlobals sharedGlobals].sdlProcessingQueue); + + if (@available(iOS 10.0, *)) { + _lifecycleQueue = dispatch_queue_create_with_target("com.sdl.lifecycle", DISPATCH_QUEUE_SERIAL, [SDLGlobals sharedGlobals].sdlProcessingQueue); + } else { + _lifecycleQueue = [SDLGlobals sharedGlobals].sdlProcessingQueue; + } // Managers _fileManager = [[SDLFileManager alloc] initWithConnectionManager:self configuration:_configuration.fileManagerConfig]; diff --git a/SmartDeviceLink/SDLLogManager.m b/SmartDeviceLink/SDLLogManager.m index 8540d21b9..ae0fa317f 100644 --- a/SmartDeviceLink/SDLLogManager.m +++ b/SmartDeviceLink/SDLLogManager.m @@ -340,7 +340,11 @@ static dispatch_queue_t _logQueue = NULL; + (dispatch_queue_t)logQueue { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ - _logQueue = dispatch_queue_create_with_target("com.sdl.log", DISPATCH_QUEUE_SERIAL, [SDLGlobals sharedGlobals].sdlProcessingQueue); + if (@available(iOS 10.0, *)) { + _logQueue = dispatch_queue_create_with_target("com.sdl.log", DISPATCH_QUEUE_SERIAL, [SDLGlobals sharedGlobals].sdlProcessingQueue); + } else { + _logQueue = [SDLGlobals sharedGlobals].sdlProcessingQueue; + } }); return _logQueue; |