summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2019-10-28 11:03:06 -0400
committerJoel Fischer <joeljfischer@gmail.com>2019-10-28 11:03:06 -0400
commit6c3cccdc044b64516d055ae7e4cd8c6834fdb6fc (patch)
treee717b6a82025e09a008f90aa2b9c10e6bbeba33b
parent80d298f5ce75a4cba267d23bfc6570cb903ec09d (diff)
downloadsdl_ios-6c3cccdc044b64516d055ae7e4cd8c6834fdb6fc.tar.gz
Revert removing the data session delaybugfix/issue-1240-revert-tweak-iap-transport-delay
-rw-r--r--SmartDeviceLink/SDLIAPDataSession.m3
-rw-r--r--SmartDeviceLink/SDLIAPTransport.m14
2 files changed, 5 insertions, 12 deletions
diff --git a/SmartDeviceLink/SDLIAPDataSession.m b/SmartDeviceLink/SDLIAPDataSession.m
index 3cd2d7492..5bf61e304 100644
--- a/SmartDeviceLink/SDLIAPDataSession.m
+++ b/SmartDeviceLink/SDLIAPDataSession.m
@@ -110,9 +110,6 @@ NS_ASSUME_NONNULL_BEGIN
[self sdl_isIOThreadCanceled:self.canceledSemaphore completionHandler:^(BOOL success) {
if (success == NO) {
SDLLogE(@"Destroying thread (IOStreamThread) for data session when I/O streams have not yet closed.");
-
- // FIX: Try to close the session if the canceledSemaphore is never triggered by the `sdl_accessoryEventLoop`
- [self sdl_closeSession];
}
self.ioStreamThread = nil;
[super cleanupClosedSession];
diff --git a/SmartDeviceLink/SDLIAPTransport.m b/SmartDeviceLink/SDLIAPTransport.m
index f65027e49..a1be67a65 100644
--- a/SmartDeviceLink/SDLIAPTransport.m
+++ b/SmartDeviceLink/SDLIAPTransport.m
@@ -98,8 +98,11 @@ int const CreateSessionRetries = 3;
return;
}
+ double retryDelay = self.sdl_retryDelay;
+ SDLLogD(@"Accessory Connected (%@), Opening in %0.03fs", notification.userInfo[EAAccessoryKey], retryDelay);
+
self.retryCounter = 0;
- [self sdl_connect:newAccessory];
+ [self performSelector:@selector(sdl_connect:) withObject:nil afterDelay:retryDelay];
}
/**
@@ -501,21 +504,14 @@ int const CreateSessionRetries = 3;
if ([protocolString isEqualToString:MultiSessionProtocolString] && SDL_SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"9")) {
self.dataSession = [[SDLIAPDataSession alloc] initWithAccessory:accessory delegate:self forProtocol:protocolString];
-
- SDLLogD(@"Accessory Connected (%@), Opening immediately", accessory);
[self.dataSession startSession];
return YES;
} else if ([protocolString isEqualToString:ControlProtocolString]) {
self.controlSession = [[SDLIAPControlSession alloc] initWithAccessory:accessory delegate:self];
-
- double retryDelay = [self sdl_retryDelay];
- SDLLogD(@"Accessory Connected (%@), Opening in %0.03fs", accessory, retryDelay);
- [self.controlSession performSelector:@selector(startSession) withObject:nil afterDelay:retryDelay];
+ [self.controlSession startSession];
return YES;
} else if ([protocolString isEqualToString:LegacyProtocolString]) {
self.dataSession = [[SDLIAPDataSession alloc] initWithAccessory:accessory delegate:self forProtocol:protocolString];
-
- SDLLogD(@"Accessory Connected (%@), Opening immediately", accessory);
[self.dataSession startSession];
return YES;
}