From 4c5f31cd2824c642cfd668d8495b541de3b91ea1 Mon Sep 17 00:00:00 2001 From: William Wallace Date: Thu, 24 Aug 2017 18:12:29 -0700 Subject: [PATCH 1/5] #382 Timers are not appropriately stopped when deallocated. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/smartdevicelink/sdl_ios/issues/382 NSTimer has a strong reference to its target, therefore the SDLTimer never gets released and dealloc isn’t called. I eliminated the deadlock by adding a separate target. --- SmartDeviceLink/SDLTimer.m | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/SmartDeviceLink/SDLTimer.m b/SmartDeviceLink/SDLTimer.m index 84ee6e24b..7a916d929 100644 --- a/SmartDeviceLink/SDLTimer.m +++ b/SmartDeviceLink/SDLTimer.m @@ -4,6 +4,36 @@ #import "SDLTimer.h" +@protocol SDLTimerTargetDelegate + +- (void)timerElapsed; + +@end + +@interface SDLTimerTarget : NSObject + +@property (nonatomic, weak) id delegate; + +@end + +@implementation SDLTimerTarget + +- (instancetype)initWithDelegate:(id)delegate { + self = [super init]; + if (self) { + _delegate = delegate; + } + return self; +} + +- (void)timerElapsed { + if ([self.delegate conformsToProtocol:@protocol(SDLTimerTargetDelegate)]) { + [_delegate timerElapsed]; + } +} + +@end + @interface SDLTimer () @@ -40,7 +70,9 @@ - (instancetype)initWithDuration:(float)duration repeat:(BOOL)repeat { - (void)start { if (self.duration > 0) { [self stopAndDestroyTimer]; - self.timer = [NSTimer timerWithTimeInterval:self.duration target:self selector:@selector(timerElapsed) userInfo:nil repeats:self.repeat]; + + SDLTimerTarget *timerTarget = [[SDLTimerTarget alloc] initWithDelegate:self]; + self.timer = [NSTimer timerWithTimeInterval:_duration target:timerTarget selector:@selector(timerElapsed) userInfo:nil repeats:_repeat]; [[NSRunLoop mainRunLoop] addTimer:self.timer forMode:NSRunLoopCommonModes]; self.timerRunning = YES; } From 5e421045fa5d96939add75cbe673191bbe7b94b2 Mon Sep 17 00:00:00 2001 From: William Wallace Date: Mon, 11 Sep 2017 10:34:03 -0700 Subject: [PATCH 2/5] Fix #382 Timers are not appropriately stopped when deallocated. --- SmartDeviceLink/SDLTimer.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SmartDeviceLink/SDLTimer.m b/SmartDeviceLink/SDLTimer.m index 7a916d929..53a986451 100644 --- a/SmartDeviceLink/SDLTimer.m +++ b/SmartDeviceLink/SDLTimer.m @@ -35,7 +35,7 @@ - (void)timerElapsed { @end -@interface SDLTimer () +@interface SDLTimer () @property (strong) NSTimer *timer; @property (assign) BOOL timerRunning; From 8dcfdf2bbe71a81731a6383de41ea690ab0dfabd Mon Sep 17 00:00:00 2001 From: Joel Fischer Date: Wed, 13 Sep 2017 13:41:18 -0400 Subject: [PATCH 3/5] Fix for Xcode 9 changes --- .travis.yml | 8 ++++---- CHANGELOG.md | 11 +++++++++++ Cartfile.private | 7 ++++--- Cartfile.resolved | 8 ++++---- SmartDeviceLink-iOS.podspec | 4 ++-- SmartDeviceLink-iOS.xcodeproj/project.pbxproj | 14 +++++++++++++- .../xcschemes/SmartDeviceLink.xcscheme | 4 +++- SmartDeviceLink.podspec | 4 ++-- .../Base.lproj/SDLLockScreen.storyboard | 19 +++++++++++++++---- 9 files changed, 58 insertions(+), 21 deletions(-) diff --git a/.travis.yml b/.travis.yml index cc31cf516..822227fe1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,8 @@ language: objective-c -osx_image: xcode8.3 +osx_image: xcode9 xcode_project: SmartDeviceLink-iOS.xcodeproj xcode_scheme: SmartDeviceLink -xcode_sdk: iphonesimulator10.3 +xcode_sdk: iphonesimulator11.0 env: global: - FRAMEWORK_NAME=SmartDeviceLink @@ -18,8 +18,8 @@ before_script: - carthage bootstrap --platform ios script: -- xcodebuild -project "SmartDeviceLink-iOS.xcodeproj" -scheme "SmartDeviceLink" -sdk "iphonesimulator10.3" -destination "OS=10.3,name=iPhone 7" -configuration Debug ONLY_ACTIVE_ARCH=NO RUN_CLANG_STATIC_ANALYZER=NO GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES ENABLE_TESTABILITY=YES test | xcpretty -c; -- xcodebuild -project "SmartDeviceLink-iOS.xcodeproj" -scheme "SmartDeviceLink-Example" -sdk "iphonesimulator10.3" -destination "OS=10.3,name=iPhone 7" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty -c; +- xcodebuild -project "SmartDeviceLink-iOS.xcodeproj" -scheme "SmartDeviceLink" -sdk "iphonesimulator11.0" -destination "OS=11.0,name=iPhone 7" -configuration Debug ONLY_ACTIVE_ARCH=NO RUN_CLANG_STATIC_ANALYZER=NO GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES ENABLE_TESTABILITY=YES test | xcpretty -c; +- xcodebuild -project "SmartDeviceLink-iOS.xcodeproj" -scheme "SmartDeviceLink-Example" -sdk "iphonesimulator11.0" -destination "OS=11.0,name=iPhone 7" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty -c; after_script: - bash <(curl -s https://codecov.io/bash) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d5f09cf1..b575470d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +# 4.7.1 Release Notes +### Breaking Changes +* This bumps up the minimum supported version to 7.0 due to Xcode 9 changes. The upcoming v5.0.0 will raise the minimum version to 8.0. + +### Bug Fixes +* Fixes the possibility of timers not being appropriately deallocated [#382](https://github.com/smartdevicelink/sdl_ios/issues/382). + +### Tests +* Any tests must now be run on Xcode 9. +* The travis config file has been updated to run on Xcode 9. + # 4.7.0 Release Notes (since RC 1) ### Bug Fixes * Fixed payloads being created with nil data causing a crash [#715](https://github.com/smartdevicelink/sdl_ios/issues/715). diff --git a/Cartfile.private b/Cartfile.private index c7c2797f3..0008b2028 100644 --- a/Cartfile.private +++ b/Cartfile.private @@ -1,5 +1,6 @@ -github "Quick/Quick" ~> 1.1 -github "Quick/Nimble" ~> 6.1 -github "AliSoftware/OHHTTPStubs" "5.2.3-swift3" +# github "Quick/Quick" ~> 1.1 +github "Quick/Quick" "xcode-9-fix" +github "Quick/Nimble" ~> 7.0 +github "AliSoftware/OHHTTPStubs" "master" github "erikdoe/ocmock" ~> 3.4 github "facebook/ios-snapshot-test-case" ~> 2.1 diff --git a/Cartfile.resolved b/Cartfile.resolved index 2de645370..d909544d9 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,5 +1,5 @@ -github "Quick/Nimble" "v6.1.0" -github "AliSoftware/OHHTTPStubs" "5.2.3-swift3" -github "Quick/Quick" "v1.1.0" -github "facebook/ios-snapshot-test-case" "2.1.4" +github "AliSoftware/OHHTTPStubs" "4dc6f36375f78c0b3cfe58d90bb8a4e21df5196e" +github "Quick/Nimble" "v7.0.1" +github "Quick/Quick" "a3850d0ddc18cf1e6ef17b3078c660f46888deca" github "erikdoe/ocmock" "v3.4" +github "facebook/ios-snapshot-test-case" "2.1.4" diff --git a/SmartDeviceLink-iOS.podspec b/SmartDeviceLink-iOS.podspec index ea8c1df3d..2a3ba0376 100644 --- a/SmartDeviceLink-iOS.podspec +++ b/SmartDeviceLink-iOS.podspec @@ -1,12 +1,12 @@ Pod::Spec.new do |s| s.name = "SmartDeviceLink-iOS" -s.version = "4.7.0" +s.version = "4.7.1" s.summary = "Connect your app with cars!" s.homepage = "https://github.com/smartdevicelink/SmartDeviceLink-iOS" s.license = { :type => "New BSD", :file => "LICENSE" } s.author = { "SmartDeviceLink Team" => "developer@smartdevicelink.com" } -s.platform = :ios, "6.0" +s.platform = :ios, "7.0" s.source = { :git => "https://github.com/smartdevicelink/sdl_ios.git", :tag => s.version.to_s } s.dependency 'BiSON', '~> 1.0' s.source_files = "SmartDeviceLink/*.{h,m}" diff --git a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj index bd9fcc3b2..6168f8630 100644 --- a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj +++ b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj @@ -4672,7 +4672,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0710; - LastUpgradeCheck = 0800; + LastUpgradeCheck = 0900; ORGANIZATIONNAME = smartdevicelink; TargetAttributes = { 5D4019AE1A76EC350006B0C2 = { @@ -5522,14 +5522,20 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -5569,14 +5575,20 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; diff --git a/SmartDeviceLink-iOS.xcodeproj/xcshareddata/xcschemes/SmartDeviceLink.xcscheme b/SmartDeviceLink-iOS.xcodeproj/xcshareddata/xcschemes/SmartDeviceLink.xcscheme index c50ed7d5c..5078a4898 100644 --- a/SmartDeviceLink-iOS.xcodeproj/xcshareddata/xcschemes/SmartDeviceLink.xcscheme +++ b/SmartDeviceLink-iOS.xcodeproj/xcshareddata/xcschemes/SmartDeviceLink.xcscheme @@ -1,6 +1,6 @@ "New BSD", :file => "LICENSE" } s.author = { "SmartDeviceLink Team" => "developer@smartdevicelink.com" } -s.platform = :ios, "6.0" +s.platform = :ios, "7.0" s.source = { :git => "https://github.com/smartdevicelink/sdl_ios.git", :tag => s.version.to_s } s.dependency 'BiSON', '~> 1.0' s.source_files = "SmartDeviceLink/*.{h,m}" diff --git a/SmartDeviceLink/Assets/Base.lproj/SDLLockScreen.storyboard b/SmartDeviceLink/Assets/Base.lproj/SDLLockScreen.storyboard index 4743ae983..56b04f10b 100644 --- a/SmartDeviceLink/Assets/Base.lproj/SDLLockScreen.storyboard +++ b/SmartDeviceLink/Assets/Base.lproj/SDLLockScreen.storyboard @@ -1,8 +1,11 @@ - + + + + - - + + @@ -16,51 +19,59 @@ - + + + + + + + + From 6626bc86e5bb327ca893229b7ca43150c0c9fabd Mon Sep 17 00:00:00 2001 From: Joel Fischer Date: Thu, 31 Aug 2017 13:42:05 -0400 Subject: [PATCH 4/5] Fix documentation badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 189167476..98aaf77a7 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![License](https://img.shields.io/cocoapods/l/SmartDeviceLink.svg?style=flat)](https://cocoapods.org/pods/SmartDeviceLink) [![Build Status](https://img.shields.io/travis/smartdevicelink/sdl_ios/master.svg?style=flat)](https://travis-ci.org/smartdevicelink/sdl_ios) [![codecov](https://codecov.io/gh/smartdevicelink/sdl_ios/branch/master/graph/badge.svg)](https://codecov.io/gh/smartdevicelink/sdl_ios) -documentationdocumentation54%54% +[![documentation](https://img.shields.io/badge/documentation-51%25-yellow.svg)]() [![CocoaPods Downloads](https://img.shields.io/cocoapods/dt/SmartDeviceLink.svg?maxAge=172800)](https://cocoapods.org/pods/SmartDeviceLink) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Slack Status](http://sdlslack.herokuapp.com/badge.svg)](http://slack.smartdevicelink.com) From 1df06aa9113cd6cab51a72bf1dc84b5a40e87e4c Mon Sep 17 00:00:00 2001 From: Joel Fischer Date: Wed, 20 Sep 2017 11:20:43 -0400 Subject: [PATCH 5/5] Update for v4.7.1 --- CHANGELOG.md | 1 + SmartDeviceLink/Info.plist | 2 +- SmartDeviceLink/SDLProxy.m | 2 +- SmartDeviceLink_Example/Info.plist | 2 +- docs/Classes/SDLDateTime.html | 18 +++++++++--------- docs/Classes/SDLLocationCoordinate.html | 4 ++-- docs/Classes/SDLPermissionManager.html | 2 +- docs/Classes/SDLSendLocation.html | 4 ++-- docs/Enums.html | 8 ++++---- docs/Type Definitions.html | 2 +- 10 files changed, 23 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b575470d2..c1e62989f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### Bug Fixes * Fixes the possibility of timers not being appropriately deallocated [#382](https://github.com/smartdevicelink/sdl_ios/issues/382). +* Fixes some head units not connecting properly due to the start service payload length not being set properly. ### Tests * Any tests must now be run on Xcode 9. diff --git a/SmartDeviceLink/Info.plist b/SmartDeviceLink/Info.plist index 1aad446dc..e1941af84 100644 --- a/SmartDeviceLink/Info.plist +++ b/SmartDeviceLink/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 4.7.0 + 4.7.1 CFBundleSignature ???? CFBundleVersion diff --git a/SmartDeviceLink/SDLProxy.m b/SmartDeviceLink/SDLProxy.m index 19e92e44c..e8aa0d1ea 100644 --- a/SmartDeviceLink/SDLProxy.m +++ b/SmartDeviceLink/SDLProxy.m @@ -43,7 +43,7 @@ typedef void (^URLSessionTaskCompletionHandler)(NSData *data, NSURLResponse *response, NSError *error); typedef void (^URLSessionDownloadTaskCompletionHandler)(NSURL *location, NSURLResponse *response, NSError *error); -NSString *const SDLProxyVersion = @"4.7.0"; +NSString *const SDLProxyVersion = @"4.7.1"; const float startSessionTime = 10.0; const float notifyProxyClosedDelay = 0.1; const int POLICIES_CORRELATION_ID = 65535; diff --git a/SmartDeviceLink_Example/Info.plist b/SmartDeviceLink_Example/Info.plist index 532fe007b..16e7cbad7 100644 --- a/SmartDeviceLink_Example/Info.plist +++ b/SmartDeviceLink_Example/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 4.7.0 + 4.7.1 CFBundleSignature ???? CFBundleVersion diff --git a/docs/Classes/SDLDateTime.html b/docs/Classes/SDLDateTime.html index 0311062ca..a99db5e89 100644 --- a/docs/Classes/SDLDateTime.html +++ b/docs/Classes/SDLDateTime.html @@ -83,7 +83,7 @@

