diff options
author | Muller, Alexander (A.) <amulle19@ford.com> | 2017-01-25 17:14:20 -0800 |
---|---|---|
committer | Muller, Alexander (A.) <amulle19@ford.com> | 2017-01-25 17:14:20 -0800 |
commit | e96cdafd135f4b01f26fc9732e5b1ee435cc1629 (patch) | |
tree | 69324b1fa83b73a4e32aed6786323b0926956f47 | |
parent | 65b04fbec044924f32a2fbe5faf69bb460b26fa7 (diff) | |
download | sdl_ios-e96cdafd135f4b01f26fc9732e5b1ee435cc1629.tar.gz |
Removing Reconnecting state and instead using started.
-rw-r--r-- | SmartDeviceLink/SDLLifecycleManager.h | 1 | ||||
-rw-r--r-- | SmartDeviceLink/SDLLifecycleManager.m | 11 |
2 files changed, 3 insertions, 9 deletions
diff --git a/SmartDeviceLink/SDLLifecycleManager.h b/SmartDeviceLink/SDLLifecycleManager.h index 71fb00b36..927b5cfbb 100644 --- a/SmartDeviceLink/SDLLifecycleManager.h +++ b/SmartDeviceLink/SDLLifecycleManager.h @@ -36,7 +36,6 @@ NS_ASSUME_NONNULL_BEGIN typedef NSString SDLLifecycleState; -extern SDLLifecycleState *const SDLLifecycleStateReconnecting; extern SDLLifecycleState *const SDLLifecycleStateStopped; extern SDLLifecycleState *const SDLLifecycleStateStarted; extern SDLLifecycleState *const SDLLifecycleStateConnected; diff --git a/SmartDeviceLink/SDLLifecycleManager.m b/SmartDeviceLink/SDLLifecycleManager.m index fa617f64e..453b3d3c4 100644 --- a/SmartDeviceLink/SDLLifecycleManager.m +++ b/SmartDeviceLink/SDLLifecycleManager.m @@ -43,7 +43,6 @@ NS_ASSUME_NONNULL_BEGIN -SDLLifecycleState *const SDLLifecycleStateReconnecting = @"Reconnecting"; SDLLifecycleState *const SDLLifecycleStateStopped = @"Stopped"; SDLLifecycleState *const SDLLifecycleStateStarted = @"Started"; SDLLifecycleState *const SDLLifecycleStateConnected = @"Connected"; @@ -141,8 +140,7 @@ SDLLifecycleState *const SDLLifecycleStateReady = @"Ready"; + (NSDictionary<SDLState *, SDLAllowableStateTransitions *> *)sdl_stateTransitionDictionary { return @{ - SDLLifecycleStateReconnecting: @[SDLLifecycleStateStarted], - SDLLifecycleStateStopped: @[SDLLifecycleStateReconnecting, SDLLifecycleStateStarted], + SDLLifecycleStateStopped: @[SDLLifecycleStateStarted], SDLLifecycleStateStarted : @[SDLLifecycleStateConnected, SDLLifecycleStateStopped], SDLLifecycleStateConnected: @[SDLLifecycleStateStopped, SDLLifecycleStateRegistered], SDLLifecycleStateRegistered: @[SDLLifecycleStateStopped, SDLLifecycleStateSettingUpManagers], @@ -153,10 +151,6 @@ SDLLifecycleState *const SDLLifecycleStateReady = @"Ready"; }; } -- (void)didEnterStateReconnecting { - [self.lifecycleStateMachine transitionToState:SDLLifecycleStateStarted]; -} - - (void)didEnterStateStarted { // We will always try to restart the proxy, unless stop is called. _restartProxy = YES; @@ -189,7 +183,7 @@ SDLLifecycleState *const SDLLifecycleStateReady = @"Ready"; [self.delegate managerDidDisconnect]; if (self.shouldRestartProxy) { - [self.lifecycleStateMachine transitionToState:SDLLifecycleStateReconnecting]; + [self.lifecycleStateMachine transitionToState:SDLLifecycleStateStarted]; } } @@ -210,6 +204,7 @@ SDLLifecycleState *const SDLLifecycleStateReady = @"Ready"; if (error != nil || ![response.success boolValue]) { [SDLDebugTool logFormat:@"Failed to register the app. Error: %@, Response: %@", error, response]; weakSelf.readyHandler(NO, error); + _restartProxy = NO; [weakSelf.lifecycleStateMachine transitionToState:SDLLifecycleStateStopped]; return; } |