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

Remove Deprecations #744

Merged
merged 5 commits into from
Sep 26, 2017
Merged
Show file tree
Hide file tree
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
10 changes: 0 additions & 10 deletions SmartDeviceLink/SDLAbstractProtocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,16 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, copy) NSString *appId;

// Sending
- (void)sendStartSessionWithType:(SDLServiceType)serviceType __deprecated_msg(("Use startServiceWithType:payload: instead"));
- (void)startServiceWithType:(SDLServiceType)serviceType __deprecated_msg(("Use startServiceWithType:payload: instead"));
- (void)startServiceWithType:(SDLServiceType)serviceType payload:(nullable NSData *)payload;

- (void)startSecureServiceWithType:(SDLServiceType)serviceType completionHandler:(void (^)(BOOL success, NSError *error))completionHandler __deprecated_msg(("Use startSecureServiceWithType:payload:completionHandler instead"));;
- (void)startSecureServiceWithType:(SDLServiceType)serviceType payload:(nullable NSData *)payload completionHandler:(void (^)(BOOL success, NSError *error))completionHandler;

- (void)sendEndSessionWithType:(SDLServiceType)serviceType __deprecated_msg(("Use endServiceWithType: instead"));
- (void)endServiceWithType:(SDLServiceType)serviceType;

- (void)sendRPCRequest:(SDLRPCRequest *)rpcRequest __deprecated_msg(("Use sendRPC: instead"));
- (void)sendRPC:(SDLRPCMessage *)message;
- (BOOL)sendRPC:(SDLRPCMessage *)message encrypted:(BOOL)encryption error:(NSError **)error;

- (void)sendRawData:(NSData *)data withServiceType:(SDLServiceType)serviceType;
- (void)sendEncryptedRawData:(NSData *)data onService:(SDLServiceType)serviceType;

- (void)sendRawDataStream:(NSInputStream *)inputStream withServiceType:(SDLServiceType)serviceType __deprecated_msg("This is not implemented and will cause a crash if called");
- (void)sendHeartbeat __deprecated_msg("This is not implemented and will cause a crash if called");

// Recieving
- (void)handleBytesFromTransport:(NSData *)receivedData;

Expand Down
28 changes: 0 additions & 28 deletions SmartDeviceLink/SDLAbstractProtocol.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,14 @@ - (instancetype)init {
}

// Implement in subclasses.
- (void)sendStartSessionWithType:(SDLServiceType)serviceType {
[self doesNotRecognizeSelector:_cmd];
}

- (void)startServiceWithType:(SDLServiceType)serviceType {
[self doesNotRecognizeSelector:_cmd];
}

- (void)startServiceWithType:(SDLServiceType)serviceType payload:(nullable NSData *)payload {
[self doesNotRecognizeSelector:_cmd];
}

- (void)startSecureServiceWithType:(SDLServiceType)serviceType completionHandler:(void (^)(BOOL, NSError *))completionHandler {
[self doesNotRecognizeSelector:_cmd];
}

- (void)startSecureServiceWithType:(SDLServiceType)serviceType payload:(nullable NSData *)payload completionHandler:(void (^)(BOOL, NSError *))completionHandler {
[self doesNotRecognizeSelector:_cmd];
}

- (void)sendEndSessionWithType:(SDLServiceType)serviceType {
[self doesNotRecognizeSelector:_cmd];
}

- (void)endServiceWithType:(SDLServiceType)serviceType {
[self doesNotRecognizeSelector:_cmd];
}
Expand All @@ -54,14 +38,6 @@ - (BOOL)sendRPC:(SDLRPCMessage *)message encrypted:(BOOL)encryption error:(NSErr
return NO;
}

- (void)sendRPCRequest:(SDLRPCRequest *)rpcRequest {
[self doesNotRecognizeSelector:_cmd];
}

- (void)sendHeartbeat {
[self doesNotRecognizeSelector:_cmd];
}