Objective-C

Swift

-
@NSCopying var millisecond: NSNumber! { get set }
+
@NSCopying var millisecond: (NSNumber 
@@ -103,7 +103,7 @@

Objective-C

Swift

-
@NSCopying var second: NSNumber! { get set }
+
@NSCopying var second: (NSNumber 
@@ -123,7 +123,7 @@

Objective-C

Swift

-
@NSCopying var minute: NSNumber! { get set }
+
@NSCopying var minute: (NSNumber 
@@ -143,7 +143,7 @@

Objective-C

Swift

-
@NSCopying var hour: NSNumber! { get set }
+
@NSCopying var hour: (NSNumber 
@@ -163,7 +163,7 @@

Objective-C

Swift

-
@NSCopying var day: NSNumber! { get set }
+
@NSCopying var day: (NSNumber 
@@ -183,7 +183,7 @@

Objective-C

Swift

-
@NSCopying var month: NSNumber! { get set }
+
@NSCopying var month: (NSNumber 
@@ -203,7 +203,7 @@

Objective-C

Swift

-
@NSCopying var year: NSNumber! { get set }
+
@NSCopying var year: (NSNumber 
@@ -223,7 +223,7 @@

Objective-C

Swift

-
@NSCopying var timezoneMinuteOffset: NSNumber! { get set }
+
@NSCopying var timezoneMinuteOffset: (NSNumber 
@@ -243,7 +243,7 @@

Objective-C

Swift

-
@NSCopying var timezoneHourOffset: NSNumber! { get set }
+
@NSCopying var timezoneHourOffset: (NSNumber 
diff --git a/docs/Classes/SDLLocationCoordinate.html b/docs/Classes/SDLLocationCoordinate.html index 3b4560f1f..91d28e65f 100644 --- a/docs/Classes/SDLLocationCoordinate.html +++ b/docs/Classes/SDLLocationCoordinate.html @@ -28,7 +28,7 @@

Objective-C

Swift

-
@NSCopying var latitudeDegrees: NSNumber! { get set }
+
@NSCopying var latitudeDegrees: (NSNumber 
@@ -48,7 +48,7 @@

Objective-C

Swift

-
@NSCopying var longitudeDegrees: NSNumber! { get set }
+
@NSCopying var longitudeDegrees: (NSNumber 
diff --git a/docs/Classes/SDLPermissionManager.html b/docs/Classes/SDLPermissionManager.html index 443153914..516db2a03 100644 --- a/docs/Classes/SDLPermissionManager.html +++ b/docs/Classes/SDLPermissionManager.html @@ -130,7 +130,7 @@

Objective-C

Swift

-
func status(ofRPCs rpcNames: [String]) -> [String : NSNumber]
+
func status(ofRPCs rpcNames: [String]) -> [String : NSNumber 
diff --git a/docs/Classes/SDLSendLocation.html b/docs/Classes/SDLSendLocation.html index 1214449c2..760880dc2 100644 --- a/docs/Classes/SDLSendLocation.html +++ b/docs/Classes/SDLSendLocation.html @@ -60,7 +60,7 @@

Objective-C

Swift

-
@NSCopying var longitudeDegrees: NSNumber! { get set }
+
@NSCopying var longitudeDegrees: (NSNumber 
@@ -80,7 +80,7 @@

Objective-C

Swift

-
@NSCopying var latitudeDegrees: NSNumber! { get set }
+
@NSCopying var latitudeDegrees: (NSNumber 
diff --git a/docs/Enums.html b/docs/Enums.html index 840e35685..1f9146106 100644 --- a/docs/Enums.html +++ b/docs/Enums.html @@ -73,7 +73,7 @@

Objective-C

-
enum SDLManagerError : NSInteger {}
+
enum SDLManagerError {}

Swift

@@ -92,7 +92,7 @@

Objective-C

-
enum SDLFileManagerError : NSInteger {}
+
enum SDLFileManagerError {}

Swift

@@ -123,7 +123,7 @@

Objective-C

-
enum SDLPermissionGroupType : NSUInteger {}
+
enum SDLPermissionGroupType {}

Swift

@@ -142,7 +142,7 @@

Objective-C

-
enum SDLPermissionGroupStatus : NSUInteger {}
+
enum SDLPermissionGroupStatus {}

Swift

diff --git a/docs/Type Definitions.html b/docs/Type Definitions.html index fc4a0dcc7..55f1bb02a 100644 --- a/docs/Type Definitions.html +++ b/docs/Type Definitions.html @@ -203,7 +203,7 @@

Objective-C

Swift

-
typealias SDLPermissionsChangedHandler = ([String : NSNumber], SDLPermissionGroupStatus) -> Void
+
typealias SDLPermissionsChangedHandler = ([String : NSNumber