Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent incorrect background processing #1909

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions SmartDeviceLink/private/SDLLifecycleManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#import "SDLLifecycleRPCAdapter.h"
#import "SDLAsynchronousRPCOperation.h"
#import "SDLAsynchronousRPCRequestOperation.h"
#import "SDLBackgroundTaskManager.h"
#import "SDLChangeRegistration.h"
#import "SDLConfiguration.h"
#import "SDLConnectionManagerType.h"
Expand Down Expand Up @@ -107,7 +106,6 @@ @interface SDLLifecycleManager () <SDLConnectionManagerType>
@property (copy, nonatomic) SDLManagerReadyBlock readyHandler;
@property (copy, nonatomic) dispatch_queue_t lifecycleQueue;
@property (assign, nonatomic) int32_t lastCorrelationId;
@property (copy, nonatomic) SDLBackgroundTaskManager *backgroundTaskManager;
@property (strong, nonatomic) SDLLanguage currentVRLanguage;

// RPC Handlers
Expand Down Expand Up @@ -190,8 +188,6 @@ - (instancetype)initWithConfiguration:(SDLConfiguration *)configuration delegate
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(hmiStatusDidChange:) name:SDLDidChangeHMIStatusNotification object:_notificationDispatcher];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(remoteHardwareDidUnregister:) name:SDLDidReceiveAppUnregisteredNotification object:_notificationDispatcher];

_backgroundTaskManager = [[SDLBackgroundTaskManager alloc] initWithBackgroundTaskName:BackgroundTaskTransportName];

return self;
}

Expand Down Expand Up @@ -254,9 +250,6 @@ - (SDLState *)lifecycleState {
}

- (void)didEnterStateStarted {
// Start a background task so a session can be established even when the app is backgrounded.
[self.backgroundTaskManager startBackgroundTask];

// Start up the internal protocol, transport, and other internal managers
self.secondaryTransportManager = nil;
SDLLifecycleConfiguration *lifecycleConfig = self.configuration.lifecycleConfig;
Expand Down Expand Up @@ -357,9 +350,6 @@ - (void)sdl_stopManagersAndRestart:(BOOL)shouldRestart {

if (shouldRestart) {
[strongSelf sdl_transitionToState:SDLLifecycleStateStarted];
} else {
// End the background task because a session will not be established
[strongSelf.backgroundTaskManager endBackgroundTask];
}
});
}
Expand Down Expand Up @@ -586,9 +576,6 @@ - (void)didEnterStateReady {
if ([self.delegate respondsToSelector:@selector(videoStreamingState:didChangetoState:)]) {
[self.delegate videoStreamingState:SDLVideoStreamingStateNotStreamable didChangetoState:self.videoStreamingState];
}

// Stop the background task now that setup has completed
[self.backgroundTaskManager endBackgroundTask];
}

- (void)didEnterStateUnregistering {
Expand Down