diff options
author | David Switzer <dswitzer@xevo.com> | 2017-05-17 16:39:20 -0700 |
---|---|---|
committer | David Switzer <dswitzer@xevo.com> | 2017-05-17 16:39:20 -0700 |
commit | baa58b13bfff6c16dddaa1ed943116a5048fbd54 (patch) | |
tree | a777c43db137c3746c3ad2ad0f9e25015baa00b5 | |
parent | 29cc426c24e4014ae0027d58fbb2e4b3e85b9dd8 (diff) | |
download | sdl_ios-baa58b13bfff6c16dddaa1ed943116a5048fbd54.tar.gz |
Reinstate session setup in progress setter to end background task cleanly.
-rw-r--r-- | SmartDeviceLink/SDLIAPTransport.m | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/SmartDeviceLink/SDLIAPTransport.m b/SmartDeviceLink/SDLIAPTransport.m index 0aeb2b2e8..2192f8324 100644 --- a/SmartDeviceLink/SDLIAPTransport.m +++ b/SmartDeviceLink/SDLIAPTransport.m @@ -35,7 +35,7 @@ int const streamOpenTimeoutSeconds = 2; @property (assign) int retryCounter; @property (strong) SDLTimer *protocolIndexTimer; @property (nonatomic, assign) UIBackgroundTaskIdentifier backgroundTaskId; -@property (assign) BOOL sessionSetupInProgress; +@property (nonatomic, assign, setter=setSessionSetupInProgress:) BOOL sessionSetupInProgress; @end @@ -87,6 +87,14 @@ int const streamOpenTimeoutSeconds = 2; [[NSNotificationCenter defaultCenter] removeObserver:self]; } +- (void)setSessionSetupInProgress:(BOOL)inProgress{ + _sessionSetupInProgress = inProgress; + if (!inProgress){ + // End the background task here to catch all cases + [self sdl_backgroundTaskEnd]; + } +} + - (void)sdl_backgroundTaskStart { if (self.backgroundTaskId != UIBackgroundTaskInvalid) { return; |