- (void)handleBytesFromTransport:(NSData *)receivedData {
[self doesNotRecognizeSelector:_cmd];
}
Expand All @@ -70,10 +46,6 @@ - (void)sendRawData:(NSData *)data withServiceType:(SDLServiceType)serviceType {
[self doesNotRecognizeSelector:_cmd];
}

- (void)sendRawDataStream:(NSInputStream *)inputStream withServiceType:(SDLServiceType)serviceType {
[self doesNotRecognizeSelector:_cmd];
}

- (void)sendEncryptedRawData:(NSData *)data onService:(SDLServiceType)serviceType {
[self doesNotRecognizeSelector:_cmd];
}
Expand Down
36 changes: 0 additions & 36 deletions SmartDeviceLink/SDLConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,42 +37,6 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (copy, nonatomic, readonly) SDLStreamingMediaConfiguration *streamingMediaConfig;

/**
Create a new configuration to be passed into SDLManager with a custom lifecycle, lock screen, and a default logging configuration.

@param lifecycleConfiguration The lifecycle configuration to be used.
@return The configuration
*/
- (instancetype)initWithLifecycle:(SDLLifecycleConfiguration *)lifecycleConfiguration __deprecated_msg(("Use initWithLifecycle:lockScreen:logging: instead"));

/**
Create a new configuration to be passed into SDLManager with a custom lifecycle, lock screen, and a default logging configuration.

@param lifecycleConfiguration The lifecycle configuration to be used.
@return The configuration
*/
+ (instancetype)configurationWithLifecycle:(SDLLifecycleConfiguration *)lifecycleConfiguration __deprecated_msg(("Use configurationWithLifecycle:lockScreen:logging: instead"));

/**
* Create a new configuration to be passed into SDLManager with a custom lifecycle, lock screen, and a default logging configuration.
*
* @param lifecycleConfig The lifecycle configuration to be used.
* @param lockScreenConfig The lockscreen configuration to be used, or `enabledConfiguration` if nil.
*
* @return The configuration
*/
- (instancetype)initWithLifecycle:(SDLLifecycleConfiguration *)lifecycleConfig lockScreen:(nullable SDLLockScreenConfiguration *)lockScreenConfig __deprecated_msg(("Use initWithLifecycle:lockScreen:logging: instead"));

/**
* Create a new configuration to be passed into SDLManager with a custom lifecycle, lock screen, and a default logging configuration.
*
* @param lifecycleConfig The lifecycle configuration to be used.
* @param lockScreenConfig The lockscreen configuration to be used, or `enabledConfiguration` if nil.
*
* @return The configuration
*/
+ (instancetype)configurationWithLifecycle:(SDLLifecycleConfiguration *)lifecycleConfig lockScreen:(nullable SDLLockScreenConfiguration *)lockScreenConfig __deprecated_msg(("Use configurationWithLifecycle:lockScreen:logging: instead"));

