diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2017-09-20 10:28:09 -0400 |
---|---|---|
committer | Joel Fischer <joeljfischer@gmail.com> | 2017-09-20 10:28:09 -0400 |
commit | 74efe6658d369283fa1e950c919f98b136acf364 (patch) | |
tree | f95da09f48d849fc240975f80b8fc8db83bf4e0d | |
parent | f3ab54fe82a1bf2c6000f148e295c66f17cb7081 (diff) | |
download | sdl_ios-74efe6658d369283fa1e950c919f98b136acf364.tar.gz |
Remove deprecated code
* Fixed a bug in `SDLConfiguration` and added additional tests
22 files changed, 51 insertions, 254 deletions
diff --git a/SmartDeviceLink/SDLAbstractProtocol.h b/SmartDeviceLink/SDLAbstractProtocol.h index df804269e..e629e302a 100644 --- a/SmartDeviceLink/SDLAbstractProtocol.h +++ b/SmartDeviceLink/SDLAbstractProtocol.h @@ -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:(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:(NSData *)payload completionHandler:(void (^)(BOOL success, NSError *error))completionHandler; - -- (void)sendEndSessionWithType:(SDLServiceType)serviceType __deprecated_msg(("Use endServiceWithType: instead")); +- (void)startServiceWithType:(SDLServiceType)serviceType payload:(nullable NSData *)payload; +- (void)startSecureServiceWithType:(SDLServiceType)serviceType payload:(nullable NSData *)payload completionHandler:(void (^)(BOOL success, NSError *error))completionHandler; - (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; diff --git a/SmartDeviceLink/SDLAbstractProtocol.m b/SmartDeviceLink/SDLAbstractProtocol.m index 26443ac2f..fa3502799 100644 --- a/SmartDeviceLink/SDLAbstractProtocol.m +++ b/SmartDeviceLink/SDLAbstractProtocol.m @@ -17,27 +17,11 @@ NS_ASSUME_NONNULL_BEGIN } // Implement in subclasses. -- (void)sendStartSessionWithType:(SDLServiceType)serviceType { +- (void)startServiceWithType:(SDLServiceType)serviceType payload:(nullable NSData *)payload { [self doesNotRecognizeSelector:_cmd]; } -- (void)startServiceWithType:(SDLServiceType)serviceType { - [self doesNotRecognizeSelector:_cmd]; -} - -- (void)startServiceWithType:(SDLServiceType)serviceType payload:(NSData *)payload { - [self doesNotRecognizeSelector:_cmd]; -} - -- (void)startSecureServiceWithType:(SDLServiceType)serviceType completionHandler:(void (^)(BOOL, NSError *))completionHandler { - [self doesNotRecognizeSelector:_cmd]; -} - -- (void)startSecureServiceWithType:(SDLServiceType)serviceType payload:(NSData *)payload completionHandler:(void (^)(BOOL, NSError *))completionHandler { - [self doesNotRecognizeSelector:_cmd]; -} - -- (void)sendEndSessionWithType:(SDLServiceType)serviceType { +- (void)startSecureServiceWithType:(SDLServiceType)serviceType payload:(nullable NSData *)payload completionHandler:(void (^)(BOOL, NSError *))completionHandler { [self doesNotRecognizeSelector:_cmd]; } @@ -54,14 +38,6 @@ NS_ASSUME_NONNULL_BEGIN return NO; } -- (void)sendRPCRequest:(SDLRPCRequest *)rpcRequest { - [self doesNotRecognizeSelector:_cmd]; -} - -- (void)sendHeartbeat { - [self doesNotRecognizeSelector:_cmd]; -} - - (void)handleBytesFromTransport:(NSData *)receivedData { [self doesNotRecognizeSelector:_cmd]; } @@ -70,10 +46,6 @@ NS_ASSUME_NONNULL_BEGIN [self doesNotRecognizeSelector:_cmd]; } -- (void)sendRawDataStream:(NSInputStream *)inputStream withServiceType:(SDLServiceType)serviceType { - [self doesNotRecognizeSelector:_cmd]; -} - - (void)sendEncryptedRawData:(NSData *)data onService:(SDLServiceType)serviceType { [self doesNotRecognizeSelector:_cmd]; } diff --git a/SmartDeviceLink/SDLConfiguration.h b/SmartDeviceLink/SDLConfiguration.h index 52706376b..c5a758b59 100644 --- a/SmartDeviceLink/SDLConfiguration.h +++ b/SmartDeviceLink/SDLConfiguration.h @@ -38,42 +38,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. @param lifecycleConfig The lifecycle configuration to be used. diff --git a/SmartDeviceLink/SDLConfiguration.m b/SmartDeviceLink/SDLConfiguration.m index ebb7477d9..957e19635 100644 --- a/SmartDeviceLink/SDLConfiguration.m +++ b/SmartDeviceLink/SDLConfiguration.m @@ -59,6 +59,7 @@ NS_ASSUME_NONNULL_BEGIN _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"); diff --git a/SmartDeviceLink/SDLProtocol.h b/SmartDeviceLink/SDLProtocol.h index ea6df9667..a0a4d1ecd 100644 --- a/SmartDeviceLink/SDLProtocol.h +++ b/SmartDeviceLink/SDLProtocol.h @@ -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; diff --git a/SmartDeviceLink/SDLProtocol.m b/SmartDeviceLink/SDLProtocol.m index 1adef65f0..186226414 100644 --- a/SmartDeviceLink/SDLProtocol.m +++ b/SmartDeviceLink/SDLProtocol.m @@ -82,27 +82,15 @@ NS_ASSUME_NONNULL_BEGIN 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) { @@ -177,10 +165,6 @@ NS_ASSUME_NONNULL_BEGIN #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; @@ -295,11 +279,6 @@ NS_ASSUME_NONNULL_BEGIN 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]; @@ -461,19 +440,6 @@ NS_ASSUME_NONNULL_BEGIN 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 - } } } @@ -484,13 +450,6 @@ NS_ASSUME_NONNULL_BEGIN 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 } } @@ -502,14 +461,7 @@ NS_ASSUME_NONNULL_BEGIN 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 { @@ -519,14 +471,7 @@ NS_ASSUME_NONNULL_BEGIN 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 { diff --git a/SmartDeviceLink/SDLProtocolHeader.h b/SmartDeviceLink/SDLProtocolHeader.h index cfef757fe..e28539597 100644 --- a/SmartDeviceLink/SDLProtocolHeader.h +++ b/SmartDeviceLink/SDLProtocolHeader.h @@ -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; diff --git a/SmartDeviceLink/SDLProtocolHeader.m b/SmartDeviceLink/SDLProtocolHeader.m index 2c193fecb..afe93724d 100644 --- a/SmartDeviceLink/SDLProtocolHeader.m +++ b/SmartDeviceLink/SDLProtocolHeader.m @@ -22,14 +22,6 @@ NS_ASSUME_NONNULL_BEGIN return self; } -- (BOOL)compressed { - return _encrypted; -} - -- (void)setCompressed:(BOOL)compressed { - _encrypted = compressed; -} - - (id)copyWithZone:(nullable NSZone *)zone { [self doesNotRecognizeSelector:_cmd]; return 0; diff --git a/SmartDeviceLink/SDLProtocolListener.h b/SmartDeviceLink/SDLProtocolListener.h index 0657fc2c0..7888a9ee3 100644 --- a/SmartDeviceLink/SDLProtocolListener.h +++ b/SmartDeviceLink/SDLProtocolListener.h @@ -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"); -- (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; - (void)handleHeartbeatACK; - (void)onProtocolMessageReceived:(SDLProtocolMessage *)msg; diff --git a/SmartDeviceLink/SDLProtocolMessage.h b/SmartDeviceLink/SDLProtocolMessage.h index 893c6ee09..4028ec497 100644 --- a/SmartDeviceLink/SDLProtocolMessage.h +++ b/SmartDeviceLink/SDLProtocolMessage.h @@ -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 diff --git a/SmartDeviceLink/SDLProtocolMessage.m b/SmartDeviceLink/SDLProtocolMessage.m index b4a5fb5d9..66680e40e 100644 --- a/SmartDeviceLink/SDLProtocolMessage.m +++ b/SmartDeviceLink/SDLProtocolMessage.m @@ -49,10 +49,6 @@ NS_ASSUME_NONNULL_BEGIN return dataOut; } -+ (UInt8)determineVersion:(NSData *)data { - return [SDLProtocolHeader determineVersion:data]; -} - - (NSString *)description { // Print the header data. NSMutableString *description = [[NSMutableString alloc] init]; diff --git a/SmartDeviceLink/SDLProxy.h b/SmartDeviceLink/SDLProxy.h index 80018677c..6beb28d8d 100644 --- a/SmartDeviceLink/SDLProxy.h +++ b/SmartDeviceLink/SDLProxy.h @@ -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; diff --git a/SmartDeviceLink/SDLProxy.m b/SmartDeviceLink/SDLProxy.m index 16ed595a1..d2b913f7d 100644 --- a/SmartDeviceLink/SDLProxy.m +++ b/SmartDeviceLink/SDLProxy.m @@ -194,7 +194,8 @@ static float DefaultConnectionTimeout = 45.0; - (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]; @@ -243,12 +244,6 @@ static float DefaultConnectionTimeout = 45.0; } } -- (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]; @@ -312,10 +307,6 @@ static float DefaultConnectionTimeout = 45.0; } } -- (void)handleRpcMessage:(NSDictionary<NSString *, id> *)msg { - [self handleRPCDictionary:msg]; -} - #pragma mark - RPC Handlers diff --git a/SmartDeviceLink/SDLShow.h b/SmartDeviceLink/SDLShow.h index 5c44548ae..8eef691a6 100644 --- a/SmartDeviceLink/SDLShow.h +++ b/SmartDeviceLink/SDLShow.h @@ -48,8 +48,6 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)initWithMainField1:(nullable NSString *)mainField1 mainField2:(nullable NSString *)mainField2 alignment:(nullable SDLTextAlignment)alignment statusBar:(nullable NSString *)statusBar mediaClock:(nullable NSString *)mediaClock mediaTrack:(nullable NSString *)mediaTrack; -- (instancetype)initWithMainField1:(nullable NSString *)mainField1 mainField2:(nullable NSString *)mainField2 mainField3:(nullable NSString *)mainField3 mainField4:(nullable NSString *)mainField4 alignment:(nullable SDLTextAlignment)alignment statusBar:(nullable NSString *)statusBar mediaClock:(nullable NSString *)mediaClock mediaTrack:(nullable NSString *)mediaTrack graphic:(nullable SDLImage *)graphic softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons customPresets:(nullable NSArray<NSString *> *)customPresets __deprecated_msg(("Use initWithMainField1:(NSString *)mainField1 (NSString *)mainField2 (NSString *)mainField3 (NSString *)mainField4 (SDLTextAlignment *)alignment (NSString *)statusBar (NSString *)mediaClock (NSString *)mediaTrack (SDLImage *)graphic (NSArray<SDLSoftButton *> *)softButtons (NSArray<NSString *> *)customPresets (SDLMetadataStruct *)metadata instead")); - - (instancetype)initWithMainField1:(nullable NSString *)mainField1 mainField2:(nullable NSString *)mainField2 mainField3:(nullable NSString *)mainField3 mainField4:(nullable NSString *)mainField4 alignment:(nullable SDLTextAlignment)alignment statusBar:(nullable NSString *)statusBar mediaClock:(nullable NSString *)mediaClock mediaTrack:(nullable NSString *)mediaTrack graphic:(nullable SDLImage *)graphic softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons customPresets:(nullable NSArray<NSString *> *)customPresets textFieldMetadata:(nullable SDLMetadataTags *)metadata; /** diff --git a/SmartDeviceLink/SDLShow.m b/SmartDeviceLink/SDLShow.m index 80f4f9d18..388865d24 100644 --- a/SmartDeviceLink/SDLShow.m +++ b/SmartDeviceLink/SDLShow.m @@ -73,27 +73,6 @@ NS_ASSUME_NONNULL_BEGIN return [self initWithMainField1:mainField1 mainField2:mainField2 mainField3:nil mainField4:nil alignment:alignment statusBar:statusBar mediaClock:mediaClock mediaTrack:mediaTrack graphic:nil softButtons:nil customPresets:nil textFieldMetadata:nil]; } -- (instancetype)initWithMainField1:(nullable NSString *)mainField1 mainField2:(nullable NSString *)mainField2 mainField3:(nullable NSString *)mainField3 mainField4:(nullable NSString *)mainField4 alignment:(nullable SDLTextAlignment)alignment statusBar:(nullable NSString *)statusBar mediaClock:(nullable NSString *)mediaClock mediaTrack:(nullable NSString *)mediaTrack graphic:(nullable SDLImage *)graphic softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons customPresets:(nullable NSArray<NSString *> *)customPresets { - self = [self init]; - if (!self) { - return nil; - } - - self.mainField1 = mainField1; - self.mainField2 = mainField2; - self.mainField3 = mainField3; - self.mainField4 = mainField4; - self.statusBar = statusBar; - self.mediaClock = mediaClock; - self.mediaTrack = mediaTrack; - self.alignment = alignment; - self.graphic = graphic; - self.softButtons = [softButtons mutableCopy]; - self.customPresets = [customPresets mutableCopy]; - - return self; -} - - (instancetype)initWithMainField1:(nullable NSString *)mainField1 mainField2:(nullable NSString *)mainField2 mainField3:(nullable NSString *)mainField3 mainField4:(nullable NSString *)mainField4 alignment:(nullable SDLTextAlignment)alignment statusBar:(nullable NSString *)statusBar mediaClock:(nullable NSString *)mediaClock mediaTrack:(nullable NSString *)mediaTrack graphic:(nullable SDLImage *)graphic softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons customPresets:(nullable NSArray<NSString *> *)customPresets textFieldMetadata:(nullable SDLMetadataTags *)metadata { self = [self init]; if (!self) { diff --git a/SmartDeviceLink/SDLStreamingMediaLifecycleManager.m b/SmartDeviceLink/SDLStreamingMediaLifecycleManager.m index 53a813551..86523c0f4 100644 --- a/SmartDeviceLink/SDLStreamingMediaLifecycleManager.m +++ b/SmartDeviceLink/SDLStreamingMediaLifecycleManager.m @@ -283,7 +283,7 @@ static NSUInteger const SDLFramesToSendOnBackground = 30; // Decide if we need to start a secure service or not if (self.requestedEncryptionType != SDLStreamingEncryptionFlagNone) { - [self.protocol startSecureServiceWithType:SDLServiceTypeVideo completionHandler:^(BOOL success, NSError *error) { + [self.protocol startSecureServiceWithType:SDLServiceTypeVideo payload:nil completionHandler:^(BOOL success, NSError *error) { // This only fires if we fail if (error) { SDLLogE(@"TLS setup error: %@", error); @@ -291,7 +291,7 @@ static NSUInteger const SDLFramesToSendOnBackground = 30; } }]; } else { - [self.protocol startServiceWithType:SDLServiceTypeVideo]; + [self.protocol startServiceWithType:SDLServiceTypeVideo payload:nil]; } } @@ -348,7 +348,7 @@ static NSUInteger const SDLFramesToSendOnBackground = 30; - (void)didEnterStateAudioStreamStarting { SDLLogD(@"Audio stream starting"); if (self.requestedEncryptionType != SDLStreamingEncryptionFlagNone) { - [self.protocol startSecureServiceWithType:SDLServiceTypeAudio completionHandler:^(BOOL success, NSError *error) { + [self.protocol startSecureServiceWithType:SDLServiceTypeAudio payload:nil completionHandler:^(BOOL success, NSError *error) { // This only fires if we fail!! if (error) { SDLLogE(@"TLS setup error: %@", error); @@ -356,7 +356,7 @@ static NSUInteger const SDLFramesToSendOnBackground = 30; } }]; } else { - [self.protocol startServiceWithType:SDLServiceTypeAudio]; + [self.protocol startServiceWithType:SDLServiceTypeAudio payload:nil]; } } diff --git a/SmartDeviceLink/SDLSyncMsgVersion.h b/SmartDeviceLink/SDLSyncMsgVersion.h index de5050889..87af0c1d3 100644 --- a/SmartDeviceLink/SDLSyncMsgVersion.h +++ b/SmartDeviceLink/SDLSyncMsgVersion.h @@ -14,10 +14,7 @@ NS_ASSUME_NONNULL_BEGIN @interface SDLSyncMsgVersion : SDLRPCStruct -// TODO: (Alex M.)[2016-12-1] Change from NSInteger to UInt8 -- (instancetype)initWithMajorVersion:(NSInteger)majorVersion minorVersion:(NSInteger)minorVersion __deprecated_msg("Use initWithMajorVersion:minorVersion:patchVersion: instead"); - -- (instancetype)initWithMajorVersion:(NSInteger)majorVersion minorVersion:(NSInteger)minorVersion patchVersion:(NSInteger)patchVersion; +- (instancetype)initWithMajorVersion:(UInt8)majorVersion minorVersion:(UInt8)minorVersion patchVersion:(UInt8)patchVersion; /** * @abstract The major version indicates versions that is not-compatible to previous versions diff --git a/SmartDeviceLink/SDLSyncMsgVersion.m b/SmartDeviceLink/SDLSyncMsgVersion.m index 780edb2fe..7d256ce14 100644 --- a/SmartDeviceLink/SDLSyncMsgVersion.m +++ b/SmartDeviceLink/SDLSyncMsgVersion.m @@ -11,20 +11,7 @@ NS_ASSUME_NONNULL_BEGIN @implementation SDLSyncMsgVersion -- (instancetype)initWithMajorVersion:(NSInteger)majorVersion minorVersion:(NSInteger)minorVersion { - self = [self init]; - if (!self) { - return nil; - } - - self.majorVersion = @(majorVersion); - self.minorVersion = @(minorVersion); - self.patchVersion = @(0); - - return self; -} - -- (instancetype)initWithMajorVersion:(NSInteger)majorVersion minorVersion:(NSInteger)minorVersion patchVersion:(NSInteger)patchVersion { +- (instancetype)initWithMajorVersion:(UInt8)majorVersion minorVersion:(UInt8)minorVersion patchVersion:(UInt8)patchVersion { self = [self init]; if (!self) { return nil; diff --git a/SmartDeviceLink/SDLTimer.h b/SmartDeviceLink/SDLTimer.h index 0382b7f67..cba9efefa 100644 --- a/SmartDeviceLink/SDLTimer.h +++ b/SmartDeviceLink/SDLTimer.h @@ -13,7 +13,7 @@ NS_ASSUME_NONNULL_BEGIN @property (assign, nonatomic) float duration; - (instancetype)init; -- (instancetype)initWithDuration:(float)duration __deprecated; +- (instancetype)initWithDuration:(float)duration; - (instancetype)initWithDuration:(float)duration repeat:(BOOL)repeat; - (void)start; - (void)cancel; diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLConfigurationSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLConfigurationSpec.m index 358e9f816..5401af98a 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLConfigurationSpec.m +++ b/SmartDeviceLinkTests/DevAPISpecs/SDLConfigurationSpec.m @@ -5,16 +5,18 @@ #import "SDLLifecycleConfiguration.h" #import "SDLLogConfiguration.h" #import "SDLLockScreenConfiguration.h" +#import "SDLStreamingMediaConfiguration.h" QuickSpecBegin(SDLConfigurationSpec) -describe(@"a configuration", ^{ +fdescribe(@"a configuration", ^{ __block SDLConfiguration *testConfig = nil; context(@"created with custom configs", ^{ __block SDLLifecycleConfiguration *someLifecycleConfig = nil; __block SDLLockScreenConfiguration *someLockscreenConfig = nil; __block SDLLogConfiguration *someLogConfig = nil; + __block SDLStreamingMediaConfiguration *someStreamingConfig = nil; __block NSString *someAppName = nil; __block NSString *someAppId = nil; @@ -30,14 +32,43 @@ describe(@"a configuration", ^{ someLifecycleConfig = [SDLLifecycleConfiguration defaultConfigurationWithAppName:someAppName appId:someAppId]; someLockscreenConfig = [SDLLockScreenConfiguration enabledConfigurationWithAppIcon:someImage backgroundColor:someBackgroundColor]; someLogConfig = [SDLLogConfiguration defaultConfiguration]; - - testConfig = [SDLConfiguration configurationWithLifecycle:someLifecycleConfig lockScreen:someLockscreenConfig logging:someLogConfig]; + someStreamingConfig = [SDLStreamingMediaConfiguration insecureConfiguration]; }); - it(@"should contain the correct configs", ^{ + it(@"should create correctly with initWithLifecycle:lockScreen:logging:", ^{ + testConfig = [[SDLConfiguration alloc] initWithLifecycle:someLifecycleConfig lockScreen:someLockscreenConfig logging:someLogConfig]; + + expect(testConfig.lifecycleConfig).to(equal(someLifecycleConfig)); + expect(testConfig.lockScreenConfig).to(equal(someLockscreenConfig)); + expect(testConfig.loggingConfig).to(equal(someLogConfig)); + expect(testConfig.streamingMediaConfig).to(beNil()); + }); + + it(@"should create correctly with configurationWithLifecycle:lockScreen:logging:", ^{ + testConfig = [SDLConfiguration configurationWithLifecycle:someLifecycleConfig lockScreen:someLockscreenConfig logging:someLogConfig]; + + expect(testConfig.lifecycleConfig).to(equal(someLifecycleConfig)); + expect(testConfig.lockScreenConfig).to(equal(someLockscreenConfig)); + expect(testConfig.loggingConfig).to(equal(someLogConfig)); + expect(testConfig.streamingMediaConfig).to(beNil()); + }); + + it(@"should create correctly with initWithLifecycle:lockScreen:logging:streamingMedia:", ^{ + testConfig = [[SDLConfiguration alloc] initWithLifecycle:someLifecycleConfig lockScreen:someLockscreenConfig logging:someLogConfig streamingMedia:someStreamingConfig]; + + expect(testConfig.lifecycleConfig).to(equal(someLifecycleConfig)); + expect(testConfig.lockScreenConfig).to(equal(someLockscreenConfig)); + expect(testConfig.loggingConfig).to(equal(someLogConfig)); + expect(testConfig.streamingMediaConfig).to(equal(someStreamingConfig)); + }); + + it(@"should create correctly with configurationWithLifecycle:lockScreen:logging:streamingMedia:", ^{ + testConfig = [SDLConfiguration configurationWithLifecycle:someLifecycleConfig lockScreen:someLockscreenConfig logging:someLogConfig streamingMedia:someStreamingConfig]; + expect(testConfig.lifecycleConfig).to(equal(someLifecycleConfig)); expect(testConfig.lockScreenConfig).to(equal(someLockscreenConfig)); expect(testConfig.loggingConfig).to(equal(someLogConfig)); + expect(testConfig.streamingMediaConfig).to(equal(someStreamingConfig)); }); }); }); diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m index 92f721803..70e30f6b5 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m +++ b/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m @@ -12,6 +12,7 @@ #import "SDLLifecycleConfiguration.h" #import "SDLLockScreenConfiguration.h" #import "SDLLockScreenManager.h" +#import "SDLLogConfiguration.h" #import "SDLManagerDelegate.h" #import "SDLNotificationDispatcher.h" #import "SDLOnHashChange.h" @@ -79,7 +80,7 @@ xdescribe(@"a lifecycle manager", ^{ testLifecycleConfig.shortAppName = @"Short Name"; testLifecycleConfig.appType = SDLAppHMITypeNavigation; - testConfig = [SDLConfiguration configurationWithLifecycle:testLifecycleConfig lockScreen:[SDLLockScreenConfiguration disabledConfiguration]]; + testConfig = [SDLConfiguration configurationWithLifecycle:testLifecycleConfig lockScreen:[SDLLockScreenConfiguration disabledConfiguration] logging:[SDLLogConfiguration defaultConfiguration]]; testManager = [[SDLLifecycleManager alloc] initWithConfiguration:testConfig delegate:managerDelegateMock]; testManager.lockScreenManager = lockScreenManagerMock; testManager.fileManager = fileManagerMock; diff --git a/SmartDeviceLinkTests/ProtocolSpecs/HeaderSpecs/SDLV2ProtocolHeaderSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/HeaderSpecs/SDLV2ProtocolHeaderSpec.m index f62ddf57d..74969e062 100644 --- a/SmartDeviceLinkTests/ProtocolSpecs/HeaderSpecs/SDLV2ProtocolHeaderSpec.m +++ b/SmartDeviceLinkTests/ProtocolSpecs/HeaderSpecs/SDLV2ProtocolHeaderSpec.m @@ -68,36 +68,6 @@ describe(@"Copy Tests", ^ { }); }); -describe(@"compressed deprecated spec", ^{ - describe(@"setting encrypted", ^{ - __block BOOL value = NO; - beforeEach(^{ - testHeader.encrypted = value; - }); - - it(@"should give the same value for compressed", ^{ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - expect(@(testHeader.compressed)).to(equal(@(value))); -#pragma clang diagnostic pop - }); - }); - - describe(@"setting compressed", ^{ - __block BOOL value = YES; - beforeEach(^{ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - testHeader.compressed = value; -#pragma clang diagnostic pop - }); - - it(@"should give the same value for compressed", ^{ - expect(@(testHeader.encrypted)).to(equal(@(value))); - }); - }); -}); - describe(@"Data Tests", ^ { it (@"Should convert to byte data correctly", ^ { expect(testHeader.data).to(equal(testData)); |