From 90ad304197bc87dc43192c4e813da3cbd9c682e9 Mon Sep 17 00:00:00 2001 From: Kujtim Shala Date: Wed, 22 Jan 2020 11:03:37 +0100 Subject: [PATCH 001/415] Fixing lock screen dismiss call if not being presented. --- SmartDeviceLink/SDLLockScreenPresenter.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/SmartDeviceLink/SDLLockScreenPresenter.m b/SmartDeviceLink/SDLLockScreenPresenter.m index d84b3bf95..80bc703b7 100644 --- a/SmartDeviceLink/SDLLockScreenPresenter.m +++ b/SmartDeviceLink/SDLLockScreenPresenter.m @@ -163,6 +163,12 @@ - (void)sdl_dismissLockscreenWithCompletionHandler:(void (^ _Nullable)(void))com if (completionHandler == nil) { return; } return completionHandler(); } + + if (self.lockViewController.presentingViewController == nil) { + SDLLogW(@"Attempted to dismiss lockscreen, but lockViewController is not presented"); + if (completionHandler == nil) { return; } + return completionHandler(); + } // Let ourselves know that the lockscreen will dismiss so we can pause video streaming for a few milliseconds - otherwise the animation to dismiss the lockscreen will be very janky. [[NSNotificationCenter defaultCenter] postNotificationName:SDLLockScreenManagerWillDismissLockScreenViewController object:nil]; From 77cfd53d41459ae0ded67ff3c2234e64465f1ebe Mon Sep 17 00:00:00 2001 From: Justin Gluck Date: Wed, 22 Jan 2020 13:03:33 -0500 Subject: [PATCH 002/415] creating inits to set radio data for XM, AM and FM --- SmartDeviceLink/SDLRadioControlData.h | 32 ++++++++++++++ SmartDeviceLink/SDLRadioControlData.m | 61 +++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) diff --git a/SmartDeviceLink/SDLRadioControlData.h b/SmartDeviceLink/SDLRadioControlData.h index c3d07eaff..bea276856 100644 --- a/SmartDeviceLink/SDLRadioControlData.h +++ b/SmartDeviceLink/SDLRadioControlData.h @@ -41,6 +41,38 @@ NS_ASSUME_NONNULL_BEGIN */ - (instancetype)initWithFrequencyInteger:(nullable NSNumber *)frequencyInteger frequencyFraction:(nullable NSNumber *)frequencyFraction band:(nullable SDLRadioBand)band hdChannel:(nullable NSNumber *)hdChannel radioEnable:(nullable NSNumber *)radioEnable hdRadioEnable:(nullable NSNumber *)hdRadioEnable; + +/// Constructs a newly allocated SDLRadioControlCapabilities object with given parameters. +/// +/// @param frequencyInteger Must be between 875 and 1080 +/// @param frequencyFraction Must be between 0 and 9 +/// @return An instance of the SDLRadioControlData class +- (instancetype)initFMWithFrequencyInteger:(nullable NSNumber *)frequencyInteger frequencyFraction:(nullable NSNumber *)frequencyFraction; + +/// Constructs a newly allocated SDLRadioControlCapabilities object with given parameters. +/// +/// @param hdChannel Must be between 0 and 7 +/// @return An instance of the SDLRadioControlData class +- (instancetype)initFMWithHdChannel:(nullable NSNumber *)hdChannel; + +/// Constructs a newly allocated SDLRadioControlCapabilities object with given parameters. +/// +/// @param frequencyInteger Must be between 875 and 1080 +/// @return An instance of the SDLRadioControlData class +- (instancetype)initAMWithFrequencyInteger:(nullable NSNumber *)frequencyInteger; + +/// Constructs a newly allocated SDLRadioControlCapabilities object with given parameters. +/// +/// @param hdChannel Must be between 0 and 7 +/// @return An instance of the SDLRadioControlData class +- (instancetype)initAMWithHdChannel:(nullable NSNumber *)hdChannel; + +/// Constructs a newly allocated SDLRadioControlCapabilities object with given parameters. +/// +/// @param frequencyInteger Must be between 1 and 1710 +/// @return An instance of the SDLRadioControlData class +- (instancetype)initXMWithFrequencyInteger:(nullable NSNumber *)frequencyInteger; + /** * The integer part of the frequency ie for 101.7 this value should be 101 * diff --git a/SmartDeviceLink/SDLRadioControlData.m b/SmartDeviceLink/SDLRadioControlData.m index 9e4f37c85..5d40ca372 100644 --- a/SmartDeviceLink/SDLRadioControlData.m +++ b/SmartDeviceLink/SDLRadioControlData.m @@ -43,6 +43,67 @@ - (instancetype)initWithFrequencyInteger:(nullable NSNumber *)frequencyI return self; } +- (instancetype)initFMWithFrequencyInteger:(nullable NSNumber *)frequencyInteger frequencyFraction:(nullable NSNumber *)frequencyFraction { + self = [self init]; + if(!self) { + return nil; + } + + self.band = SDLRadioBandFM; + self.frequencyInteger = frequencyInteger; + self.frequencyFraction = frequencyFraction; + + return self; +} + +- (instancetype)initAMWithFrequencyInteger:(nullable NSNumber *)frequencyInteger { + self = [self init]; + if(!self) { + return nil; + } + + self.frequencyInteger = frequencyInteger; + self.band = SDLRadioBandAM; + + return self; +} + +- (instancetype)initXMWithFrequencyInteger:(nullable NSNumber *)frequencyInteger { + self = [self init]; + if(!self) { + return nil; + } + + self.frequencyInteger = frequencyInteger; + self.band = SDLRadioBandXM; + + return self; +} + +- (instancetype)initFMWithHdChannel:(nullable NSNumber *)hdChannel { + self = [self init]; + if(!self) { + return nil; + } + + self.hdChannel = hdChannel; + self.band = SDLRadioBandFM; + + return self; +} + +- (instancetype)initAMWithHdChannel:(nullable NSNumber *)hdChannel { + self = [self init]; + if(!self) { + return nil; + } + + self.hdChannel = hdChannel; + self.band = SDLRadioBandAM; + + return self; +} + - (void)setFrequencyInteger:(nullable NSNumber *)frequencyInteger { [self.store sdl_setObject:frequencyInteger forName:SDLRPCParameterNameFrequencyInteger]; } From 683d636540498f863e89c2a8d7a024f5649dee3f Mon Sep 17 00:00:00 2001 From: Justin Gluck Date: Wed, 22 Jan 2020 13:25:04 -0500 Subject: [PATCH 003/415] added unit tests --- SmartDeviceLink/SDLRadioControlData.h | 1 - SmartDeviceLink/SDLRadioControlData.m | 2 +- .../StructSpecs/SDLRadioControlDataSpec.m | 38 +++++++++++++++++++ 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/SmartDeviceLink/SDLRadioControlData.h b/SmartDeviceLink/SDLRadioControlData.h index bea276856..8a940e96f 100644 --- a/SmartDeviceLink/SDLRadioControlData.h +++ b/SmartDeviceLink/SDLRadioControlData.h @@ -41,7 +41,6 @@ NS_ASSUME_NONNULL_BEGIN */ - (instancetype)initWithFrequencyInteger:(nullable NSNumber *)frequencyInteger frequencyFraction:(nullable NSNumber *)frequencyFraction band:(nullable SDLRadioBand)band hdChannel:(nullable NSNumber *)hdChannel radioEnable:(nullable NSNumber *)radioEnable hdRadioEnable:(nullable NSNumber *)hdRadioEnable; - /// Constructs a newly allocated SDLRadioControlCapabilities object with given parameters. /// /// @param frequencyInteger Must be between 875 and 1080 diff --git a/SmartDeviceLink/SDLRadioControlData.m b/SmartDeviceLink/SDLRadioControlData.m index 5d40ca372..cc4c37154 100644 --- a/SmartDeviceLink/SDLRadioControlData.m +++ b/SmartDeviceLink/SDLRadioControlData.m @@ -48,7 +48,7 @@ - (instancetype)initFMWithFrequencyInteger:(nullable NSNumber *)frequenc if(!self) { return nil; } - + self.band = SDLRadioBandFM; self.frequencyInteger = frequencyInteger; self.frequencyFraction = frequencyFraction; diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRadioControlDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRadioControlDataSpec.m index fd74e0f38..d6e56fb3d 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRadioControlDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRadioControlDataSpec.m @@ -155,6 +155,44 @@ expect(testStruct.hdRadioEnable).to(equal(@YES)); }); + it(@"Should get correctly when initialized FM radio control capabilities parameters", ^ { + SDLRadioControlData* testStruct = [[SDLRadioControlData alloc] initFMWithFrequencyInteger:@101 frequencyFraction:@7]; + + expect(testStruct.frequencyInteger).to(equal(@101)); + expect(testStruct.frequencyFraction).to(equal(@7)); + expect(testStruct.band).to(equal(SDLRadioBandFM)); + }); + + it(@"Should get correctly when initialized FM radio control capabilities parameters", ^ { + SDLRadioControlData* testStruct = [[SDLRadioControlData alloc] initFMWithHdChannel:@5]; + + expect(testStruct.hdChannel).to(equal(@5)); + expect(testStruct.band).to(equal(SDLRadioBandFM)); + }); + + it(@"Should get correctly when initialized AM radio control capabilities parameters", ^ { + SDLRadioControlData* testStruct = [[SDLRadioControlData alloc] initAMWithFrequencyInteger:@101]; + + expect(testStruct.frequencyInteger).to(equal(@101)); + expect(testStruct.band).to(equal(SDLRadioBandAM)); + }); + + it(@"Should get correctly when initialized AM radio control capabilities parameters", ^ { + SDLRadioControlData* testStruct = [[SDLRadioControlData alloc] initAMWithHdChannel:@5]; + + expect(testStruct.hdChannel).to(equal(@5)); + expect(testStruct.band).to(equal(SDLRadioBandAM)); + }); + + it(@"Should get correctly when initialized XM radio control capabilities parameters", ^ { + SDLRadioControlData* testStruct = [[SDLRadioControlData alloc] initXMWithFrequencyInteger:@101]; + + expect(testStruct.frequencyInteger).to(equal(@101)); + expect(testStruct.band).to(equal(SDLRadioBandXM)); + }); + + + }); QuickSpecEnd From 63bb31ad99bd75af3cad3747400a0ce83f0b2328 Mon Sep 17 00:00:00 2001 From: Justin Gluck Date: Wed, 22 Jan 2020 15:52:56 -0500 Subject: [PATCH 004/415] pr issues --- SmartDeviceLink/SDLRadioControlData.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SmartDeviceLink/SDLRadioControlData.h b/SmartDeviceLink/SDLRadioControlData.h index 8a940e96f..45be5ab1b 100644 --- a/SmartDeviceLink/SDLRadioControlData.h +++ b/SmartDeviceLink/SDLRadioControlData.h @@ -43,7 +43,7 @@ NS_ASSUME_NONNULL_BEGIN /// Constructs a newly allocated SDLRadioControlCapabilities object with given parameters. /// -/// @param frequencyInteger Must be between 875 and 1080 +/// @param frequencyInteger Must be between 0 and 1710 /// @param frequencyFraction Must be between 0 and 9 /// @return An instance of the SDLRadioControlData class - (instancetype)initFMWithFrequencyInteger:(nullable NSNumber *)frequencyInteger frequencyFraction:(nullable NSNumber *)frequencyFraction; @@ -56,7 +56,7 @@ NS_ASSUME_NONNULL_BEGIN /// Constructs a newly allocated SDLRadioControlCapabilities object with given parameters. /// -/// @param frequencyInteger Must be between 875 and 1080 +/// @param frequencyInteger Must be between 0 and 1710 /// @return An instance of the SDLRadioControlData class - (instancetype)initAMWithFrequencyInteger:(nullable NSNumber *)frequencyInteger; From 3a3be8bd730f89b547612c0999b61979e7dfb7f5 Mon Sep 17 00:00:00 2001 From: Justin Gluck Date: Fri, 24 Jan 2020 15:39:13 -0500 Subject: [PATCH 005/415] PR issues --- SmartDeviceLink/SDLRadioControlData.h | 14 ++------ SmartDeviceLink/SDLRadioControlData.m | 32 +++---------------- .../StructSpecs/SDLRadioControlDataSpec.m | 20 +++--------- 3 files changed, 11 insertions(+), 55 deletions(-) diff --git a/SmartDeviceLink/SDLRadioControlData.h b/SmartDeviceLink/SDLRadioControlData.h index 45be5ab1b..182e6105e 100644 --- a/SmartDeviceLink/SDLRadioControlData.h +++ b/SmartDeviceLink/SDLRadioControlData.h @@ -45,26 +45,16 @@ NS_ASSUME_NONNULL_BEGIN /// /// @param frequencyInteger Must be between 0 and 1710 /// @param frequencyFraction Must be between 0 and 9 -/// @return An instance of the SDLRadioControlData class -- (instancetype)initFMWithFrequencyInteger:(nullable NSNumber *)frequencyInteger frequencyFraction:(nullable NSNumber *)frequencyFraction; - -/// Constructs a newly allocated SDLRadioControlCapabilities object with given parameters. -/// /// @param hdChannel Must be between 0 and 7 /// @return An instance of the SDLRadioControlData class -- (instancetype)initFMWithHdChannel:(nullable NSNumber *)hdChannel; +- (instancetype)initFMWithFrequencyInteger:(nullable NSNumber *)frequencyInteger frequencyFraction:(nullable NSNumber *)frequencyFraction hdChannel:(nullable NSNumber *)hdChannel; /// Constructs a newly allocated SDLRadioControlCapabilities object with given parameters. /// /// @param frequencyInteger Must be between 0 and 1710 -/// @return An instance of the SDLRadioControlData class -- (instancetype)initAMWithFrequencyInteger:(nullable NSNumber *)frequencyInteger; - -/// Constructs a newly allocated SDLRadioControlCapabilities object with given parameters. -/// /// @param hdChannel Must be between 0 and 7 /// @return An instance of the SDLRadioControlData class -- (instancetype)initAMWithHdChannel:(nullable NSNumber *)hdChannel; +- (instancetype)initAMWithFrequencyInteger:(nullable NSNumber *)frequencyInteger hdChannel:(nullable NSNumber *)hdChannel; /// Constructs a newly allocated SDLRadioControlCapabilities object with given parameters. /// diff --git a/SmartDeviceLink/SDLRadioControlData.m b/SmartDeviceLink/SDLRadioControlData.m index cc4c37154..9fb82f080 100644 --- a/SmartDeviceLink/SDLRadioControlData.m +++ b/SmartDeviceLink/SDLRadioControlData.m @@ -43,7 +43,7 @@ - (instancetype)initWithFrequencyInteger:(nullable NSNumber *)frequencyI return self; } -- (instancetype)initFMWithFrequencyInteger:(nullable NSNumber *)frequencyInteger frequencyFraction:(nullable NSNumber *)frequencyFraction { +- (instancetype)initFMWithFrequencyInteger:(nullable NSNumber *)frequencyInteger frequencyFraction:(nullable NSNumber *)frequencyFraction hdChannel:(nullable NSNumber *)hdChannel { self = [self init]; if(!self) { return nil; @@ -52,18 +52,20 @@ - (instancetype)initFMWithFrequencyInteger:(nullable NSNumber *)frequenc self.band = SDLRadioBandFM; self.frequencyInteger = frequencyInteger; self.frequencyFraction = frequencyFraction; + self.hdChannel = hdChannel; return self; } -- (instancetype)initAMWithFrequencyInteger:(nullable NSNumber *)frequencyInteger { +- (instancetype)initAMWithFrequencyInteger:(nullable NSNumber *)frequencyInteger hdChannel:(nullable NSNumber *)hdChannel { self = [self init]; if(!self) { return nil; } - self.frequencyInteger = frequencyInteger; self.band = SDLRadioBandAM; + self.frequencyInteger = frequencyInteger; + self.hdChannel = hdChannel; return self; } @@ -80,30 +82,6 @@ - (instancetype)initXMWithFrequencyInteger:(nullable NSNumber *)frequenc return self; } -- (instancetype)initFMWithHdChannel:(nullable NSNumber *)hdChannel { - self = [self init]; - if(!self) { - return nil; - } - - self.hdChannel = hdChannel; - self.band = SDLRadioBandFM; - - return self; -} - -- (instancetype)initAMWithHdChannel:(nullable NSNumber *)hdChannel { - self = [self init]; - if(!self) { - return nil; - } - - self.hdChannel = hdChannel; - self.band = SDLRadioBandAM; - - return self; -} - - (void)setFrequencyInteger:(nullable NSNumber *)frequencyInteger { [self.store sdl_setObject:frequencyInteger forName:SDLRPCParameterNameFrequencyInteger]; } diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRadioControlDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRadioControlDataSpec.m index d6e56fb3d..a29ff574d 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRadioControlDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRadioControlDataSpec.m @@ -156,32 +156,20 @@ }); it(@"Should get correctly when initialized FM radio control capabilities parameters", ^ { - SDLRadioControlData* testStruct = [[SDLRadioControlData alloc] initFMWithFrequencyInteger:@101 frequencyFraction:@7]; + SDLRadioControlData* testStruct = [[SDLRadioControlData alloc] initFMWithFrequencyInteger:@101 frequencyFraction:@7 hdChannel:@2]; expect(testStruct.frequencyInteger).to(equal(@101)); expect(testStruct.frequencyFraction).to(equal(@7)); expect(testStruct.band).to(equal(SDLRadioBandFM)); - }); - - it(@"Should get correctly when initialized FM radio control capabilities parameters", ^ { - SDLRadioControlData* testStruct = [[SDLRadioControlData alloc] initFMWithHdChannel:@5]; - - expect(testStruct.hdChannel).to(equal(@5)); - expect(testStruct.band).to(equal(SDLRadioBandFM)); + expect(testStruct.hdChannel).to(equal(@2)); }); it(@"Should get correctly when initialized AM radio control capabilities parameters", ^ { - SDLRadioControlData* testStruct = [[SDLRadioControlData alloc] initAMWithFrequencyInteger:@101]; + SDLRadioControlData* testStruct = [[SDLRadioControlData alloc] initAMWithFrequencyInteger:@101 hdChannel:@2]; expect(testStruct.frequencyInteger).to(equal(@101)); expect(testStruct.band).to(equal(SDLRadioBandAM)); - }); - - it(@"Should get correctly when initialized AM radio control capabilities parameters", ^ { - SDLRadioControlData* testStruct = [[SDLRadioControlData alloc] initAMWithHdChannel:@5]; - - expect(testStruct.hdChannel).to(equal(@5)); - expect(testStruct.band).to(equal(SDLRadioBandAM)); + expect(testStruct.hdChannel).to(equal(@2)); }); it(@"Should get correctly when initialized XM radio control capabilities parameters", ^ { From 0ab747eda4920750ec2e604db00f35dc88a7ddf1 Mon Sep 17 00:00:00 2001 From: Justin Gluck Date: Tue, 28 Jan 2020 15:13:33 -0500 Subject: [PATCH 006/415] Fixing warnings on storyboard --- .../Base.lproj/SDLLockScreen.storyboard | 42 ++++++++++--------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/SmartDeviceLink/Assets/Base.lproj/SDLLockScreen.storyboard b/SmartDeviceLink/Assets/Base.lproj/SDLLockScreen.storyboard index fe7b3e564..cce593af4 100644 --- a/SmartDeviceLink/Assets/Base.lproj/SDLLockScreen.storyboard +++ b/SmartDeviceLink/Assets/Base.lproj/SDLLockScreen.storyboard @@ -1,6 +1,6 @@ - + @@ -16,18 +16,18 @@ - + - + From 720278ba21bf6746e5121a9d6ca7a85465432506 Mon Sep 17 00:00:00 2001 From: Justin Gluck Date: Wed, 29 Jan 2020 10:01:48 -0500 Subject: [PATCH 007/415] fixing landscape warnings and broken constraints --- .../Base.lproj/SDLLockScreen.storyboard | 36 ++++++++++++------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/SmartDeviceLink/Assets/Base.lproj/SDLLockScreen.storyboard b/SmartDeviceLink/Assets/Base.lproj/SDLLockScreen.storyboard index cce593af4..bb41a9a2d 100644 --- a/SmartDeviceLink/Assets/Base.lproj/SDLLockScreen.storyboard +++ b/SmartDeviceLink/Assets/Base.lproj/SDLLockScreen.storyboard @@ -1,6 +1,6 @@ - + @@ -16,18 +16,18 @@ - + - +