From d34f3aa80773bb6a949e2c59f2709b059890ef14 Mon Sep 17 00:00:00 2001 From: "Muller, Alexander (A.)" Date: Thu, 22 Sep 2016 17:44:19 -0700 Subject: [PATCH 1/4] Updated base SDK to iOS 7. Removed SDLURLSession in favor of NSURLSession. --- README.md | 2 +- SmartDeviceLink-iOS.podspec | 2 +- SmartDeviceLink-iOS.xcodeproj/project.pbxproj | 40 ---- SmartDeviceLink/Info.plist | 2 +- SmartDeviceLink/SDLProxy.m | 67 ++++-- SmartDeviceLink/SDLURLRequestTask.h | 46 ---- SmartDeviceLink/SDLURLRequestTask.m | 110 ---------- SmartDeviceLink/SDLURLSession.h | 57 ----- SmartDeviceLink/SDLURLSession.m | 113 ---------- SmartDeviceLinkTests/Info.plist | 2 +- .../HTTP Connection/SDLURLRequestTaskSpec.m | 140 ------------ .../HTTP Connection/SDLURLSessionSpec.m | 201 ------------------ SmartDeviceLink_Example/Info.plist | 2 +- 13 files changed, 51 insertions(+), 733 deletions(-) delete mode 100644 SmartDeviceLink/SDLURLRequestTask.h delete mode 100644 SmartDeviceLink/SDLURLRequestTask.m delete mode 100644 SmartDeviceLink/SDLURLSession.h delete mode 100644 SmartDeviceLink/SDLURLSession.m delete mode 100644 SmartDeviceLinkTests/UtilitiesSpecs/HTTP Connection/SDLURLRequestTaskSpec.m delete mode 100644 SmartDeviceLinkTests/UtilitiesSpecs/HTTP Connection/SDLURLSessionSpec.m diff --git a/README.md b/README.md index 3499e4caf..76e2f4b6c 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ See the [roadmap](https://github.com/smartdevicelink/sdl_ios/wiki/Roadmap) to se You can install this library using [Cocoapods](https://cocoapods.org/pods/SmartDeviceLink-iOS). You can get started with Cocoapods by [following their install guide](https://guides.cocoapods.org/using/getting-started.html#getting-started), and learn how to use Cocoapods to install dependencies [by following this guide](https://guides.cocoapods.org/using/using-cocoapods.html). -In your podfile, you want to add `pod 'SmartDeviceLink-iOS', '4.3.0-rc.3'`. Then run `pod install` inside your terminal. With Cocoapods, we support iOS 6.0+. +In your podfile, you want to add `pod 'SmartDeviceLink-iOS', '4.3.0-rc.3'`. Then run `pod install` inside your terminal. With Cocoapods, we support iOS 7.0+. ##### Carthage diff --git a/SmartDeviceLink-iOS.podspec b/SmartDeviceLink-iOS.podspec index d43e30913..278416702 100644 --- a/SmartDeviceLink-iOS.podspec +++ b/SmartDeviceLink-iOS.podspec @@ -6,7 +6,7 @@ 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.source_files = "SmartDeviceLink/*.{h,m}" s.requires_arc = true diff --git a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj index b846cc4d5..dd1769216 100644 --- a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj +++ b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj @@ -870,10 +870,6 @@ 5DBAE0AB1D3588AC00CE00BF /* SDLNotificationDispatcherSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DBAE0AA1D3588AC00CE00BF /* SDLNotificationDispatcherSpec.m */; }; 5DBAE0AD1D368D1A00CE00BF /* SDLResponseDispatcherSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DBAE0AC1D368D1A00CE00BF /* SDLResponseDispatcherSpec.m */; }; 5DC978261B7A38640012C2F1 /* SDLGlobalsSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DC978251B7A38640012C2F1 /* SDLGlobalsSpec.m */; }; - 5DCC19A01B8221F3004FFAD9 /* SDLURLSession.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DCC199E1B8221F3004FFAD9 /* SDLURLSession.h */; }; - 5DCC19A11B8221F3004FFAD9 /* SDLURLSession.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DCC199F1B8221F3004FFAD9 /* SDLURLSession.m */; }; - 5DCC19A41B822804004FFAD9 /* SDLURLRequestTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DCC19A21B822804004FFAD9 /* SDLURLRequestTask.h */; }; - 5DCC19A51B822804004FFAD9 /* SDLURLRequestTask.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DCC19A31B822804004FFAD9 /* SDLURLRequestTask.m */; }; 5DCF76F51ACDBAD300BB647B /* SDLSendLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DCF76F31ACDBAD300BB647B /* SDLSendLocation.h */; settings = {ATTRIBUTES = (Public, ); }; }; 5DCF76F61ACDBAD300BB647B /* SDLSendLocation.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DCF76F41ACDBAD300BB647B /* SDLSendLocation.m */; }; 5DCF76F91ACDD7CD00BB647B /* SDLSendLocationResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DCF76F71ACDD7CD00BB647B /* SDLSendLocationResponse.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -886,8 +882,6 @@ 5DE372A61ACC35B400849FAA /* SDLDebugToolConsole.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DE372A51ACC35B400849FAA /* SDLDebugToolConsole.h */; settings = {ATTRIBUTES = (Public, ); }; }; 5DE5ABB71B0E38C90067BB02 /* SDLSystemRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D61FBD21A84238B00846EE7 /* SDLSystemRequest.h */; }; 5DE5ABB81B0E38C90067BB02 /* SDLSystemRequestResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D61FBD41A84238B00846EE7 /* SDLSystemRequestResponse.h */; }; - 5DEE55C01B8509CB004F0D0F /* SDLURLRequestTaskSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DEE55BF1B8509CB004F0D0F /* SDLURLRequestTaskSpec.m */; }; - 5DF2BB9D1B94E38A00CE5994 /* SDLURLSessionSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DF2BB9C1B94E38A00CE5994 /* SDLURLSessionSpec.m */; }; 5DFFB9151BD7C89700DB3F04 /* SDLConnectionManagerType.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DFFB9141BD7C89700DB3F04 /* SDLConnectionManagerType.h */; }; DA4353DF1D271FD10099B8C4 /* CGPointUtilSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = DA4353DE1D271FD10099B8C4 /* CGPointUtilSpec.m */; }; DA4353E31D2720A30099B8C4 /* SDLPinchGestureSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = DA4353E21D2720A30099B8C4 /* SDLPinchGestureSpec.m */; }; @@ -1858,10 +1852,6 @@ 5DBAE0AA1D3588AC00CE00BF /* SDLNotificationDispatcherSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDLNotificationDispatcherSpec.m; path = DevAPISpecs/SDLNotificationDispatcherSpec.m; sourceTree = ""; }; 5DBAE0AC1D368D1A00CE00BF /* SDLResponseDispatcherSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDLResponseDispatcherSpec.m; path = DevAPISpecs/SDLResponseDispatcherSpec.m; sourceTree = ""; }; 5DC978251B7A38640012C2F1 /* SDLGlobalsSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDLGlobalsSpec.m; path = UtilitiesSpecs/SDLGlobalsSpec.m; sourceTree = ""; }; - 5DCC199E1B8221F3004FFAD9 /* SDLURLSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLURLSession.h; sourceTree = ""; }; - 5DCC199F1B8221F3004FFAD9 /* SDLURLSession.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLURLSession.m; sourceTree = ""; }; - 5DCC19A21B822804004FFAD9 /* SDLURLRequestTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLURLRequestTask.h; sourceTree = ""; }; - 5DCC19A31B822804004FFAD9 /* SDLURLRequestTask.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLURLRequestTask.m; sourceTree = ""; }; 5DCF76F31ACDBAD300BB647B /* SDLSendLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLSendLocation.h; sourceTree = ""; }; 5DCF76F41ACDBAD300BB647B /* SDLSendLocation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLSendLocation.m; sourceTree = ""; }; 5DCF76F71ACDD7CD00BB647B /* SDLSendLocationResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLSendLocationResponse.h; sourceTree = ""; }; @@ -1872,8 +1862,6 @@ 5DE372A01ACB2ED300849FAA /* SDLHMICapabilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLHMICapabilities.m; sourceTree = ""; }; 5DE372A31ACB336600849FAA /* SDLHMICapabilitiesSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLHMICapabilitiesSpec.m; sourceTree = ""; }; 5DE372A51ACC35B400849FAA /* SDLDebugToolConsole.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLDebugToolConsole.h; sourceTree = ""; }; - 5DEE55BF1B8509CB004F0D0F /* SDLURLRequestTaskSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDLURLRequestTaskSpec.m; path = "UtilitiesSpecs/HTTP Connection/SDLURLRequestTaskSpec.m"; sourceTree = ""; }; - 5DF2BB9C1B94E38A00CE5994 /* SDLURLSessionSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDLURLSessionSpec.m; path = "UtilitiesSpecs/HTTP Connection/SDLURLSessionSpec.m"; sourceTree = ""; }; 5DFFB9141BD7C89700DB3F04 /* SDLConnectionManagerType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLConnectionManagerType.h; sourceTree = ""; }; DA4353DE1D271FD10099B8C4 /* CGPointUtilSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CGPointUtilSpec.m; path = UtilitiesSpecs/Touches/CGPointUtilSpec.m; sourceTree = ""; }; DA4353E21D2720A30099B8C4 /* SDLPinchGestureSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDLPinchGestureSpec.m; path = UtilitiesSpecs/Touches/SDLPinchGestureSpec.m; sourceTree = ""; }; @@ -2949,7 +2937,6 @@ isa = PBXGroup; children = ( DAC5724C1D0FE3B60004288B /* Touches */, - 5DCC199D1B8221D2004FFAD9 /* HTTP Connection */, E9C32B831AB20B2900F283AF /* @categories */, 5D5934F71A8519A700687FB9 /* JSON */, 5D5934F91A851A8000687FB9 /* Prioritized Objects */, @@ -3500,7 +3487,6 @@ isa = PBXGroup; children = ( DA1166D71D14601C00438CEA /* Touches */, - 5DEE55BE1B8509A5004F0D0F /* HTTP Connection */, 5DB92D2B1AC4A32A00C15BB0 /* Prioritized Objects */, 5DB92D231AC47B2C00C15BB0 /* SDLHexUtilitySpec.m */, 5DB92D251AC4836F00C15BB0 /* SDLJingleSpec.m */, @@ -3572,17 +3558,6 @@ name = Dispatchers; sourceTree = ""; }; - 5DCC199D1B8221D2004FFAD9 /* HTTP Connection */ = { - isa = PBXGroup; - children = ( - 5DCC199E1B8221F3004FFAD9 /* SDLURLSession.h */, - 5DCC199F1B8221F3004FFAD9 /* SDLURLSession.m */, - 5DCC19A21B822804004FFAD9 /* SDLURLRequestTask.h */, - 5DCC19A31B822804004FFAD9 /* SDLURLRequestTask.m */, - ); - name = "HTTP Connection"; - sourceTree = ""; - }; 5DE372A71ACC35C100849FAA /* @protocols */ = { isa = PBXGroup; children = ( @@ -3591,15 +3566,6 @@ name = "@protocols"; sourceTree = ""; }; - 5DEE55BE1B8509A5004F0D0F /* HTTP Connection */ = { - isa = PBXGroup; - children = ( - 5DEE55BF1B8509CB004F0D0F /* SDLURLRequestTaskSpec.m */, - 5DF2BB9C1B94E38A00CE5994 /* SDLURLSessionSpec.m */, - ); - name = "HTTP Connection"; - sourceTree = ""; - }; DA1166D71D14601C00438CEA /* Touches */ = { isa = PBXGroup; children = ( @@ -3781,7 +3747,6 @@ 5D2996F91BFE5B29006106BF /* (null) in Headers */, 5D61FD191A84238C00846EE7 /* SDLOnSyncPData.h in Headers */, 5D61FE091A84238C00846EE7 /* SDLVehicleDataType.h in Headers */, - 5DCC19A01B8221F3004FFAD9 /* SDLURLSession.h in Headers */, 5D61FDB11A84238C00846EE7 /* SDLSubscribeVehicleData.h in Headers */, 5DCF76F51ACDBAD300BB647B /* SDLSendLocation.h in Headers */, 5D61FC9E1A84238C00846EE7 /* SDLEncodedSyncPData.h in Headers */, @@ -3881,7 +3846,6 @@ 5D6F7A351BC5B9B60070BF37 /* SDLLockScreenViewController.h in Headers */, 5D61FCE41A84238C00846EE7 /* SDLKeyboardProperties.h in Headers */, 5D61FDED1A84238C00846EE7 /* SDLUnsubscribeVehicleDataResponse.h in Headers */, - 5DCC19A41B822804004FFAD9 /* SDLURLRequestTask.h in Headers */, 5D61FCCF1A84238C00846EE7 /* SDLImageField.h in Headers */, 5D535DC51B72473800CF7760 /* SDLGlobals.h in Headers */, 5D79A03B1CE36F030035797B /* SDLUploadFileOperation.h in Headers */, @@ -4139,7 +4103,6 @@ buildActionMask = 2147483647; files = ( 332A914F1CED9CC60043824C /* SDLAppInfo.m in Sources */, - 5DCC19A51B822804004FFAD9 /* SDLURLRequestTask.m in Sources */, 5D61FC561A84238C00846EE7 /* SDLButtonName.m in Sources */, 5D61FCC21A84238C00846EE7 /* SDLHMILevel.m in Sources */, 5D61FDEC1A84238C00846EE7 /* SDLUnsubscribeVehicleData.m in Sources */, @@ -4268,7 +4231,6 @@ 5D61FC4E1A84238C00846EE7 /* SDLBitsPerSample.m in Sources */, 5D61FDEA1A84238C00846EE7 /* SDLUnsubscribeButtonResponse.m in Sources */, 5D61FCA61A84238C00846EE7 /* SDLEndAudioPassThruResponse.m in Sources */, - 5DCC19A11B8221F3004FFAD9 /* SDLURLSession.m in Sources */, 5D61FD281A84238C00846EE7 /* SDLPerformAudioPassThruResponse.m in Sources */, 5D61FDCE1A84238C00846EE7 /* SDLTimerMode.m in Sources */, 5D61FD701A84238C00846EE7 /* SDLRPCPayload.m in Sources */, @@ -4504,7 +4466,6 @@ 162E836C1A9BDE8B00906325 /* SDLSystemRequestResponseSpec.m in Sources */, 162E833C1A9BDE8B00906325 /* SDLSetMediaClockTimerSpec.m in Sources */, 162E83061A9BDE8B00906325 /* SDLVehicleDataEventStatusSpec.m in Sources */, - 5DEE55C01B8509CB004F0D0F /* SDLURLRequestTaskSpec.m in Sources */, 162E83911A9BDE8B00906325 /* SDLTouchCoordSpec.m in Sources */, 162E832B1A9BDE8B00906325 /* SDLDeleteSubMenuSpec.m in Sources */, 162E83411A9BDE8B00906325 /* SDLSubscribeButtonSpec.m in Sources */, @@ -4578,7 +4539,6 @@ 162E82FB1A9BDE8B00906325 /* SDLSpeechCapabilitiesSpec.m in Sources */, 162E830D1A9BDE8B00906325 /* SDLWiperStatusSpec.m in Sources */, 162E832C1A9BDE8B00906325 /* SDLDiagnosticMessageSpec.m in Sources */, - 5DF2BB9D1B94E38A00CE5994 /* SDLURLSessionSpec.m in Sources */, 162E83381A9BDE8B00906325 /* SDLScrollableMessageSpec.m in Sources */, 162E82E81A9BDE8B00906325 /* SDLKeyboardLayoutSpec.m in Sources */, DA4353EB1D2721680099B8C4 /* SDLTouchSpec.m in Sources */, diff --git a/SmartDeviceLink/Info.plist b/SmartDeviceLink/Info.plist index 34224c4fc..474c43472 100644 --- a/SmartDeviceLink/Info.plist +++ b/SmartDeviceLink/Info.plist @@ -9,7 +9,7 @@ CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion - 6.0 + 7.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType diff --git a/SmartDeviceLink/SDLProxy.m b/SmartDeviceLink/SDLProxy.m index f49569ea9..25bb7638a 100644 --- a/SmartDeviceLink/SDLProxy.m +++ b/SmartDeviceLink/SDLProxy.m @@ -42,19 +42,17 @@ #import "SDLSystemContext.h" #import "SDLSystemRequest.h" #import "SDLTimer.h" -#import "SDLURLSession.h" #import "SDLVehicleType.h" typedef NSString SDLVehicleMake; typedef void (^URLSessionTaskCompletionHandler)(NSData *data, NSURLResponse *response, NSError *error); -typedef void (^URLSessionDownloadTaskCompletionHandler)(NSURL *location, NSURLResponse *response, NSError *error); NSString *const SDLProxyVersion = @"4.3.0-rc.3"; const float startSessionTime = 10.0; const float notifyProxyClosedDelay = 0.1; const int POLICIES_CORRELATION_ID = 65535; - +static float DefaultConnectionTimeout = 45.0; @interface SDLProxy () { SDLLockScreenStatusManager *_lsm; @@ -65,6 +63,7 @@ @interface SDLProxy () { @property (nonatomic, strong, readwrite, nullable) SDLStreamingMediaManager *streamingMediaManager; @property (nonatomic, strong, nullable) SDLDisplayCapabilities *displayCapabilities; @property (nonatomic, strong) NSMutableDictionary *securityManagers; +@property (nonatomic, strong) NSURLSession* urlSession; @end @@ -90,6 +89,14 @@ - (instancetype)initWithTransport:(SDLAbstractTransport *)transport protocol:(SD [SDLDebugTool logInfo:@"SDLProxy initWithTransport"]; [[EAAccessoryManager sharedAccessoryManager] registerForLocalNotifications]; + + NSURLSessionConfiguration* configuration = [NSURLSessionConfiguration defaultSessionConfiguration]; + configuration.timeoutIntervalForRequest = DefaultConnectionTimeout; + configuration.timeoutIntervalForResource = DefaultConnectionTimeout; + configuration.requestCachePolicy = NSURLRequestUseProtocolCachePolicy; + + _urlSession = [NSURLSession sessionWithConfiguration:configuration]; + } return self; @@ -102,8 +109,9 @@ - (void)destructObjects { [[NSNotificationCenter defaultCenter] removeObserver:self]; [[EAAccessoryManager sharedAccessoryManager] unregisterForLocalNotifications]; - [[SDLURLSession defaultSession] cancelAllTasks]; - + [self.urlSession invalidateAndCancel]; + _urlSession = nil; + [self.protocol dispose]; [self.transport dispose]; @@ -533,17 +541,17 @@ - (void)handleSystemRequestProprietary:(SDLOnSystemRequest *)request { } - (void)handleSystemRequestLockScreenIconURL:(SDLOnSystemRequest *)request { - [[SDLURLSession defaultSession] dataFromURL:[NSURL URLWithString:request.url] - completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { - if (error != nil) { - NSString *logMessage = [NSString stringWithFormat:@"OnSystemRequest failure (HTTP response), download task failed: %@", error.localizedDescription]; - [SDLDebugTool logInfo:logMessage withType:SDLDebugType_RPC toOutput:SDLDebugOutput_All toGroup:self.debugConsoleGroupName]; - return; - } + [self sdl_sendDataTaskWithURL:[NSURL URLWithString:request.url] + completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { + if (error != nil) { + NSString *logMessage = [NSString stringWithFormat:@"OnSystemRequest failure (HTTP response), download task failed: %@", error.localizedDescription]; + [SDLDebugTool logInfo:logMessage withType:SDLDebugType_RPC toOutput:SDLDebugOutput_All toGroup:self.debugConsoleGroupName]; + return; + } - UIImage *icon = [UIImage imageWithData:data]; - [self invokeMethodOnDelegates:@selector(onReceivedLockScreenIcon:) withObject:icon]; - }]; + UIImage *icon = [UIImage imageWithData:data]; + [self invokeMethodOnDelegates:@selector(onReceivedLockScreenIcon:) withObject:icon]; + }]; } - (void)sdl_handleSystemRequestHTTP:(SDLOnSystemRequest *)request { @@ -637,7 +645,7 @@ - (void)sdl_uploadData:(NSData *_Nonnull)data toURLString:(NSString *_Nonnull)ur [SDLDebugTool logInfo:logMessage withType:SDLDebugType_RPC toOutput:SDLDebugOutput_All toGroup:self.debugConsoleGroupName]; // Create the upload task - [[SDLURLSession defaultSession] uploadWithURLRequest:request data:data completionHandler:completionHandler]; + [self sdl_sendUploadRequest:request withData:data completionHandler:completionHandler]; } /** @@ -673,9 +681,26 @@ - (void)uploadForBodyDataDictionary:(NSDictionary *)dictionary URLString:(NSStri [SDLDebugTool logInfo:logMessage withType:SDLDebugType_RPC toOutput:SDLDebugOutput_All toGroup:self.debugConsoleGroupName]; // Create the upload task - [[SDLURLSession defaultSession] uploadWithURLRequest:request data:bodyData completionHandler:completionHandler]; + [self sdl_sendUploadRequest:request withData:bodyData completionHandler:completionHandler]; +} + +- (void)sdl_sendUploadRequest:(NSURLRequest*)request withData:(NSData*)data completionHandler:(URLSessionTaskCompletionHandler)completionHandler { + NSMutableURLRequest* mutableRequest = [request mutableCopy]; + + if ([mutableRequest.URL.scheme isEqualToString:@"http"]) { + mutableRequest.URL = [NSURL URLWithString:[mutableRequest.URL.absoluteString stringByReplacingCharactersInRange:NSMakeRange(0, 4) withString:@"https"]]; + } + + [[self.urlSession uploadTaskWithRequest:request fromData:data completionHandler:completionHandler] resume]; } +- (void)sdl_sendDataTaskWithURL:(NSURL*)url completionHandler:(URLSessionTaskCompletionHandler)completionHandler { + if ([url.scheme isEqualToString:@"http"]) { + url = [NSURL URLWithString:[url.absoluteString stringByReplacingCharactersInRange:NSMakeRange(0, 4) withString:@"https"]]; + } + + [[self.urlSession dataTaskWithURL:url completionHandler:completionHandler] resume]; +} #pragma mark - Delegate management @@ -728,11 +753,11 @@ - (void)sendEncodedSyncPData:(NSDictionary *)encodedSyncPData toURL:(NSString *) } // Send the HTTP Request - [[SDLURLSession defaultSession] uploadWithURLRequest:request - data:data - completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { + [[[NSURLSession sharedSession] uploadTaskWithRequest:request + fromData:data + completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { [self syncPDataNetworkRequestCompleteWithData:data response:response error:error]; - }]; + }] resume]; [SDLDebugTool logInfo:@"OnEncodedSyncPData (HTTP request)" withType:SDLDebugType_RPC toOutput:SDLDebugOutput_All toGroup:self.debugConsoleGroupName]; } diff --git a/SmartDeviceLink/SDLURLRequestTask.h b/SmartDeviceLink/SDLURLRequestTask.h deleted file mode 100644 index 8745f8519..000000000 --- a/SmartDeviceLink/SDLURLRequestTask.h +++ /dev/null @@ -1,46 +0,0 @@ -// -// SDLURLRequestTask.h -// SmartDeviceLink-iOS -// -// Created by Joel Fischer on 8/17/15. -// Copyright (c) 2015 smartdevicelink. All rights reserved. -// - -#import - -@class SDLURLRequestTask; -@class SDLURLSession; - - -typedef void (^SDLURLConnectionRequestCompletionHandler)(NSData *__nullable data, NSURLResponse *__nullable response, NSError *__nullable error); - -typedef NS_ENUM(NSUInteger, SDLURLRequestTaskState) { - SDLURLRequestTaskStateRunning, - SDLURLRequestTaskStateCompleted -}; - - -NS_ASSUME_NONNULL_BEGIN - -@protocol SDLURLRequestTaskDelegate - -- (void)taskDidFinish:(SDLURLRequestTask *)task; - -@end - - -@interface SDLURLRequestTask : NSObject - -@property (weak, nonatomic) id delegate; -@property (assign, nonatomic) SDLURLRequestTaskState state; - -- (instancetype)init NS_UNAVAILABLE; -- (instancetype)initWithURLRequest:(NSURLRequest *)request completionHandler:(SDLURLConnectionRequestCompletionHandler)completionHandler NS_DESIGNATED_INITIALIZER; - -+ (instancetype)taskWithURLRequest:(NSURLRequest *)request completionHandler:(SDLURLConnectionRequestCompletionHandler)completionHandler; - -- (void)cancel; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLURLRequestTask.m b/SmartDeviceLink/SDLURLRequestTask.m deleted file mode 100644 index d1895ac10..000000000 --- a/SmartDeviceLink/SDLURLRequestTask.m +++ /dev/null @@ -1,110 +0,0 @@ -// -// SDLURLRequestTask.m -// SmartDeviceLink-iOS -// -// Created by Joel Fischer on 8/17/15. -// Copyright (c) 2015 smartdevicelink. All rights reserved. -// - -#import "SDLURLRequestTask.h" - -#import "SDLURLSession.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface SDLURLRequestTask () - -@property (strong, nonatomic) NSURLConnection *connection; -@property (strong, nonatomic, nullable) NSURLResponse *response; -@property (copy, nonatomic) SDLURLConnectionRequestCompletionHandler completionHandler; -@property (strong, nonatomic) NSMutableData *mutableData; - -@end - - -@implementation SDLURLRequestTask - -#pragma mark - Lifecycle - -- (instancetype)init { - NSAssert(NO, @"use initWithURLRequest:completionHandler instead"); - return nil; -} - -- (instancetype)initWithURLRequest:(NSURLRequest *)request completionHandler:(SDLURLConnectionRequestCompletionHandler)completionHandler { - self = [super init]; - if (!self) { - return nil; - } - - _connection = [[NSURLConnection alloc] initWithRequest:request delegate:self startImmediately:NO]; - [_connection scheduleInRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode]; - [_connection start]; - - _completionHandler = completionHandler; - - _mutableData = [NSMutableData data]; - _response = nil; - _state = SDLURLRequestTaskStateRunning; - - return self; -} - -+ (instancetype)taskWithURLRequest:(NSURLRequest *)request completionHandler:(SDLURLConnectionRequestCompletionHandler)completionHandler { - return [[self alloc] initWithURLRequest:request completionHandler:completionHandler]; -} - -- (void)dealloc { - [_connection cancel]; -} - - -#pragma mark - Data Methods - -- (void)sdl_addData:(NSData *)data { - [self.mutableData appendData:data]; -} - - -#pragma mark - Cancel - -- (void)cancel { - [self.connection cancel]; - [self connection:self.connection didFailWithError:[NSError errorWithDomain:NSURLErrorDomain code:kCFURLErrorCancelled userInfo:nil]]; -} - - -#pragma mark - NSURLConnectionDelegate - -- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error { - dispatch_async(dispatch_get_main_queue(), ^{ - self.completionHandler(nil, self.response, error); - - self.state = SDLURLRequestTaskStateCompleted; - [self.delegate taskDidFinish:self]; - }); -} - - -#pragma mark - NSURLConnectionDataDelegate - -- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { - [self sdl_addData:data]; -} - -- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { - self.response = response; -} - -- (void)connectionDidFinishLoading:(NSURLConnection *)connection { - dispatch_async(dispatch_get_main_queue(), ^{ - self.completionHandler([self.mutableData copy], self.response, nil); - - self.state = SDLURLRequestTaskStateCompleted; - [self.delegate taskDidFinish:self]; - }); -} - -@end - -NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLURLSession.h b/SmartDeviceLink/SDLURLSession.h deleted file mode 100644 index 0d2a22e28..000000000 --- a/SmartDeviceLink/SDLURLSession.h +++ /dev/null @@ -1,57 +0,0 @@ -// -// SDLURLConnection.h -// SmartDeviceLink-iOS -// -// Created by Joel Fischer on 8/17/15. -// Copyright (c) 2015 smartdevicelink. All rights reserved. -// - -#import - - -typedef void (^SDLURLConnectionRequestCompletionHandler)(NSData *__nullable data, NSURLResponse *__nullable response, NSError *__nullable error); - - -NS_ASSUME_NONNULL_BEGIN - -@interface SDLURLSession : NSObject - -@property (assign, nonatomic) NSURLRequestCachePolicy cachePolicy; - -/** - * If any task is started with a request that is at the default timeout (60.0 sec), it will be altered to this connection timeout (by default 45.0 sec). - */ -@property (assign, nonatomic) NSTimeInterval connectionTimeout; - -/** - * Get the default session, a singleton. - * - * @return The default session - */ -+ (instancetype)defaultSession; - -/** - * Retrieves data from a specified URL. Default settings for timeout and cache policy will be used. - * - * @param url An NSURLRequest will be assembled for this URL - * @param completionHandler The completion handler that will be called when the request is complete - */ -- (void)dataFromURL:(NSURL *)url completionHandler:(SDLURLConnectionRequestCompletionHandler)completionHandler; - -/** - * Starts a URL request using data supplied. - * - * @param request An NSURLRequest that provides the URL, cache policy, request method, etc. The HTTPBody data in this request will be ignored - * @param data The data to be uploaded over HTTP - * @param completionHandler The completion handler that will be called when the request is complete - */ -- (void)uploadWithURLRequest:(NSURLRequest *)request data:(NSData *)data completionHandler:(SDLURLConnectionRequestCompletionHandler)completionHandler; - -/** - * Tells all pending requests to cancel - */ -- (void)cancelAllTasks; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLURLSession.m b/SmartDeviceLink/SDLURLSession.m deleted file mode 100644 index 2b8df45de..000000000 --- a/SmartDeviceLink/SDLURLSession.m +++ /dev/null @@ -1,113 +0,0 @@ -// -// SDLURLConnection.m -// SmartDeviceLink-iOS -// -// Created by Joel Fischer on 8/17/15. -// Copyright (c) 2015 smartdevicelink. All rights reserved. -// - -#import "SDLURLSession.h" - -#import "SDLURLRequestTask.h" - - -NS_ASSUME_NONNULL_BEGIN - -static float DefaultConnectionTimeout = 45.0; - - -@interface SDLURLSession () - -@property (strong, nonatomic) NSMutableSet *activeTasks; - -@end - - -@implementation SDLURLSession - - -#pragma mark - Lifecycle - -+ (instancetype)defaultSession { - static SDLURLSession *sharedSession = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - sharedSession = [[self alloc] init]; - }); - - return sharedSession; -} - -- (void)dealloc { - for (SDLURLRequestTask *task in self.activeTasks) { - [task cancel]; - } -} - -- (instancetype)init { - self = [super init]; - if (!self) { - return nil; - } - - _cachePolicy = NSURLRequestUseProtocolCachePolicy; - _connectionTimeout = DefaultConnectionTimeout; - - _activeTasks = [NSMutableSet set]; - - return self; -} - - -#pragma mark - URL Request Methods - -- (void)dataFromURL:(NSURL *)url completionHandler:(SDLURLConnectionRequestCompletionHandler)completionHandler { - // Apple no longer allows HTTP URLs without a special exception as of Jan. 2017 - if ([url.scheme isEqualToString:@"http"]) { - url = [NSURL URLWithString:[url.absoluteString stringByReplacingCharactersInRange:NSMakeRange(0, 4) withString:@"https"]]; - } - - NSURLRequest *request = [NSURLRequest requestWithURL:url cachePolicy:self.cachePolicy timeoutInterval:self.connectionTimeout]; - - SDLURLRequestTask *task = [[SDLURLRequestTask alloc] initWithURLRequest:request completionHandler:completionHandler]; - task.delegate = self; - - [self.activeTasks addObject:task]; -} - -- (void)uploadWithURLRequest:(NSURLRequest *)request data:(NSData *)data completionHandler:(SDLURLConnectionRequestCompletionHandler)completionHandler { - NSURL *url = request.URL; - if ([url.scheme isEqualToString:@"http"]) { - url = [NSURL URLWithString:[url.absoluteString stringByReplacingCharactersInRange:NSMakeRange(0, 4) withString:@"https"]]; - } - - NSMutableURLRequest *mutableRequest = [request mutableCopy]; - mutableRequest.URL = url; - mutableRequest.HTTPBody = data; - mutableRequest.HTTPMethod = @"POST"; - - SDLURLRequestTask *task = [[SDLURLRequestTask alloc] initWithURLRequest:mutableRequest completionHandler:completionHandler]; - task.delegate = self; - - [self.activeTasks addObject:task]; -} - - -#pragma mark - Cancel Methods - -- (void)cancelAllTasks { - for (SDLURLRequestTask *task in self.activeTasks) { - [task cancel]; - } -} - - -#pragma mark - SDLURLRequestTaskDelegate - -- (void)taskDidFinish:(SDLURLRequestTask *)task { - [self.activeTasks removeObject:task]; -} - -@end - -NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLinkTests/Info.plist b/SmartDeviceLinkTests/Info.plist index ba72822e8..7c292c70a 100644 --- a/SmartDeviceLinkTests/Info.plist +++ b/SmartDeviceLinkTests/Info.plist @@ -9,7 +9,7 @@ CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion - 6.0 + 7.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType diff --git a/SmartDeviceLinkTests/UtilitiesSpecs/HTTP Connection/SDLURLRequestTaskSpec.m b/SmartDeviceLinkTests/UtilitiesSpecs/HTTP Connection/SDLURLRequestTaskSpec.m deleted file mode 100644 index d78ff0c7f..000000000 --- a/SmartDeviceLinkTests/UtilitiesSpecs/HTTP Connection/SDLURLRequestTaskSpec.m +++ /dev/null @@ -1,140 +0,0 @@ -#import -#import -#import - -#import "SDLURLRequestTask.h" - - -QuickSpecBegin(SDLURLRequestTaskSpec) - -describe(@"a url request task", ^{ - __block SDLURLRequestTask *testTask = nil; - - describe(@"when the server returns correct data", ^{ - NSData *testData = [@"someData" dataUsingEncoding:NSUTF8StringEncoding]; - - __block NSData *testReturnData = nil; - __block NSURLResponse *testReturnResponse = nil; - __block NSError *testReturnError = nil; - - beforeEach(^{ - [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) { - return [request.URL.host isEqualToString:@"www.faketest.com"]; - } withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) { - return [[OHHTTPStubsResponse responseWithData:testData statusCode:200 headers:nil] requestTime:0.5 responseTime:0]; - }]; - - NSURLRequest *someURLRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.faketest.com"]]; - - testTask = [[SDLURLRequestTask alloc] initWithURLRequest:someURLRequest completionHandler:^void(NSData *data, NSURLResponse *response, NSError *error) { - testReturnData = data; - testReturnResponse = response; - testReturnError = error; - }]; - }); - - afterEach(^{ - testTask = nil; - [OHHTTPStubs removeAllStubs]; - }); - - it(@"should return data", ^{ - expect(testReturnData).toEventually(equal(testData)); - }); - - it(@"should return a response", ^{ - expect(testReturnResponse).toEventuallyNot(beNil()); - }); - - it(@"should not return an error", ^{ - expect(testReturnError).toEventually(beNil()); - }); - }); - - describe(@"when the connection fails because there is no internet", ^{ - NSError *someNetworkError = [NSError errorWithDomain:NSURLErrorDomain code:kCFURLErrorNotConnectedToInternet userInfo:nil]; - - __block NSData *testReturnData = nil; - __block NSURLResponse *testReturnResponse = nil; - __block NSError *testReturnError = nil; - - beforeEach(^{ - [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) { - return [request.URL.host isEqualToString:@"www.faketest.com"]; - } withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) { - return [OHHTTPStubsResponse responseWithError:someNetworkError]; - }]; - - NSURLRequest *someURLRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.faketest.com"]]; - - testTask = [[SDLURLRequestTask alloc] initWithURLRequest:someURLRequest completionHandler:^void(NSData *data, NSURLResponse *response, NSError *error) { - testReturnData = data; - testReturnResponse = response; - testReturnError = error; - }]; - }); - - afterEach(^{ - testTask = nil; - [OHHTTPStubs removeAllStubs]; - }); - - it(@"should return nil data", ^{ - expect(testReturnData).toEventually(beNil()); - }); - - it(@"should return a nil response", ^{ - expect(testReturnResponse).toEventually(beNil()); - }); - - it(@"should return an error", ^{ - expect(@(testReturnError.code)).toEventually(equal(@(someNetworkError.code))); - }); - }); - - describe(@"when the connection fails because it was cancelled", ^{ - NSData *testData = [@"testData" dataUsingEncoding:NSUTF8StringEncoding]; - - __block NSData *testReturnData = nil; - __block NSURLResponse *testReturnResponse = nil; - __block NSError *testReturnError = nil; - - beforeEach(^{ - [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) { - return [request.URL.host isEqualToString:@"www.faketest.com"]; - } withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) { - return [[OHHTTPStubsResponse responseWithData:testData statusCode:200 headers:nil] requestTime:0.25 responseTime:0.25]; - }]; - - NSURLRequest *someURLRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.faketest.com"]]; - - - testTask = [[SDLURLRequestTask alloc] initWithURLRequest:someURLRequest completionHandler:^void(NSData *data, NSURLResponse *response, NSError *error) { - testReturnData = data; - testReturnResponse = response; - testReturnError = error; - }]; - - [testTask cancel]; - }); - - afterEach(^{ - testTask = nil; - [OHHTTPStubs removeAllStubs]; - }); - - it(@"should return nil data", ^{ - expect(testReturnData).toEventually(beNil()); - }); - - it(@"should return a nil response", ^{ - expect(testReturnResponse).toEventually(beNil()); - }); - - it(@"should return an error", ^{ - expect(@(testReturnError.code)).toEventually(equal(@(kCFURLErrorCancelled))); - }); - }); -}); - -QuickSpecEnd diff --git a/SmartDeviceLinkTests/UtilitiesSpecs/HTTP Connection/SDLURLSessionSpec.m b/SmartDeviceLinkTests/UtilitiesSpecs/HTTP Connection/SDLURLSessionSpec.m deleted file mode 100644 index ed613c8fb..000000000 --- a/SmartDeviceLinkTests/UtilitiesSpecs/HTTP Connection/SDLURLSessionSpec.m +++ /dev/null @@ -1,201 +0,0 @@ -#import -#import -#import - -#import "SDLURLSession.h" - -QuickSpecBegin(SDLURLSessionSpec) - -describe(@"the url session", ^{ - __block SDLURLSession *testSession = nil; - - describe(@"attempting to get good data", ^{ - context(@"from an https address", ^{ - context(@"uploading data", ^{ - NSData *testData = [@"testData" dataUsingEncoding:NSUTF8StringEncoding]; - NSArray *someJSONObject = @[@"one", @"two"]; - NSData *testJSONData = [NSJSONSerialization dataWithJSONObject:someJSONObject options:0 error:nil]; - - __block NSData *testReturnData = nil; - __block NSURLResponse *testReturnResponse = nil; - __block NSError *testReturnError = nil; - __block NSArray *testReturnJSONObject = nil; - - beforeEach(^{ - [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) { - if ([request.URL.host isEqualToString:@"www.faketest.com"]) { - testReturnJSONObject = [NSJSONSerialization JSONObjectWithData:request.HTTPBody options:0 error:nil]; - return YES; - } - - return NO; - } withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) { - return [[OHHTTPStubsResponse responseWithData:testData statusCode:200 headers:nil] requestTime:0.5 responseTime:0]; - }]; - - testSession = [[SDLURLSession alloc] init]; - NSURLRequest *someURLRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:@"https://www.faketest.com"]]; - - [testSession uploadWithURLRequest:someURLRequest data:testJSONData completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { - testReturnData = data; - testReturnResponse = response; - testReturnError = error; - }]; - }); - - afterEach(^{ - testSession = nil; - [OHHTTPStubs removeAllStubs]; - }); - - it(@"should have correct data", ^{ - expect(testReturnJSONObject).toEventually(equal(someJSONObject)); - expect(testReturnData).toEventually(equal(testData)); - expect(testReturnResponse).toEventuallyNot(beNil()); - expect(testReturnError).toEventually(beNil()); - }); - }); - - context(@"downloading data", ^{ - NSData *testData = [@"someData" dataUsingEncoding:NSUTF8StringEncoding]; - - __block NSData *testReturnData = nil; - __block NSURLResponse *testReturnResponse = nil; - __block NSError *testReturnError = nil; - - beforeEach(^{ - [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) { - return [request.URL.host isEqualToString:@"www.faketest.com"]; - } withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) { - return [[OHHTTPStubsResponse responseWithData:testData statusCode:200 headers:nil] requestTime:0.5 responseTime:0]; - }]; - - testSession = [[SDLURLSession alloc] init]; - [testSession dataFromURL:[NSURL URLWithString:@"https://www.faketest.com"] completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { - testReturnData = data; - testReturnResponse = response; - testReturnError = error; - }]; - }); - - afterEach(^{ - testSession = nil; - [OHHTTPStubs removeAllStubs]; - }); - - it(@"should return correct info", ^{ - expect(testReturnData).toEventually(equal(testData)); - expect(testReturnResponse).toEventuallyNot(beNil()); - expect(testReturnError).toEventually(beNil()); - }); - }); - }); - - context(@"from an http address", ^{ - NSData *testData = [@"testData" dataUsingEncoding:NSUTF8StringEncoding]; - NSArray *someJSONObject = @[@"one", @"two"]; - NSData *testJSONData = [NSJSONSerialization dataWithJSONObject:someJSONObject options:0 error:nil]; - - __block NSString *testURLRequestComponent = nil; - - beforeEach(^{ - [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) { - if ([request.URL.host isEqualToString:@"www.faketest.com"]) { - testURLRequestComponent = request.URL.scheme; - return YES; - } - - return NO; - } withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) { - return [[OHHTTPStubsResponse responseWithData:testData statusCode:200 headers:request.allHTTPHeaderFields] requestTime:0.5 responseTime:0]; - }]; - - testSession = [[SDLURLSession alloc] init]; - NSURLRequest *someURLRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.faketest.com"]]; - - [testSession uploadWithURLRequest:someURLRequest data:testJSONData completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {}]; - }); - - afterEach(^{ - testSession = nil; - [OHHTTPStubs removeAllStubs]; - }); - - it(@"should have called the HTTPS URL instead", ^{ - expect(testURLRequestComponent).toEventually(match(@"https")); - }); - }); - }); - - describe(@"when the connection fails because there is no internet", ^{ - NSError *someNetworkError = [NSError errorWithDomain:NSURLErrorDomain code:kCFURLErrorNotConnectedToInternet userInfo:nil]; - - __block NSData *testReturnData = nil; - __block NSURLResponse *testReturnResponse = nil; - __block NSError *testReturnError = nil; - - beforeEach(^{ - [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) { - return [request.URL.host isEqualToString:@"www.faketest.com"]; - } withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) { - return [OHHTTPStubsResponse responseWithError:someNetworkError]; - }]; - - testSession = [[SDLURLSession alloc] init]; - [testSession dataFromURL:[NSURL URLWithString:@"http://www.faketest.com"] completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { - testReturnData = data; - testReturnResponse = response; - testReturnError = error; - }]; - }); - - afterEach(^{ - testSession = nil; - [OHHTTPStubs removeAllStubs]; - }); - - it(@"should return nil data", ^{ - expect(testReturnData).toEventually(beNil()); - expect(testReturnResponse).toEventually(beNil()); - expect(@(testReturnError.code)).toEventually(equal(@(someNetworkError.code))); - }); - }); - - describe(@"when the connection fails because it was cancelled", ^{ - NSData *testData = [@"testData" dataUsingEncoding:NSUTF8StringEncoding]; - - __block NSData *testReturnData = nil; - __block NSURLResponse *testReturnResponse = nil; - __block NSError *testReturnError = nil; - - beforeEach(^{ - [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) { - return [request.URL.host isEqualToString:@"www.faketest.com"]; - } withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) { - return [[OHHTTPStubsResponse responseWithData:testData statusCode:200 headers:nil] requestTime:0.25 responseTime:0.25]; - }]; - - testSession = [[SDLURLSession alloc] init]; - [testSession dataFromURL:[NSURL URLWithString:@"http://www.faketest.com"] completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { - testReturnData = data; - testReturnResponse = response; - testReturnError = error; - }]; - - [testSession cancelAllTasks]; - }); - - afterEach(^{ - testSession = nil; - [OHHTTPStubs removeAllStubs]; - }); - - it(@"should return nil data", ^{ - expect(testReturnData).toEventually(beNil()); - expect(testReturnResponse).toEventually(beNil()); - expect(@(testReturnError.code)).toEventually(equal(@(kCFURLErrorCancelled))); - }); - }); -}); - -QuickSpecEnd diff --git a/SmartDeviceLink_Example/Info.plist b/SmartDeviceLink_Example/Info.plist index 38d68fde3..c1f3f2fc9 100644 --- a/SmartDeviceLink_Example/Info.plist +++ b/SmartDeviceLink_Example/Info.plist @@ -9,7 +9,7 @@ CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion - 6.0 + 7.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType From f213e9bdfee9fddfc0113a050f022a8d8447bf4d Mon Sep 17 00:00:00 2001 From: "Muller, Alexander (A.)" Date: Tue, 18 Oct 2016 10:03:53 -0700 Subject: [PATCH 2/4] Updated upload task to use local url session. --- SmartDeviceLink/SDLProxy.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SmartDeviceLink/SDLProxy.m b/SmartDeviceLink/SDLProxy.m index 9a2ac44aa..6fd4a0ebc 100644 --- a/SmartDeviceLink/SDLProxy.m +++ b/SmartDeviceLink/SDLProxy.m @@ -752,9 +752,9 @@ - (void)sendEncodedSyncPData:(NSDictionary *)encodedSyncPData to } // Send the HTTP Request - [[[NSURLSession sharedSession] uploadTaskWithRequest:request - fromData:data - completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { + [[self.urlSession uploadTaskWithRequest:request + fromData:data + completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { [self syncPDataNetworkRequestCompleteWithData:data response:response error:error]; }] resume]; From ae140561d1cffea8ba8578cce6f6fe0432d658aa Mon Sep 17 00:00:00 2001 From: "Muller, Alexander (A.)" Date: Wed, 18 Jan 2017 14:52:23 -0800 Subject: [PATCH 3/4] Fixed issue with merge conflict. --- SmartDeviceLink/SDLProxy.m | 68 ++++++++++++++++++++++++++------------ 1 file changed, 47 insertions(+), 21 deletions(-) diff --git a/SmartDeviceLink/SDLProxy.m b/SmartDeviceLink/SDLProxy.m index 48c905a8c..8cb1c8eb9 100644 --- a/SmartDeviceLink/SDLProxy.m +++ b/SmartDeviceLink/SDLProxy.m @@ -38,7 +38,6 @@ #import "SDLSystemContext.h" #import "SDLSystemRequest.h" #import "SDLTimer.h" -#import "SDLURLSession.h" #import "SDLVehicleType.h" NS_ASSUME_NONNULL_BEGIN @@ -52,6 +51,7 @@ const float startSessionTime = 10.0; const float notifyProxyClosedDelay = 0.1; const int POLICIES_CORRELATION_ID = 65535; +static float DefaultConnectionTimeout = 45.0; @interface SDLProxy () { SDLLockScreenStatusManager *_lsm; @@ -62,6 +62,7 @@ @interface SDLProxy () { @property (nullable, nonatomic, strong, readwrite) SDLStreamingMediaManager *streamingMediaManager; @property (nullable, nonatomic, strong) SDLDisplayCapabilities *displayCapabilities; @property (nonatomic, strong) NSMutableDictionary *securityManagers; +@property (nonatomic, strong) NSURLSession* urlSession; @end @@ -86,6 +87,14 @@ - (instancetype)initWithTransport:(SDLAbstractTransport *)transport protocol:(SD [SDLDebugTool logInfo:@"SDLProxy initWithTransport"]; [[EAAccessoryManager sharedAccessoryManager] registerForLocalNotifications]; + + NSURLSessionConfiguration* configuration = [NSURLSessionConfiguration defaultSessionConfiguration]; + configuration.timeoutIntervalForRequest = DefaultConnectionTimeout; + configuration.timeoutIntervalForResource = DefaultConnectionTimeout; + configuration.requestCachePolicy = NSURLRequestUseProtocolCachePolicy; + + _urlSession = [NSURLSession sessionWithConfiguration:configuration]; + } return self; @@ -98,9 +107,9 @@ - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; [[EAAccessoryManager sharedAccessoryManager] unregisterForLocalNotifications]; - - [[SDLURLSession defaultSession] cancelAllTasks]; - + + [_urlSession invalidateAndCancel]; + [SDLDebugTool logInfo:@"SDLProxy Dealloc" withType:SDLDebugType_RPC toOutput:SDLDebugOutput_All toGroup:_debugConsoleGroupName]; } @@ -509,17 +518,17 @@ - (void)handleSystemRequestProprietary:(SDLOnSystemRequest *)request { } - (void)handleSystemRequestLockScreenIconURL:(SDLOnSystemRequest *)request { - [[SDLURLSession defaultSession] dataFromURL:[NSURL URLWithString:request.url] - completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { - if (error != nil) { - NSString *logMessage = [NSString stringWithFormat:@"OnSystemRequest failure (HTTP response), download task failed: %@", error.localizedDescription]; - [SDLDebugTool logInfo:logMessage withType:SDLDebugType_RPC toOutput:SDLDebugOutput_All toGroup:self.debugConsoleGroupName]; - return; - } - - UIImage *icon = [UIImage imageWithData:data]; - [self invokeMethodOnDelegates:@selector(onReceivedLockScreenIcon:) withObject:icon]; - }]; + [self sdl_sendDataTaskWithURL:[NSURL URLWithString:request.url] + completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { + if (error != nil) { + NSString *logMessage = [NSString stringWithFormat:@"OnSystemRequest failure (HTTP response), download task failed: %@", error.localizedDescription]; + [SDLDebugTool logInfo:logMessage withType:SDLDebugType_RPC toOutput:SDLDebugOutput_All toGroup:self.debugConsoleGroupName]; + return; + } + + UIImage *icon = [UIImage imageWithData:data]; + [self invokeMethodOnDelegates:@selector(onReceivedLockScreenIcon:) withObject:icon]; + }]; } - (void)sdl_handleSystemRequestHTTP:(SDLOnSystemRequest *)request { @@ -613,7 +622,7 @@ - (void)sdl_uploadData:(NSData *_Nonnull)data toURLString:(NSString *_Nonnull)ur [SDLDebugTool logInfo:logMessage withType:SDLDebugType_RPC toOutput:SDLDebugOutput_All toGroup:self.debugConsoleGroupName]; // Create the upload task - [[SDLURLSession defaultSession] uploadWithURLRequest:request data:data completionHandler:completionHandler]; + [self sdl_sendUploadRequest:request withData:data completionHandler:completionHandler]; } /** @@ -649,9 +658,26 @@ - (void)uploadForBodyDataDictionary:(NSDictionary *)dictionary U [SDLDebugTool logInfo:logMessage withType:SDLDebugType_RPC toOutput:SDLDebugOutput_All toGroup:self.debugConsoleGroupName]; // Create the upload task - [[SDLURLSession defaultSession] uploadWithURLRequest:request data:bodyData completionHandler:completionHandler]; + [self sdl_sendUploadRequest:request withData:bodyData completionHandler:completionHandler]; } +- (void)sdl_sendUploadRequest:(NSURLRequest*)request withData:(NSData*)data completionHandler:(URLSessionTaskCompletionHandler)completionHandler { + NSMutableURLRequest* mutableRequest = [request mutableCopy]; + + if ([mutableRequest.URL.scheme isEqualToString:@"http"]) { + mutableRequest.URL = [NSURL URLWithString:[mutableRequest.URL.absoluteString stringByReplacingCharactersInRange:NSMakeRange(0, 4) withString:@"https"]]; + } + + [[self.urlSession uploadTaskWithRequest:request fromData:data completionHandler:completionHandler] resume]; +} + +- (void)sdl_sendDataTaskWithURL:(NSURL*)url completionHandler:(URLSessionTaskCompletionHandler)completionHandler { + if ([url.scheme isEqualToString:@"http"]) { + url = [NSURL URLWithString:[url.absoluteString stringByReplacingCharactersInRange:NSMakeRange(0, 4) withString:@"https"]]; + } + + [[self.urlSession dataTaskWithURL:url completionHandler:completionHandler] resume]; +} #pragma mark - Delegate management @@ -704,11 +730,11 @@ - (void)sendEncodedSyncPData:(NSDictionary *)encodedSyncPData to } // Send the HTTP Request - [[SDLURLSession defaultSession] uploadWithURLRequest:request - data:data - completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { + [[self.urlSession uploadTaskWithRequest:request + fromData:data + completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { [self syncPDataNetworkRequestCompleteWithData:data response:response error:error]; - }]; + }] resume]; [SDLDebugTool logInfo:@"OnEncodedSyncPData (HTTP request)" withType:SDLDebugType_RPC toOutput:SDLDebugOutput_All toGroup:self.debugConsoleGroupName]; } From 64bc1cd9db9f1cab94a0786cf4f09120b0aa4816 Mon Sep 17 00:00:00 2001 From: "Muller, Alexander (A.)" Date: Wed, 18 Jan 2017 15:18:12 -0800 Subject: [PATCH 4/4] Updated to support using template images. --- SmartDeviceLink-iOS.xcodeproj/project.pbxproj | 60 ------------------ .../Contents.json | 23 ------- .../lock_arrow_down_white.png | Bin 309 -> 0 bytes .../lock_arrow_down_white@2x.png | Bin 498 -> 0 bytes .../lock_arrow_down_white@3x.png | Bin 729 -> 0 bytes .../Contents.json | 23 ------- .../lock_arrow_up_white.png | Bin 308 -> 0 bytes .../lock_arrow_up_white@2x.png | Bin 503 -> 0 bytes .../lock_arrow_up_white@3x.png | Bin 726 -> 0 bytes .../sdl_logo_white.imageset/Contents.json | 23 ------- .../sdl_logo_white.png | Bin 2282 -> 0 bytes .../sdl_logo_white@2x.png | Bin 4931 -> 0 bytes .../sdl_logo_white@3x.png | Bin 7137 -> 0 bytes SmartDeviceLink/SDLLockScreenViewController.m | 51 +++++++-------- .../white/lock_arrow_down_white.png | Bin 309 -> 0 bytes .../white/lock_arrow_down_white@2x.png | Bin 498 -> 0 bytes .../white/lock_arrow_down_white@3x.png | Bin 729 -> 0 bytes 17 files changed, 26 insertions(+), 154 deletions(-) delete mode 100644 SmartDeviceLink/Assets/SDLAssets.xcassets/lock_arrow_down_white.imageset/Contents.json delete mode 100644 SmartDeviceLink/Assets/SDLAssets.xcassets/lock_arrow_down_white.imageset/lock_arrow_down_white.png delete mode 100644 SmartDeviceLink/Assets/SDLAssets.xcassets/lock_arrow_down_white.imageset/lock_arrow_down_white@2x.png delete mode 100644 SmartDeviceLink/Assets/SDLAssets.xcassets/lock_arrow_down_white.imageset/lock_arrow_down_white@3x.png delete mode 100644 SmartDeviceLink/Assets/SDLAssets.xcassets/lock_arrow_up_white.imageset/Contents.json delete mode 100644 SmartDeviceLink/Assets/SDLAssets.xcassets/lock_arrow_up_white.imageset/lock_arrow_up_white.png delete mode 100644 SmartDeviceLink/Assets/SDLAssets.xcassets/lock_arrow_up_white.imageset/lock_arrow_up_white@2x.png delete mode 100644 SmartDeviceLink/Assets/SDLAssets.xcassets/lock_arrow_up_white.imageset/lock_arrow_up_white@3x.png delete mode 100644 SmartDeviceLink/Assets/SDLAssets.xcassets/sdl_logo_white.imageset/Contents.json delete mode 100644 SmartDeviceLink/Assets/SDLAssets.xcassets/sdl_logo_white.imageset/sdl_logo_white.png delete mode 100644 SmartDeviceLink/Assets/SDLAssets.xcassets/sdl_logo_white.imageset/sdl_logo_white@2x.png delete mode 100644 SmartDeviceLink/Assets/SDLAssets.xcassets/sdl_logo_white.imageset/sdl_logo_white@3x.png delete mode 100644 SmartDeviceLink/iOS 7 Assets/lock_arrow_down/white/lock_arrow_down_white.png delete mode 100644 SmartDeviceLink/iOS 7 Assets/lock_arrow_down/white/lock_arrow_down_white@2x.png delete mode 100644 SmartDeviceLink/iOS 7 Assets/lock_arrow_down/white/lock_arrow_down_white@3x.png diff --git a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj index 30a1e521b..6a2a02ed9 100644 --- a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj +++ b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj @@ -871,21 +871,12 @@ DA7515B11D95FAA000F29323 /* lock_arrow_down_black.png in Resources */ = {isa = PBXBuildFile; fileRef = DA7515981D95FAA000F29323 /* lock_arrow_down_black.png */; }; DA7515B21D95FAA000F29323 /* lock_arrow_down_black@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA7515991D95FAA000F29323 /* lock_arrow_down_black@2x.png */; }; DA7515B31D95FAA000F29323 /* lock_arrow_down_black@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA75159A1D95FAA000F29323 /* lock_arrow_down_black@3x.png */; }; - DA7515B41D95FAA000F29323 /* lock_arrow_down_white.png in Resources */ = {isa = PBXBuildFile; fileRef = DA75159C1D95FAA000F29323 /* lock_arrow_down_white.png */; }; - DA7515B51D95FAA000F29323 /* lock_arrow_down_white@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA75159D1D95FAA000F29323 /* lock_arrow_down_white@2x.png */; }; - DA7515B61D95FAA000F29323 /* lock_arrow_down_white@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA75159E1D95FAA000F29323 /* lock_arrow_down_white@3x.png */; }; DA7515B71D95FAA000F29323 /* lock_arrow_up_black.png in Resources */ = {isa = PBXBuildFile; fileRef = DA7515A11D95FAA000F29323 /* lock_arrow_up_black.png */; }; DA7515B81D95FAA000F29323 /* lock_arrow_up_black@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA7515A21D95FAA000F29323 /* lock_arrow_up_black@2x.png */; }; DA7515B91D95FAA000F29323 /* lock_arrow_up_black@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA7515A31D95FAA000F29323 /* lock_arrow_up_black@3x.png */; }; - DA7515BA1D95FAA000F29323 /* lock_arrow_up_white.png in Resources */ = {isa = PBXBuildFile; fileRef = DA7515A51D95FAA000F29323 /* lock_arrow_up_white.png */; }; - DA7515BB1D95FAA000F29323 /* lock_arrow_up_white@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA7515A61D95FAA000F29323 /* lock_arrow_up_white@2x.png */; }; - DA7515BC1D95FAA000F29323 /* lock_arrow_up_white@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA7515A71D95FAA000F29323 /* lock_arrow_up_white@3x.png */; }; DA7515BD1D95FAA000F29323 /* sdl_logo_black.png in Resources */ = {isa = PBXBuildFile; fileRef = DA7515AA1D95FAA000F29323 /* sdl_logo_black.png */; }; DA7515BE1D95FAA000F29323 /* sdl_logo_black@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA7515AB1D95FAA000F29323 /* sdl_logo_black@2x.png */; }; DA7515BF1D95FAA000F29323 /* sdl_logo_black@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA7515AC1D95FAA000F29323 /* sdl_logo_black@3x.png */; }; - DA7515C01D95FAA000F29323 /* sdl_logo_white.png in Resources */ = {isa = PBXBuildFile; fileRef = DA7515AE1D95FAA000F29323 /* sdl_logo_white.png */; }; - DA7515C11D95FAA000F29323 /* sdl_logo_white@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA7515AF1D95FAA000F29323 /* sdl_logo_white@2x.png */; }; - DA7515C21D95FAA000F29323 /* sdl_logo_white@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA7515B01D95FAA000F29323 /* sdl_logo_white@3x.png */; }; DA96C0661D4D4F730022F520 /* SDLAppInfoSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = DA96C0651D4D4F730022F520 /* SDLAppInfoSpec.m */; }; DA9F7E631DCBFAC800ACAE48 /* SDLDateTime.h in Headers */ = {isa = PBXBuildFile; fileRef = DA9F7E611DCBFAC800ACAE48 /* SDLDateTime.h */; settings = {ATTRIBUTES = (Public, ); }; }; DA9F7E641DCBFAC800ACAE48 /* SDLDateTime.m in Sources */ = {isa = PBXBuildFile; fileRef = DA9F7E621DCBFAC800ACAE48 /* SDLDateTime.m */; }; @@ -1891,21 +1882,12 @@ DA7515981D95FAA000F29323 /* lock_arrow_down_black.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = lock_arrow_down_black.png; sourceTree = ""; }; DA7515991D95FAA000F29323 /* lock_arrow_down_black@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "lock_arrow_down_black@2x.png"; sourceTree = ""; }; DA75159A1D95FAA000F29323 /* lock_arrow_down_black@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "lock_arrow_down_black@3x.png"; sourceTree = ""; }; - DA75159C1D95FAA000F29323 /* lock_arrow_down_white.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = lock_arrow_down_white.png; sourceTree = ""; }; - DA75159D1D95FAA000F29323 /* lock_arrow_down_white@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "lock_arrow_down_white@2x.png"; sourceTree = ""; }; - DA75159E1D95FAA000F29323 /* lock_arrow_down_white@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "lock_arrow_down_white@3x.png"; sourceTree = ""; }; DA7515A11D95FAA000F29323 /* lock_arrow_up_black.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = lock_arrow_up_black.png; sourceTree = ""; }; DA7515A21D95FAA000F29323 /* lock_arrow_up_black@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "lock_arrow_up_black@2x.png"; sourceTree = ""; }; DA7515A31D95FAA000F29323 /* lock_arrow_up_black@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "lock_arrow_up_black@3x.png"; sourceTree = ""; }; - DA7515A51D95FAA000F29323 /* lock_arrow_up_white.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = lock_arrow_up_white.png; sourceTree = ""; }; - DA7515A61D95FAA000F29323 /* lock_arrow_up_white@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "lock_arrow_up_white@2x.png"; sourceTree = ""; }; - DA7515A71D95FAA000F29323 /* lock_arrow_up_white@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "lock_arrow_up_white@3x.png"; sourceTree = ""; }; DA7515AA1D95FAA000F29323 /* sdl_logo_black.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = sdl_logo_black.png; sourceTree = ""; }; DA7515AB1D95FAA000F29323 /* sdl_logo_black@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "sdl_logo_black@2x.png"; sourceTree = ""; }; DA7515AC1D95FAA000F29323 /* sdl_logo_black@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "sdl_logo_black@3x.png"; sourceTree = ""; }; - DA7515AE1D95FAA000F29323 /* sdl_logo_white.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = sdl_logo_white.png; sourceTree = ""; }; - DA7515AF1D95FAA000F29323 /* sdl_logo_white@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "sdl_logo_white@2x.png"; sourceTree = ""; }; - DA7515B01D95FAA000F29323 /* sdl_logo_white@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "sdl_logo_white@3x.png"; sourceTree = ""; }; DA96C0651D4D4F730022F520 /* SDLAppInfoSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLAppInfoSpec.m; sourceTree = ""; }; DA9F7E611DCBFAC800ACAE48 /* SDLDateTime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLDateTime.h; sourceTree = ""; }; DA9F7E621DCBFAC800ACAE48 /* SDLDateTime.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLDateTime.m; sourceTree = ""; }; @@ -3672,7 +3654,6 @@ isa = PBXGroup; children = ( DA7515971D95FAA000F29323 /* black */, - DA75159B1D95FAA000F29323 /* white */, ); path = lock_arrow_down; sourceTree = ""; @@ -3687,21 +3668,10 @@ path = black; sourceTree = ""; }; - DA75159B1D95FAA000F29323 /* white */ = { - isa = PBXGroup; - children = ( - DA75159C1D95FAA000F29323 /* lock_arrow_down_white.png */, - DA75159D1D95FAA000F29323 /* lock_arrow_down_white@2x.png */, - DA75159E1D95FAA000F29323 /* lock_arrow_down_white@3x.png */, - ); - path = white; - sourceTree = ""; - }; DA75159F1D95FAA000F29323 /* lock_arrow_up */ = { isa = PBXGroup; children = ( DA7515A01D95FAA000F29323 /* black */, - DA7515A41D95FAA000F29323 /* white */, ); path = lock_arrow_up; sourceTree = ""; @@ -3716,21 +3686,10 @@ path = black; sourceTree = ""; }; - DA7515A41D95FAA000F29323 /* white */ = { - isa = PBXGroup; - children = ( - DA7515A51D95FAA000F29323 /* lock_arrow_up_white.png */, - DA7515A61D95FAA000F29323 /* lock_arrow_up_white@2x.png */, - DA7515A71D95FAA000F29323 /* lock_arrow_up_white@3x.png */, - ); - path = white; - sourceTree = ""; - }; DA7515A81D95FAA000F29323 /* sdl_logo */ = { isa = PBXGroup; children = ( DA7515A91D95FAA000F29323 /* black */, - DA7515AD1D95FAA000F29323 /* white */, ); path = sdl_logo; sourceTree = ""; @@ -3745,16 +3704,6 @@ path = black; sourceTree = ""; }; - DA7515AD1D95FAA000F29323 /* white */ = { - isa = PBXGroup; - children = ( - DA7515AE1D95FAA000F29323 /* sdl_logo_white.png */, - DA7515AF1D95FAA000F29323 /* sdl_logo_white@2x.png */, - DA7515B01D95FAA000F29323 /* sdl_logo_white@3x.png */, - ); - path = white; - sourceTree = ""; - }; DAC5724C1D0FE3B60004288B /* Touches */ = { isa = PBXGroup; children = ( @@ -4239,24 +4188,15 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - DA7515B51D95FAA000F29323 /* lock_arrow_down_white@2x.png in Resources */, DA7515BE1D95FAA000F29323 /* sdl_logo_black@2x.png in Resources */, DA7515B91D95FAA000F29323 /* lock_arrow_up_black@3x.png in Resources */, DA7515B71D95FAA000F29323 /* lock_arrow_up_black.png in Resources */, - DA7515BC1D95FAA000F29323 /* lock_arrow_up_white@3x.png in Resources */, DA7515B81D95FAA000F29323 /* lock_arrow_up_black@2x.png in Resources */, - DA7515C21D95FAA000F29323 /* sdl_logo_white@3x.png in Resources */, - DA7515C01D95FAA000F29323 /* sdl_logo_white.png in Resources */, - DA7515C11D95FAA000F29323 /* sdl_logo_white@2x.png in Resources */, DA7515BD1D95FAA000F29323 /* sdl_logo_black.png in Resources */, DA7515B11D95FAA000F29323 /* lock_arrow_down_black.png in Resources */, - DA7515BA1D95FAA000F29323 /* lock_arrow_up_white.png in Resources */, 5D6F7A3E1BC811FC0070BF37 /* SDLAssets.xcassets in Resources */, 5D616B451D552F7A00553F6B /* SDLLockScreen.storyboard in Resources */, - DA7515BB1D95FAA000F29323 /* lock_arrow_up_white@2x.png in Resources */, - DA7515B61D95FAA000F29323 /* lock_arrow_down_white@3x.png in Resources */, DA7515B21D95FAA000F29323 /* lock_arrow_down_black@2x.png in Resources */, - DA7515B41D95FAA000F29323 /* lock_arrow_down_white.png in Resources */, DA7515B31D95FAA000F29323 /* lock_arrow_down_black@3x.png in Resources */, DA7515BF1D95FAA000F29323 /* sdl_logo_black@3x.png in Resources */, ); diff --git a/SmartDeviceLink/Assets/SDLAssets.xcassets/lock_arrow_down_white.imageset/Contents.json b/SmartDeviceLink/Assets/SDLAssets.xcassets/lock_arrow_down_white.imageset/Contents.json deleted file mode 100644 index 765c60c66..000000000 --- a/SmartDeviceLink/Assets/SDLAssets.xcassets/lock_arrow_down_white.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "lock_arrow_down_white.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "lock_arrow_down_white@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "lock_arrow_down_white@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/SmartDeviceLink/Assets/SDLAssets.xcassets/lock_arrow_down_white.imageset/lock_arrow_down_white.png b/SmartDeviceLink/Assets/SDLAssets.xcassets/lock_arrow_down_white.imageset/lock_arrow_down_white.png deleted file mode 100644 index 07e620d05701a698e561d6bdc6ca691fbd272843..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 309 zcmV-50m}Y~P)D^^MJ|E%xVy`JQsEAVNPb)*JG(ncIp1r?Rf!nGWK0GbR*n!g zB%&;GXkg5chOF+ht6WT_A;oeMQ9+d<74C%DSGIo)>^Yfzbna{?a+O_Wra1eTC??T_ zvQwgl7&ckkWrv7rCR=bE6d$yXwphzA^UlTxuv z5X(x30&ekhOM%j(4L@!2#yTeJGNFijyxdbHGdl6oDSvE}&bES}m`9R5QmkO;C0Vb6 zV?UwlzQUlCXMQ|Ws&E+K$AH4)7=UBhpq$tDl*Q80B3TG8wd*v3wPTW0RK|Cecnk} zSa<{BGXYR-`@Zu|!otGB!otGB!otGB)mKhzj~se~2Ln5U01BgbZEp>+ZQCj&wr$%^ zC9!S0f%n#5?EIdYb9{~#(*XCTiA>Jn+Bq^M(VR3crD?8jn1xHT^aEL3#FdL==@(j2 zg9|mZ(w~@%3v=~1vbln7SIE}CXiF_N)zVh~$3kpcC@*Al9b2xGEpK$74jby|Ab%{y zhNTKZ4!1Dv7C8z=C+ab&o=ysfm6)_rVUf!nOu0j@!lNq+< z=r1$aNfbL}3dKAptmhQV90t)u7)=b4S?nQfjg=dm;CCnF3YEO)hxb&<9VYO@1i8f- o0M5uYs`3XE>wqUH||907*qoM6N<$g7+}m$^ZZW diff --git a/SmartDeviceLink/Assets/SDLAssets.xcassets/lock_arrow_down_white.imageset/lock_arrow_down_white@3x.png b/SmartDeviceLink/Assets/SDLAssets.xcassets/lock_arrow_down_white.imageset/lock_arrow_down_white@3x.png deleted file mode 100644 index b354c1a139d05d27354f9d70c24128423b1839db..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 729 zcmeAS@N?(olHy`uVBq!ia0vp^Q9yi#g9S)N&a1i3z`(S?)5S5Qg7MAmaK@tw0-@!dX;MnXLGAYRWmO8U9&sHI>UvU)5Xy0o%vRUY6>4PEzqSWBk?u5_#U-1_F7J zd9%XgeSi{^W;0Z~WWYf^6HrKHC+7zD7O+C>#JMy3O|`R2zb(+aF4>UyWp(cDZEufl z1CqJcl_EfL_qC5RD{mi@%KuY+_gGcO{Ew67S9%Clew?(&s++UoD9haA%741V|D00Z z)xlKZ$QawFIU}!Y-I3%!Z71s<8^-o3%~;d1uJ`4PtX)hGIsYASssGTzw3tOrYvF?# zy_sp+BJ-Z<`+O4j*ETtoFv*CE|FgkSo7V31pVGpA&Ti(C7d3EXb!~bb(Q#X>Xs*)X z&qp3EvzQnDWJS~LRT@$;$Aj){n(|siHcm;-{K)4?i`;qd1UPSeP!;xIi)hUH8y~nh zEi@a$MXX;vSYow_$$W#<@-@%cBAc&!9^vfVqxU*MUj54SsXHc?-pG|TKNYpdRjADC zk#1!Fu^THlzB$mFb3{*iXW+L7v6D7B8@>06i=O^$ld$pJNeWMa)y)*ROBjcJQhmNNg$<6I_ zP2bsg`-bzDZw0gO9Gw26qpe^6soXB%-gia9+c)=nynS4@vpfHTFsJ?f6SZH|g!ZN~ zy?dhY(CWloBj)>$)n)4TO}BjEZt?4+%AKQ$PL^k4jkq&8Ro9+5tk5K>B3#Jt&iO>+ z`w5>Eg$X=H;)i!kOEi-FUNlEr_IcdQUY!`t?lZ?V^h~|t4*Z?-WY6R~`uPgh&r_$D u8}Kz0eiD*sR&w diff --git a/SmartDeviceLink/Assets/SDLAssets.xcassets/lock_arrow_up_white.imageset/Contents.json b/SmartDeviceLink/Assets/SDLAssets.xcassets/lock_arrow_up_white.imageset/Contents.json deleted file mode 100644 index 3140e0f82..000000000 --- a/SmartDeviceLink/Assets/SDLAssets.xcassets/lock_arrow_up_white.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "lock_arrow_up_white.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "lock_arrow_up_white@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "lock_arrow_up_white@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/SmartDeviceLink/Assets/SDLAssets.xcassets/lock_arrow_up_white.imageset/lock_arrow_up_white.png b/SmartDeviceLink/Assets/SDLAssets.xcassets/lock_arrow_up_white.imageset/lock_arrow_up_white.png deleted file mode 100644 index bb0662fe5641c74a30ba6a5fbba1797ebab743ce..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 308 zcmV-40n7f0P)F~Kb;fJijvSut8zm+=bVx5 z7Ow)Z>XJ5cr_nY|<&-<8q}s)cJho_)*797fX`0Lt&mEC$7SHmUS(CJqw^ZuVBo27X z0ZDQ^iDXhr%g`x%D@|Yzojnp>k4G^v`dV5{h>4J*=V?4UnA#!!X*`IH!N+MnAvQwt z@6uQ{v9(F;P27izzN<8cC@!MpD0*0bv;ax)vI$|LDH|A-MoFy=0A`)2nv?0000C1- diff --git a/SmartDeviceLink/Assets/SDLAssets.xcassets/lock_arrow_up_white.imageset/lock_arrow_up_white@2x.png b/SmartDeviceLink/Assets/SDLAssets.xcassets/lock_arrow_up_white.imageset/lock_arrow_up_white@2x.png deleted file mode 100644 index f45e6b299b03d074d3eed691de662b66d0e95ea7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 503 zcmVbZ z{LOPF%ZqdQmt0xx4*q9{jCLYp{LdH@#mAZGktw>}N(?<>Y!%r~U@1r#fVf< z?M7l45o4o>b{s<(HN-gUaUy0UT5Z=6#f&KHth8SGF{>Z1`8Wvw_QpYk-{w1)4FI!w02zok8dHv zt^c))2q8m=MgMA@v>;0h&cDakkm=gr+WCZ#Da8CgwGJAQtr5rX@g-Ea^lLkZ04fBS z^J8nL4pr)~e~-_h(z&ngEc~eCXV%BoMm4HcW79YVsCP7c& zH>pV~007L}0w%kIiS4N-)@HgrZng&ogTb2ugTY`h7!2;VFXtplayxAf3nUeOtl&Ld!%ntrh z)U`WRsqNAEfSK(*ERzD$9{TkOpD27c#Z$t=fbEpb66J`ODQxc^XdJXUC2Pc3%jp`w zv;WE;4~;sNt#^**%BY33@AS=Er2g=Q=JyG6~!)@++xakDe*#=@y@4qMl>%kFzDd$ZYMTjKQGBPaPx4*Q)=vAy>s`pp;J z{8Ld!HnHx`RSXMTBVASoyWQFn2^s#l@m%+j;lNsmGCcQo_yzlChH+4pUn>c0;Pnf zPRqABXzEkatNw($*zju1U;D1)O^<%*%RSao+kGnemw8&!u9?5oxgN8&eifH{XcSj4 z)BOwkvWKFVzes<2tol>+qk#CwN!>OoY7b2(*Ja(`$Hl6e!=@NsMWw9-O8Msn4r-M^;(aVUh*HjnG2F(U7e+?YTG z;Z$Y?l9O~NQ-Y11JPfyKX1Dp4V#;syb~1L7lbzh8B_v)G*qo$uI`&b@FFeB-9wJ#n1^?bonmG|W&+$2{ z4MUDt4ltI+q}Ezg9hk{w0N^GY=}2auVlU%D>?ET;Tk!4_J;)UJ*r~)pB=`89^vWyp z3Lol3(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ef^@ue+5i9m diff --git a/SmartDeviceLink/Assets/SDLAssets.xcassets/sdl_logo_white.imageset/sdl_logo_white@2x.png b/SmartDeviceLink/Assets/SDLAssets.xcassets/sdl_logo_white.imageset/sdl_logo_white@2x.png deleted file mode 100644 index b7d0bd92acb85761a951193af8caba9697372e16..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4931 zcmeHL`8O1d_qHTu3)$D+?0Z>5mWiy{$Cfo?4MUcZJrtElV^5Y)80!#W>@pa#Owv%8 z*FFrRiLuO#`S$)D-_QNwIrllwIrrT2oag>>U)Wlkva<-W(9zMco0}Qi)6vmG{`T)K zG5$q&*>Gk$ItHrkJ>cEHl=i>+p9B9d9Y~-175?7=MA=(A&;c5MMR2n}{6Qm?sLDZ! z!!8#YZ4lc}gn1vYlI!%;D^9-ou`+w04zi`ip6#A@STfvcqAW)SAHU1}V%w9l_QJhh zU*rAcgGJraTTnk6HTOGQ&)Q#!;`mb_e|b6&e7p8+#MKUdS0H&K zHTL-hXP9QCm(tt00A!3wP?ecmhIxDEJ>x$6SJ78P@_kD~b!+bTw!}FN85AD|K3dHA z)Md4Y0Zo<7e@t>5l(-W9?=^fI_MglJAB8a;T-sM5DLy8}^_d$igwyYAML-#zou`u8 z4T+*6hPS-S)qcNe?S?F&3;DOk6HEuJ!(>0aR1qA#$u;}rNc9dK9S6zW7yx`skDq6R zNYHW8&Ad>9hyHAzhs-YrHogsLUb237`>Vl7M&H#-cYQ9mJb2U~8mn`D|s z#WAvpslAb&>|{P#qCY~M>H4o6DiY4q*j#8`2>87Yq+guJ?+h}*rvHHCX>ivj#F@sHjD5; za4dOifzRGV?UF?4I_rBfst2f?EmKd$ZyQ5tv!Gjt#uOfNc);aAaRmb#iSg4Rj+&l? z{KTxh$r6ad^m3oVKR7D0#Jl6)-vT5P>&%|C+lLk$-tVO^JQJcI^9i17@$BYAamNZO z{LX6=Ua{rt5UL}+6C z+1aY`q&(a@{0EOeg0rB!Bz+>Zs4D$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8B{?9!l5qOio>RT{xko=DZ*^XzsuJ;`^vD2W+NGxWyj$%T_4x9dNMoC?@@?X( z^XD4B@;}LD2HLcFE5cN}_xTEKh@`LxO`Q-O3Zdr1zyIzl$>~j$J2&|HL*{GVd5{kD zkE-c0C>BOtq0wfJ#3anQb{#428RW*aj~UA}+tuX8D6u91Ne*E&Tx89nN&W3clg)-d zh|G`*&$go>FL`ReG!hyPPDx}aw=zdz2?-{6(U4CQ+) zvC^1nAWwg4*b!I%}GzIB#AxcL;ZNT(gISWN9W|Wpw1VoBqrr;&E)p9kQC>jq($ST z?av=-QDIq5DmW19qAi-*hze_}azeYc)Ky(Y=F;eLBTtn~WJ5D<^jNGNW2e9)8oXx9 zQ7&kj{)a1<%A;41^5W+pNM^k{{WpW@z-gHCR96aA88qEw8e+Dp>(E2c5349y=59&$ z5x3pYYyK@QWJfC{EionuXTm6}fjB6KQxL<`8hmd|EfH{)j7>bIBd=6^+i$I@W`?>ft$8y(I^4O zSR+KJz;}lM!pah8BD;?zFRG@Wb7b^o9qTRU%fQ&t0uEX17CQL`rz}q2WsgB-w3Zd) zKzS2p5m$lYpQZUP=@3(&3_pXWtci+VJ%~?z>% diff --git a/SmartDeviceLink/Assets/SDLAssets.xcassets/sdl_logo_white.imageset/sdl_logo_white@3x.png b/SmartDeviceLink/Assets/SDLAssets.xcassets/sdl_logo_white.imageset/sdl_logo_white@3x.png deleted file mode 100644 index b8b9ef757dedd5470f7df26009140aade4d21dfa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7137 zcmeHMi91x$|DF(I3qxiI8T&F!BNCCp46=+hW!G3DOWDf442Ef}*;SUwPLw@liLsNh zMZm_CE&xzcRp}$_)H(4EUO0OaU%c1pVtv?q?SyX^t+^ z{_EM{_q^dkFB$JB1=t9*m-+V4)be4$!1x+JgG!29tV z7>@|qtKP1+UaP$4G$zMsXE|ELro4QVcJJB5Yycb7%04En#87dS2Vv}Ez`LcM<1H;_z_LdKie@ZOiZ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~Wd1hNDODwkwwGdQIF6t+d)wR($k$g1Hi%^vde3g)P|?nBjy_iO5x^cXno zQtkDr4we4Bn-spss6;p%6>O|u7(g{;-dvR^#4-m4f0&e^p+j>Hxl(m!&R?n{XecP* zc}7)}8+n<6!LQmHN4X!&A(a+K zRSJ7Ttw2Dl0yWJR1eB!gqCYk3QQavm#+5771#X}HL)q=!)X;;fyuT<@j4i1zZCO&a zm5-S&o^$YZnNV67R9c5iRqSI|d03rciAq13&@K1mLr^yuYDxuBI@8A@GI6U&bK~AQ zlkx+1E2<_fXm-KW4`?L7iw~)?i%=Bt4`sTW8FlnRgof_*o`)=yG7hZcvD5mQ-`4EQ zPiG^orb%_q$Z>E(k*?5(ypRaf5N=_z9zXp%-JAdw=mg? z49<_C(zU~X`kHFo70f77wx|@APSF+c%73*E@x&I)DD}|buE?27>YuYpLtEWxIy_c> z@I_k3w{c#=SusP>IRkcW_w~BK`B$M7_T~BWfi5s~cAvCfFwaJZ+hJzpwW3?mn=9c3 zw!IRl8zaH~dY+MX(Y@oLG`ddy!iz*5dEW!==P7U@3QGdjS*3hOio~LpKCZ(~iGur* zTQN`llupBT(d^ZA)hRB&h(|(QmuvHZw_1bW(&O649b9H^?mF=)wE~4GkZxuE-cDsd>VuI{Z!ERU)GFTm$$;*rrY;0(w@xy2kC*ENcssAYechDGArG`E3KQ&3h A=l}o! diff --git a/SmartDeviceLink/SDLLockScreenViewController.m b/SmartDeviceLink/SDLLockScreenViewController.m index 88bd4ff74..73659eaf6 100644 --- a/SmartDeviceLink/SDLLockScreenViewController.m +++ b/SmartDeviceLink/SDLLockScreenViewController.m @@ -40,7 +40,7 @@ - (BOOL)shouldAutorotate { } - (UIStatusBarStyle)preferredStatusBarStyle { - BOOL useWhiteIcon = [self.class shouldUseWhiteForegroundForBackgroundColor:self.backgroundColor]; + BOOL useWhiteIcon = [self.class sdl_shouldUseWhiteForegroundForBackgroundColor:self.backgroundColor]; return useWhiteIcon ? UIStatusBarStyleLightContent : UIStatusBarStyleDefault; } @@ -71,15 +71,18 @@ - (void)setBackgroundColor:(UIColor *_Nullable)backgroundColor { #pragma mark - Layout - (void)sdl_layoutViews { - BOOL useWhiteIcon = [self.class shouldUseWhiteForegroundForBackgroundColor:self.backgroundColor]; + UIColor *iconColor = [self.class sdl_accentColorBasedOnColor:self.backgroundColor]; - UIImage *sdlLogo = [self.class sdl_logoImageWithColor:useWhiteIcon]; - self.sdlIconImageView.image = sdlLogo; + self.sdlIconImageView.image = [self.class sdl_imageWithName:@"sdl_logo_black"]; + self.sdlIconImageView.tintColor = iconColor; - self.arrowUpImageView.image = [self.class sdl_arrowUpImageWithColor:useWhiteIcon]; - self.arrowDownImageView.image = [self.class sdl_arrowDownImageWithColor:useWhiteIcon]; - - self.lockedLabel.textColor = useWhiteIcon ? [UIColor whiteColor] : [UIColor blackColor]; + self.arrowUpImageView.image = [self.class sdl_imageWithName:@"lock_arrow_up_black"]; + self.arrowUpImageView.tintColor = iconColor; + + self.arrowDownImageView.image = [self.class sdl_imageWithName:@"lock_arrow_down_black"]; + self.arrowDownImageView.tintColor = iconColor; + + self.lockedLabel.textColor = iconColor; if (self.vehicleIcon != nil && self.appIcon != nil) { [self sdl_setVehicleAndAppIconsLayout]; @@ -106,7 +109,8 @@ - (void)sdl_setVehicleAndAppIconsLayout { self.primaryVehicleIconImageView.image = self.vehicleIcon; self.backupImageView.image = nil; - + self.backupImageView.tintColor = nil; + self.arrowUpImageView.alpha = 1.0; self.arrowDownImageView.alpha = 1.0; @@ -118,7 +122,8 @@ - (void)sdl_setAppIconOnlyLayout { self.primaryVehicleIconImageView.image = nil; self.backupImageView.image = self.appIcon; - + self.backupImageView.tintColor = nil; + self.arrowUpImageView.alpha = 0.0; self.arrowDownImageView.alpha = 0.0; @@ -130,7 +135,8 @@ - (void)sdl_setVehicleIconOnlyLayout { self.primaryVehicleIconImageView.image = nil; self.backupImageView.image = self.vehicleIcon; - + self.backupImageView.tintColor = nil; + self.arrowUpImageView.alpha = 0.0; self.arrowDownImageView.alpha = 0.0; @@ -142,6 +148,7 @@ - (void)sdl_setNoIconsLayout { self.primaryVehicleIconImageView.image = nil; self.backupImageView.image = self.sdlIconImageView.image; + self.backupImageView.tintColor = [self.class sdl_accentColorBasedOnColor:self.backgroundColor]; self.arrowUpImageView.alpha = 0.0; self.arrowDownImageView.alpha = 0.0; @@ -152,20 +159,12 @@ - (void)sdl_setNoIconsLayout { #pragma mark - Private Image -// TODO: (Joel F.)[2016-08-22] When moved to iOS 7+, use `imageWithRenderingMode:` -+ (UIImage *)sdl_logoImageWithColor:(BOOL)white { - return [self sdl_imageWithName:[NSString stringWithFormat:@"sdl_logo_%@", white ? @"white" : @"black"]]; -} - -+ (UIImage *)sdl_arrowUpImageWithColor:(BOOL)white { - return [self sdl_imageWithName:[NSString stringWithFormat:@"lock_arrow_up_%@", white ? @"white" : @"black"]]; -} - -+ (UIImage *)sdl_arrowDownImageWithColor:(BOOL)white { - return [self sdl_imageWithName:[NSString stringWithFormat:@"lock_arrow_down_%@", white ? @"white" : @"black"]]; ++ (UIColor *)sdl_accentColorBasedOnColor:(UIColor *)backgroundColor { + return [self sdl_shouldUseWhiteForegroundForBackgroundColor:backgroundColor] ? [UIColor whiteColor] : [UIColor blackColor]; } + (UIImage *)sdl_imageWithName:(NSString *)name { + UIImage* image = nil; if (SDL_SYSTEM_VERSION_LESS_THAN(@"8.0")) { NSString *bundlePath = [[NSBundle sdlBundle] bundlePath]; NSInteger deviceScale = [[UIScreen mainScreen] scale]; @@ -173,13 +172,15 @@ + (UIImage *)sdl_imageWithName:(NSString *)name { NSString *fileName = [NSString stringWithFormat:@"%@%li.png", name, (long)deviceScale]; NSString *fullPath = [NSString stringWithFormat:@"%@/%@", bundlePath, fileName]; NSData *imageData = [NSData dataWithContentsOfFile:fullPath]; - return [UIImage imageWithData:imageData]; + image = [UIImage imageWithData:imageData]; } else { - return [UIImage imageNamed:name inBundle:[NSBundle sdlBundle] compatibleWithTraitCollection:nil]; + image = [UIImage imageNamed:name inBundle:[NSBundle sdlBundle] compatibleWithTraitCollection:nil]; } + + return [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; } -+ (BOOL)shouldUseWhiteForegroundForBackgroundColor:(UIColor *)backgroundColor { ++ (BOOL)sdl_shouldUseWhiteForegroundForBackgroundColor:(UIColor *)backgroundColor { CGFloat red, green, blue; [backgroundColor getRed:&red green:&green blue:&blue alpha:nil]; diff --git a/SmartDeviceLink/iOS 7 Assets/lock_arrow_down/white/lock_arrow_down_white.png b/SmartDeviceLink/iOS 7 Assets/lock_arrow_down/white/lock_arrow_down_white.png deleted file mode 100644 index 07e620d05701a698e561d6bdc6ca691fbd272843..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 309 zcmV-50m}Y~P)D^^MJ|E%xVy`JQsEAVNPb)*JG(ncIp1r?Rf!nGWK0GbR*n!g zB%&;GXkg5chOF+ht6WT_A;oeMQ9+d<74C%DSGIo)>^Yfzbna{?a+O_Wra1eTC??T_ zvQwgl7&ckkWrv7rCR=bE6d$yXwphzA^UlTxuv z5X(x30&ekhOM%j(4L@!2#yTeJGNFijyxdbHGdl6oDSvE}&bES}m`9R5QmkO;C0Vb6 zV?UwlzQUlCXMQ|Ws&E+K$AH4)7=UBhpq$tDl*Q80B3TG8wd*v3wPTW0RK|Cecnk} zSa<{BGXYR-`@Zu|!otGB!otGB!otGB)mKhzj~se~2Ln5U01BgbZEp>+ZQCj&wr$%^ zC9!S0f%n#5?EIdYb9{~#(*XCTiA>Jn+Bq^M(VR3crD?8jn1xHT^aEL3#FdL==@(j2 zg9|mZ(w~@%3v=~1vbln7SIE}CXiF_N)zVh~$3kpcC@*Al9b2xGEpK$74jby|Ab%{y zhNTKZ4!1Dv7C8z=C+ab&o=ysfm6)_rVUf!nOu0j@!lNq+< z=r1$aNfbL}3dKAptmhQV90t)u7)=b4S?nQfjg=dm;CCnF3YEO)hxb&<9VYO@1i8f- o0M5uYs`3XE>wqUH||907*qoM6N<$g7+}m$^ZZW diff --git a/SmartDeviceLink/iOS 7 Assets/lock_arrow_down/white/lock_arrow_down_white@3x.png b/SmartDeviceLink/iOS 7 Assets/lock_arrow_down/white/lock_arrow_down_white@3x.png deleted file mode 100644 index b354c1a139d05d27354f9d70c24128423b1839db..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 729 zcmeAS@N?(olHy`uVBq!ia0vp^Q9yi#g9S)N&a1i3z`(S?)5S5Qg7MAmaK@tw0-@!dX;MnXLGAYRWmO8U9&sHI>UvU)5Xy0o%vRUY6>4PEzqSWBk?u5_#U-1_F7J zd9%XgeSi{^W;0Z~WWYf^6HrKHC+7zD7O+C>#JMy3O|`R2zb(+aF4>UyWp(cDZEufl z1CqJcl_EfL_qC5RD{mi@%KuY+_gGcO{Ew67S9%Clew?(&s++UoD9haA%741V|D00Z z)xlKZ$QawFIU}!Y-I3%!Z71s<8^-o3%~;d1uJ`4PtX)hGIsYASssGTzw3tOrYvF?# zy_sp+BJ-Z<`+O4j*ETtoFv*CE|FgkSo7V31pVGpA&Ti(C7d3EXb!~bb(Q#X>Xs*)X z&qp3EvzQnDWJS~LRT@$;$Aj){n(|siHcm;-{K)4?i`;qd1UPSeP!;xIi)hUH8y~nh zEi@a$MXX;vSYow_$$W#<@-@%cBAc&!9^vfVqxU*MUj54SsXHc?-pG|TKNYpdRjADC zk#1!Fu^THlzB$mFb3{*iXW+L7v6D7B8@>06i=O^$ld$pJNeWMa)y)*ROBjcJQhmNNg$<6I_ zP2bsg`-bzDZw0gO9Gw26qpe^6soXB%-gia9+c)=nynS4@vpfHTFsJ?f6SZH|g!ZN~ zy?dhY(CWloBj)>$)n)4TO}BjEZt?4+%AKQ$PL^k4jkq&8Ro9+5tk5K>B3#Jt&iO>+ z`w5>Eg$X=H;)i!kOEi-FUNlEr_IcdQUY!`t?lZ?V^h~|t4*Z?-WY6R~`uPgh&r_$D u8}Kz0eiD*sR&w