diff options
author | NicoleYarroch <nicole@livio.io> | 2019-07-09 10:12:08 -0400 |
---|---|---|
committer | NicoleYarroch <nicole@livio.io> | 2019-07-09 10:12:08 -0400 |
commit | 1276f0e44636c65b0f9c17c06abc6c69338ed20f (patch) | |
tree | f49af4af7f27d5ca1d820d615c33fab59a5e35ca | |
parent | 76d6cd10f715c0c4ca2df0e20df67727a8f5e3fe (diff) | |
download | sdl_ios-1276f0e44636c65b0f9c17c06abc6c69338ed20f.tar.gz |
Background task now stopped in ready statebugfix/issue_1326_background_task_suspended_before_RAI_sent
-rw-r--r-- | SmartDeviceLink/SDLLifecycleManager.m | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/SmartDeviceLink/SDLLifecycleManager.m b/SmartDeviceLink/SDLLifecycleManager.m index 908f5c43f..a5fa00f9c 100644 --- a/SmartDeviceLink/SDLLifecycleManager.m +++ b/SmartDeviceLink/SDLLifecycleManager.m @@ -282,7 +282,7 @@ NSString *const BackgroundTaskTransportName = @"com.sdl.transport.backgroundTask if (shouldRestart) { [strongSelf sdl_transitionToState:SDLLifecycleStateStarted]; } else { - // End any background tasks because a session will not be established + // End the background task because a session will not be established [self.backgroundTaskManager endBackgroundTask]; } }); @@ -498,6 +498,9 @@ NSString *const BackgroundTaskTransportName = @"com.sdl.transport.backgroundTask [self.delegate audioStreamingState:SDLAudioStreamingStateNotAudible didChangeToState:self.audioStreamingState]; } }); + + // Stop the background task now that setup has completed + [self.backgroundTaskManager endBackgroundTask]; } - (void)didEnterStateUnregistering { @@ -708,9 +711,6 @@ NSString *const BackgroundTaskTransportName = @"com.sdl.transport.backgroundTask - (void)transportDidConnect { SDLLogD(@"Transport connected"); - // End any background tasks since the transport connected successfully - [self.backgroundTaskManager endBackgroundTask]; - dispatch_async(self.lifecycleQueue, ^{ [self sdl_transitionToState:SDLLifecycleStateConnected]; }); |