summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2018-06-20 14:40:47 -0400
committerJoel Fischer <joeljfischer@gmail.com>2018-06-20 14:40:47 -0400
commitf6b685688eae6cb81641c1c8139051a9d0245705 (patch)
tree392a84604432ecd3dcb9e3fe377f1199614e5171
parentde88437a1c5feb65d2b1b59211ca37dd262ae9dd (diff)
downloadsdl_ios-f6b685688eae6cb81641c1c8139051a9d0245705.tar.gz
Don’t attempt to start the audio video services until after connection
-rw-r--r--SmartDeviceLink/SDLLifecycleManager.m8
-rw-r--r--SmartDeviceLink/SDLStreamingAudioLifecycleManager.m7
-rw-r--r--SmartDeviceLink/SDLStreamingVideoLifecycleManager.m4
3 files changed, 13 insertions, 6 deletions
diff --git a/SmartDeviceLink/SDLLifecycleManager.m b/SmartDeviceLink/SDLLifecycleManager.m
index 0e1e8a5a5..788e19aea 100644
--- a/SmartDeviceLink/SDLLifecycleManager.m
+++ b/SmartDeviceLink/SDLLifecycleManager.m
@@ -209,10 +209,6 @@ SDLLifecycleState *const SDLLifecycleStateReady = @"Ready";
self.proxy = [SDLProxy iapProxyWithListener:self.notificationDispatcher];
}
#pragma clang diagnostic pop
-
- if (self.streamManager != nil) {
- [self.streamManager startWithProtocol:self.proxy.protocol];
- }
}
- (void)didEnterStateStopped {
@@ -361,6 +357,10 @@ SDLLifecycleState *const SDLLifecycleStateReady = @"Ready";
dispatch_group_leave(managerGroup);
}];
+ if (self.streamManager != nil) {
+ [self.streamManager startWithProtocol:self.proxy.protocol];
+ }
+
// We're done synchronously calling all startup methods, so we can now wait.
dispatch_group_leave(managerGroup);
diff --git a/SmartDeviceLink/SDLStreamingAudioLifecycleManager.m b/SmartDeviceLink/SDLStreamingAudioLifecycleManager.m
index 4a61e6e99..a6bc98be7 100644
--- a/SmartDeviceLink/SDLStreamingAudioLifecycleManager.m
+++ b/SmartDeviceLink/SDLStreamingAudioLifecycleManager.m
@@ -304,12 +304,15 @@ NS_ASSUME_NONNULL_BEGIN
- (void)sdl_startAudioSession {
SDLLogV(@"Attempting to start audio session");
+ if (!self.protocol) {
+ return;
+ }
+
if (!self.isStreamingSupported) {
return;
}
- if ([self.audioStreamStateMachine isCurrentState:SDLAudioStreamManagerStateStopped]
- && self.isHmiStateAudioStreamCapable) {
+ if ([self.audioStreamStateMachine isCurrentState:SDLAudioStreamManagerStateStopped] && self.isHmiStateAudioStreamCapable) {
[self.audioStreamStateMachine transitionToState:SDLAudioStreamManagerStateStarting];
}
}
diff --git a/SmartDeviceLink/SDLStreamingVideoLifecycleManager.m b/SmartDeviceLink/SDLStreamingVideoLifecycleManager.m
index 07a9c0c7a..544dda5c3 100644
--- a/SmartDeviceLink/SDLStreamingVideoLifecycleManager.m
+++ b/SmartDeviceLink/SDLStreamingVideoLifecycleManager.m
@@ -578,6 +578,10 @@ typedef void(^SDLVideoCapabilityResponseHandler)(SDLVideoStreamingCapability *_N
- (void)sdl_startVideoSession {
SDLLogV(@"Attempting to start video session");
+ if (!self.protocol) {
+ SDLLogV(@"Video manager is not yet started");
+ return;
+ }
if (!self.isHmiStateVideoStreamCapable) {
SDLLogV(@"SDL Core is not ready to stream video. Video start service request will not be sent.");