/**
Create a new configuration to be passed into SDLManager with a custom lifecycle, lock screen, and logging configuration.

Expand Down
7 changes: 5 additions & 2 deletions SmartDeviceLink/SDLConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,15 @@ - (instancetype)initWithLifecycle:(SDLLifecycleConfiguration *)lifecycleConfig l
_lifecycleConfig = lifecycleConfig;
_lockScreenConfig = lockScreenConfig ?: [SDLLockScreenConfiguration enabledConfiguration];
_loggingConfig = logConfig ?: [SDLLogConfiguration defaultConfiguration];
_streamingMediaConfig = streamingMediaConfig;

if (_streamingMediaConfig != nil) {
NSAssert(!([_lifecycleConfig.appType isEqualToEnum:SDLAppHMITypeNavigation] || [_lifecycleConfig.appType isEqualToEnum:SDLAppHMITypeProjection]), @"You should only set a streaming media configuration if your app is a NAVIGATION or PROJECTION HMI type");
// If we have a streaming config, the apptype MUST be navigation or projection
NSAssert(([_lifecycleConfig.appType isEqualToEnum:SDLAppHMITypeNavigation] || [_lifecycleConfig.appType isEqualToEnum:SDLAppHMITypeProjection]), @"You should only set a streaming media configuration if your app is a NAVIGATION or PROJECTION HMI type");
_streamingMediaConfig = streamingMediaConfig;
} else {
NSAssert(([_lifecycleConfig.appType isEqualToEnum:SDLAppHMITypeNavigation] || [_lifecycleConfig.appType isEqualToEnum:SDLAppHMITypeProjection]), @"If your app is a NAVIGATION or PROJECTION HMI type, you must set a streaming media configuration on SDLConfiguration");
// If we don't have a streaming config, we MUST NOT be navigation or projection
NSAssert(!([_lifecycleConfig.appType isEqualToEnum:SDLAppHMITypeNavigation] || [_lifecycleConfig.appType isEqualToEnum:SDLAppHMITypeProjection]), @"If your app is a NAVIGATION or PROJECTION HMI type, you must set a streaming media configuration on SDLConfiguration");
}

return self;
Expand Down
7 changes: 0 additions & 7 deletions SmartDeviceLink/SDLProtocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,11 @@ extern NSString *const SDLProtocolSecurityErrorDomain;
@interface SDLProtocol : SDLAbstractProtocol <SDLProtocolListener>

// Sending
- (void)sendStartSessionWithType:(SDLServiceType)serviceType __deprecated_msg(("Use startServiceWithType: instead"));
- (void)startServiceWithType:(SDLServiceType)serviceType __deprecated_msg(("Use startServiceWithType:payload: instead"));
- (void)startServiceWithType:(SDLServiceType)serviceType payload:(nullable NSData *)payload;

- (void)startSecureServiceWithType:(SDLServiceType)serviceType completionHandler:(void (^)(BOOL success, NSError *error))completionHandler __deprecated_msg(("Use startSecureServiceWithType:payload:completionHandler instead"));
- (void)startSecureServiceWithType:(SDLServiceType)serviceType payload:(nullable NSData *)payload completionHandler:(void (^)(BOOL success, NSError *error))completionHandler;

- (void)sendEndSessionWithType:(SDLServiceType)serviceType __deprecated_msg(("Use endServiceWithType: instead"));
- (void)endServiceWithType:(SDLServiceType)serviceType;
- (void)sendRPC:(SDLRPCMessage *)message;
- (BOOL)sendRPC:(SDLRPCMessage *)message encrypted:(BOOL)encryption error:(NSError **)error;
- (void)sendRPCRequest:(SDLRPCRequest *)rpcRequest __deprecated_msg(("Use sendRPC: instead"));
- (void)sendRawData:(NSData *)data withServiceType:(SDLServiceType)serviceType;
- (void)sendEncryptedRawData:(NSData *)data onService:(SDLServiceType)serviceType;

Expand Down
55 changes: 0 additions & 55 deletions SmartDeviceLink/SDLProtocol.m
Original file line number Diff line number Diff line change
Expand Up @@ -82,27 +82,15 @@ - (UInt8)sdl_retrieveSessionIDforServiceType:(SDLServiceType)serviceType {
return header.sessionID;
}

- (void)sendStartSessionWithType:(SDLServiceType)serviceType {
[self startServiceWithType:serviceType payload:nil];
}


#pragma mark - Start Service

- (void)startServiceWithType:(SDLServiceType)serviceType {
[self startServiceWithType:serviceType payload:nil];
}

- (void)startServiceWithType:(SDLServiceType)serviceType payload:(nullable NSData *)payload {
// No encryption, just build and send the message synchronously
SDLProtocolMessage *message = [self sdl_createStartServiceMessageWithType:serviceType encrypted:NO payload:payload];
[self sdl_sendDataToTransport:message.data onService:serviceType];
}

- (void)startSecureServiceWithType:(SDLServiceType)serviceType completionHandler:(void (^)(BOOL success, NSError *error))completionHandler {
[self startSecureServiceWithType:serviceType payload:nil completionHandler:completionHandler];
}

- (void)startSecureServiceWithType:(SDLServiceType)serviceType payload:(nullable NSData *)payload completionHandler:(void (^)(BOOL success, NSError *error))completionHandler {
[self sdl_initializeTLSEncryptionWithCompletionHandler:^(BOOL success, NSError *error) {
if (!success) {
Expand Down Expand Up @@ -177,10 +165,6 @@ - (void)sdl_initializeTLSEncryptionWithCompletionHandler:(void (^)(BOOL success,

#pragma mark - End Service

- (void)sendEndSessionWithType:(SDLServiceType)serviceType {
[self endServiceWithType:serviceType];
}

- (void)endServiceWithType:(SDLServiceType)serviceType {
SDLProtocolHeader *header = [SDLProtocolHeader headerForVersion:[SDLGlobals sharedGlobals].majorProtocolVersion];
header.frameType = SDLFrameTypeControl;
Expand Down Expand Up @@ -295,11 +279,6 @@ - (BOOL)sendRPC:(SDLRPCMessage *)message encrypted:(BOOL)encryption error:(NSErr
return YES;
}

// SDLRPCRequest in from app -> SDLProtocolMessage out to transport layer.
- (void)sendRPCRequest:(SDLRPCRequest *)rpcRequest {
[self sendRPC:rpcRequest];
}

// Use for normal messages
- (void)sdl_sendDataToTransport:(NSData *)data onService:(NSInteger)priority {
[_prioritizedCollection addObject:data withPriority:priority];
Expand Down Expand Up @@ -461,19 +440,6 @@ - (void)handleProtocolStartServiceACKMessage:(SDLProtocolMessage *)startServiceA
if ([listener respondsToSelector:@selector(handleProtocolStartServiceACKMessage:)]) {
[listener handleProtocolStartServiceACKMessage:startServiceACK];
}

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
if ([listener respondsToSelector:@selector(handleProtocolStartSessionACK:)]) {
[listener handleProtocolStartSessionACK:startServiceACK.header];
}

if ([listener respondsToSelector:@selector(handleProtocolStartSessionACK:sessionID:version:)]) {
[listener handleProtocolStartSessionACK:startServiceACK.header.serviceType
sessionID:startServiceACK.header.sessionID
version:startServiceACK.header.version];
#pragma clang diagnostic pop
}
}
}

Expand All @@ -484,13 +450,6 @@ - (void)handleProtocolStartServiceNAKMessage:(SDLProtocolMessage *)startServiceN
if ([listener respondsToSelector:@selector(handleProtocolStartServiceNAKMessage:)]) {
[listener handleProtocolStartServiceNAKMessage:startServiceNAK];
}

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
if ([listener respondsToSelector:@selector(handleProtocolStartSessionNACK:)]) {
[listener handleProtocolStartSessionNACK:startServiceNAK.header.serviceType];
}
#pragma clang diagnostic pop
}
}

Expand All @@ -502,14 +461,7 @@ - (void)handleProtocolEndServiceACKMessage:(SDLProtocolMessage *)endServiceACK {
if ([listener respondsToSelector:@selector(handleProtocolEndServiceACKMessage:)]) {
[listener handleProtocolEndServiceACKMessage:endServiceACK];
}

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
if ([listener respondsToSelector:@selector(handleProtocolEndSessionACK:)]) {
[listener handleProtocolEndSessionACK:endServiceACK.header.serviceType];
}
}
#pragma clang diagnostic pop
}

- (void)handleProtocolEndServiceNAKMessage:(SDLProtocolMessage *)endServiceNAK {
Expand All @@ -519,14 +471,7 @@ - (void)handleProtocolEndServiceNAKMessage:(SDLProtocolMessage *)endServiceNAK {
if ([listener respondsToSelector:@selector(handleProtocolEndServiceNAKMessage:)]) {
[listener handleProtocolEndServiceNAKMessage:endServiceNAK];
}

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
if ([listener respondsToSelector:@selector(handleProtocolEndSessionNACK:)]) {
[listener handleProtocolEndSessionNACK:endServiceNAK.header.serviceType];
}
}
#pragma clang diagnostic pop
}

- (void)handleHeartbeatForSession:(Byte)session {
Expand Down
1 change: 0 additions & 1 deletion SmartDeviceLink/SDLProtocolHeader.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ NS_ASSUME_NONNULL_BEGIN

@property (assign, nonatomic, readonly) UInt8 version;
@property (assign, nonatomic, readonly) NSUInteger size;
@property (assign, nonatomic) BOOL compressed __deprecated_msg("This is a mirror for encrypted");
@property (assign, nonatomic) BOOL encrypted;
@property (assign, nonatomic) SDLFrameType frameType;
@property (assign, nonatomic) SDLServiceType serviceType;
Expand Down
8 changes: 0 additions & 8 deletions SmartDeviceLink/SDLProtocolHeader.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,6 @@ - (instancetype)init {
return self;
}

- (BOOL)compressed {
return _encrypted;
}

- (void)setCompressed:(BOOL)compressed {
_encrypted = compressed;
}

- (id)copyWithZone:(nullable NSZone *)zone {
[self doesNotRecognizeSelector:_cmd];
return 0;
Expand Down
5 changes: 0 additions & 5 deletions SmartDeviceLink/SDLProtocolListener.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ NS_ASSUME_NONNULL_BEGIN
- (void)handleProtocolEndServiceNAKMessage:(SDLProtocolMessage *)endServiceNAK;

// Older protocol handlers
- (void)handleProtocolStartSessionACK:(SDLServiceType)serviceType sessionID:(Byte)sessionID version:(Byte)version __deprecated_msg("use handleProtocolStartSessionACKMessage: instead");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The handleProtocolStartSessionACK protocol handler is still being used in the SDLProxy class. The SDLProxy class needs to implement the handleProtocolStartServiceACKMessageprotocol handler, otherwise setup will not complete. This is why setup is not finishing when the protocol string is com.smartdevicelink.prot2.

- (void)handleProtocolStartSessionACK:(SDLProtocolHeader *)header __deprecated_msg("use handleProtocolStartSessionACKMessage: instead");
- (void)handleProtocolStartSessionNACK:(SDLServiceType)serviceType __deprecated_msg("use handleProtocolStartSessionNAKMessage: instead");
- (void)handleProtocolEndSessionACK:(SDLServiceType)serviceType __deprecated_msg("use handleProtocolEndSessionACKMessage: instead");
- (void)handleProtocolEndSessionNACK:(SDLServiceType)serviceType __deprecated_msg("use handleProtocolEndSessionNAKMessage: instead");
- (void)handleHeartbeatForSession:(Byte)session;
Copy link
Contributor

@NicoleYarroch NicoleYarroch Sep 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

handleProtocolStartSessionACK, handleProtocolStartSessionNACK, handleProtocolEndSessionACK, and handleProtocolEndSessionNACK are all being used in the SDLStreamingMediaLifecycleManager. This means that video is not streaming because setup does not finish.

- (void)handleHeartbeatACK;
- (void)onProtocolMessageReceived:(SDLProtocolMessage *)msg;
Expand Down
2 changes: 0 additions & 2 deletions SmartDeviceLink/SDLProtocolMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ NS_ASSUME_NONNULL_BEGIN
- (NSString *)description;
- (nullable NSDictionary<NSString *, id> *)rpcDictionary; // Use for RPC type messages to obtain the data in a dictionary

+ (UInt8)determineVersion:(NSData *)data __deprecated_msg(("Use SDLProtocolHeader determineVersion: instead"));

@end

NS_ASSUME_NONNULL_END
4 changes: 0 additions & 4 deletions SmartDeviceLink/SDLProtocolMessage.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ - (NSData *)data {
return dataOut;
}

+ (UInt8)determineVersion:(NSData *)data {
return [SDLProtocolHeader determineVersion:data];
}

- (NSString *)description {
// Print the header data.
NSMutableString *description = [[NSMutableString alloc] init];
Expand Down
2 changes: 0 additions & 2 deletions SmartDeviceLink/SDLProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,8 @@ __deprecated_msg("Use SDLManager instead")
- (void)removeDelegate:(NSObject<SDLProxyListener> *)delegate;

- (void)sendRPC:(SDLRPCMessage *)message;
- (void)sendRPCRequest:(SDLRPCMessage *)msg __deprecated_msg("use -sendRPC: instead");

- (void)handleRPCDictionary:(NSDictionary<NSString *, id> *)dictionary;
- (void)handleRpcMessage:(NSDictionary *)msg __deprecated_msg("use -handleRPCDictionary: instead");

- (void)handleProtocolMessage:(SDLProtocolMessage *)msgData;

Expand Down
19 changes: 5 additions & 14 deletions SmartDeviceLink/SDLProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ - (void)addSecurityManagers:(NSArray<Class> *)securityManagerClasses forAppId:(N
- (void)onProtocolOpened {
_isConnected = YES;
SDLLogV(@"Proxy RPC protocol opened");
[self.protocol startServiceWithType:SDLServiceTypeRPC];
// THe RPC payload will be created by the protocol object...it's weird and confusing, I know.
[self.protocol startServiceWithType:SDLServiceTypeRPC payload:nil];

if (self.startSessionTimer == nil) {
self.startSessionTimer = [[SDLTimer alloc] initWithDuration:StartSessionTime repeat:NO];
Expand All @@ -215,12 +216,12 @@ - (void)onError:(NSString *)info exception:(NSException *)e {
[self invokeMethodOnDelegates:@selector(onError:) withObject:e];
}

- (void)handleProtocolStartSessionACK:(SDLProtocolHeader *)header {
- (void)handleProtocolStartServiceACKMessage:(SDLProtocolMessage *)startServiceACK {
// Turn off the timer, the start session response came back
[self.startSessionTimer cancel];
SDLLogV(@"StartSession (response)\nSessionId: %d for serviceType %d", header.sessionID, header.serviceType);
SDLLogV(@"StartSession (response)\nSessionId: %d for serviceType %d", startServiceACK.header.sessionID, startServiceACK.header.serviceType);

if (header.serviceType == SDLServiceTypeRPC) {
if (startServiceACK.header.serviceType == SDLServiceTypeRPC) {
[self invokeMethodOnDelegates:@selector(onProxyOpened) withObject:nil];
}
}
Expand All @@ -243,12 +244,6 @@ - (void)sendRPC:(SDLRPCMessage *)message {
}
}

- (void)sendRPCRequest:(SDLRPCMessage *)msg {
if ([msg isKindOfClass:SDLRPCRequest.class]) {
[self sendRPC:msg];
}
}

- (void)handleProtocolMessage:(SDLProtocolMessage *)incomingMessage {
// Convert protocol message to dictionary
NSDictionary<NSString *, id> *rpcMessageAsDictionary = [incomingMessage rpcDictionary];
Expand Down Expand Up @@ -312,10 +307,6 @@ - (void)handleRPCDictionary:(NSDictionary<NSString *, id> *)dict {
}
}

- (void)handleRpcMessage:(NSDictionary<NSString *, id> *)msg {
[self handleRPCDictionary:msg];
}


#pragma mark - RPC Handlers

Expand Down
Loading