summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2019-05-08 15:23:22 -0400
committerJoel Fischer <joeljfischer@gmail.com>2019-05-08 15:23:22 -0400
commit90b48bec6c589957fd83b37b97a660532f9eda02 (patch)
tree3e8a770a2d18a551701558e48c738b24c44ffc4a
parent2e9ce575f0dd401833931b30ef1444812043d7e7 (diff)
parent5eb5cfd7f19e0514f3f0b472474205ee237b6142 (diff)
downloadsdl_ios-90b48bec6c589957fd83b37b97a660532f9eda02.tar.gz
Merge branch 'master' into develop
-rw-r--r--CHANGELOG.md7
-rw-r--r--Example Apps/Example ObjC/SmartDeviceLink-Example-ObjC-Info.plist2
-rw-r--r--Example Apps/Example Swift/SmartDeviceLink-Example-Swift-Info.plist2
-rw-r--r--SmartDeviceLink-iOS.podspec2
-rw-r--r--SmartDeviceLink.podspec2
-rw-r--r--SmartDeviceLink/Info.plist2
-rw-r--r--SmartDeviceLink/SDLError.h1
-rw-r--r--SmartDeviceLink/SDLError.m96
-rw-r--r--SmartDeviceLink/SDLProxy.m2
-rwxr-xr-xSmartDeviceLink/SDLScreenshotViewController.m15
-rw-r--r--SmartDeviceLinkSwift/Info.plist2
11 files changed, 75 insertions, 58 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 94da2d6b3..2eea5f8ae 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,10 @@
+# 6.2.2
+### Versions
+* Supports [SDL RPC Spec 5.1.0](https://github.com/smartdevicelink/rpc_spec/releases/tag/5.1.0) and [SDL Protocol Spec 5.2.0](https://github.com/smartdevicelink/protocol_spec/releases/tag/5.2.0).
+
+### Bug Fixes
+* Add an explicit exception if SDL is setup before the app's window. The app's window **must** be setup before SDL is started (https://www.github.com/smartdevicelink/sdl_ios/issues/1255).
+
# 6.2.1
### Versions
* Supports [SDL RPC Spec 5.1.0](https://github.com/smartdevicelink/rpc_spec/releases/tag/5.1.0) and [SDL Protocol Spec 5.2.0](https://github.com/smartdevicelink/protocol_spec/releases/tag/5.2.0).
diff --git a/Example Apps/Example ObjC/SmartDeviceLink-Example-ObjC-Info.plist b/Example Apps/Example ObjC/SmartDeviceLink-Example-ObjC-Info.plist
index 1be2c8c31..679d6a0d6 100644
--- a/Example Apps/Example ObjC/SmartDeviceLink-Example-ObjC-Info.plist
+++ b/Example Apps/Example ObjC/SmartDeviceLink-Example-ObjC-Info.plist
@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>6.2.1</string>
+ <string>6.2.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
diff --git a/Example Apps/Example Swift/SmartDeviceLink-Example-Swift-Info.plist b/Example Apps/Example Swift/SmartDeviceLink-Example-Swift-Info.plist
index 232b8510e..26ce06280 100644
--- a/Example Apps/Example Swift/SmartDeviceLink-Example-Swift-Info.plist
+++ b/Example Apps/Example Swift/SmartDeviceLink-Example-Swift-Info.plist
@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>6.2.1</string>
+ <string>6.2.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
diff --git a/SmartDeviceLink-iOS.podspec b/SmartDeviceLink-iOS.podspec
index ef92a59bb..b50a2a2af 100644
--- a/SmartDeviceLink-iOS.podspec
+++ b/SmartDeviceLink-iOS.podspec
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "SmartDeviceLink-iOS"
-s.version = "6.2.1"
+s.version = "6.2.2"
s.summary = "Connect your app with cars!"
s.homepage = "https://github.com/smartdevicelink/SmartDeviceLink-iOS"
s.license = { :type => "New BSD", :file => "LICENSE" }
diff --git a/SmartDeviceLink.podspec b/SmartDeviceLink.podspec
index 704748080..81c70a04e 100644
--- a/SmartDeviceLink.podspec
+++ b/SmartDeviceLink.podspec
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "SmartDeviceLink"
-s.version = "6.2.1"
+s.version = "6.2.2"
s.summary = "Connect your app with cars!"
s.homepage = "https://github.com/smartdevicelink/SmartDeviceLink-iOS"
s.license = { :type => "New BSD", :file => "LICENSE" }
diff --git a/SmartDeviceLink/Info.plist b/SmartDeviceLink/Info.plist
index 31ef9c083..a34ebbf0b 100644
--- a/SmartDeviceLink/Info.plist
+++ b/SmartDeviceLink/Info.plist
@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
- <string>6.2.1</string>
+ <string>6.2.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
diff --git a/SmartDeviceLink/SDLError.h b/SmartDeviceLink/SDLError.h
index cdc2bab41..9c6209c5b 100644
--- a/SmartDeviceLink/SDLError.h
+++ b/SmartDeviceLink/SDLError.h
@@ -89,6 +89,7 @@ extern SDLErrorDomain *const SDLErrorDomainRPCStore;
+ (NSException *)sdl_missingFilesException;
+ (NSException *)sdl_invalidSoftButtonStateException;
+ (NSException *)sdl_carWindowOrientationException;
++ (NSException *)sdl_invalidLockscreenSetupException;
@end
diff --git a/SmartDeviceLink/SDLError.m b/SmartDeviceLink/SDLError.m
index 187940201..7e5a0e95b 100644
--- a/SmartDeviceLink/SDLError.m
+++ b/SmartDeviceLink/SDLError.m
@@ -27,10 +27,10 @@ SDLErrorDomain *const SDLErrorDomainRPCStore = @"com.sdl.rpcStore.error";
+ (NSError *)sdl_lifecycle_rpcErrorWithDescription:(NSString *)description andReason:(NSString *)reason {
NSDictionary<NSString *, NSString *> *userInfo = @{
- NSLocalizedDescriptionKey: NSLocalizedString(description, nil),
- NSLocalizedFailureReasonErrorKey: NSLocalizedString(reason, nil),
- NSLocalizedRecoverySuggestionErrorKey: NSLocalizedString(@"Have you tried turning it off and on again?", nil)
- };
+ NSLocalizedDescriptionKey: NSLocalizedString(description, nil),
+ NSLocalizedFailureReasonErrorKey: NSLocalizedString(reason, nil),
+ NSLocalizedRecoverySuggestionErrorKey: NSLocalizedString(@"Have you tried turning it off and on again?", nil)
+ };
return [NSError errorWithDomain:SDLErrorDomainLifecycleManager
code:SDLManagerErrorRPCRequestFailed
userInfo:userInfo];
@@ -38,10 +38,10 @@ SDLErrorDomain *const SDLErrorDomainRPCStore = @"com.sdl.rpcStore.error";
+ (NSError *)sdl_lifecycle_notConnectedError {
NSDictionary<NSString *, NSString *> *userInfo = @{
- NSLocalizedDescriptionKey: NSLocalizedString(@"Could not find a connection", nil),
- NSLocalizedFailureReasonErrorKey: NSLocalizedString(@"The SDL library could not find a current connection to an SDL hardware device", nil),
- NSLocalizedRecoverySuggestionErrorKey: NSLocalizedString(@"Have you tried turning it off and on again?", nil)
- };
+ NSLocalizedDescriptionKey: NSLocalizedString(@"Could not find a connection", nil),
+ NSLocalizedFailureReasonErrorKey: NSLocalizedString(@"The SDL library could not find a current connection to an SDL hardware device", nil),
+ NSLocalizedRecoverySuggestionErrorKey: NSLocalizedString(@"Have you tried turning it off and on again?", nil)
+ };
return [NSError errorWithDomain:SDLErrorDomainLifecycleManager
code:SDLManagerErrorNotConnected
@@ -50,10 +50,10 @@ SDLErrorDomain *const SDLErrorDomainRPCStore = @"com.sdl.rpcStore.error";
+ (NSError *)sdl_lifecycle_notReadyError {
NSDictionary<NSString *, NSString *> *userInfo = @{
- NSLocalizedDescriptionKey: NSLocalizedString(@"Lifecycle manager not ready", nil),
- NSLocalizedFailureReasonErrorKey: NSLocalizedString(@"The SDL library is not finished setting up the connection, please wait until the lifecycleState is SDLLifecycleStateReady", nil),
- NSLocalizedRecoverySuggestionErrorKey: NSLocalizedString(@"Have you tried turning it off and on again?", nil)
- };
+ NSLocalizedDescriptionKey: NSLocalizedString(@"Lifecycle manager not ready", nil),
+ NSLocalizedFailureReasonErrorKey: NSLocalizedString(@"The SDL library is not finished setting up the connection, please wait until the lifecycleState is SDLLifecycleStateReady", nil),
+ NSLocalizedRecoverySuggestionErrorKey: NSLocalizedString(@"Have you tried turning it off and on again?", nil)
+ };
return [NSError errorWithDomain:SDLErrorDomainLifecycleManager
code:SDLManagerErrorNotConnected
@@ -62,10 +62,10 @@ SDLErrorDomain *const SDLErrorDomainRPCStore = @"com.sdl.rpcStore.error";
+ (NSError *)sdl_lifecycle_unknownRemoteErrorWithDescription:(NSString *)description andReason:(NSString *)reason {
NSDictionary<NSString *, NSString *> *userInfo = @{
- NSLocalizedDescriptionKey: NSLocalizedString(description, nil),
- NSLocalizedFailureReasonErrorKey: NSLocalizedString(reason, nil),
- NSLocalizedRecoverySuggestionErrorKey: NSLocalizedString(@"Have you tried turning it off and on again?", nil)
- };
+ NSLocalizedDescriptionKey: NSLocalizedString(description, nil),
+ NSLocalizedFailureReasonErrorKey: NSLocalizedString(reason, nil),
+ NSLocalizedRecoverySuggestionErrorKey: NSLocalizedString(@"Have you tried turning it off and on again?", nil)
+ };
return [NSError errorWithDomain:SDLErrorDomainLifecycleManager
code:SDLManagerErrorUnknownRemoteError
userInfo:userInfo];
@@ -79,9 +79,9 @@ SDLErrorDomain *const SDLErrorDomainRPCStore = @"com.sdl.rpcStore.error";
+ (NSError *)sdl_lifecycle_startedWithBadResult:(SDLResult)result info:(NSString *)info {
NSDictionary<NSString *, NSString *> *userInfo = @{
- NSLocalizedDescriptionKey: NSLocalizedString(result, nil),
- NSLocalizedFailureReasonErrorKey: NSLocalizedString(info, nil)
- };
+ NSLocalizedDescriptionKey: NSLocalizedString(result, nil),
+ NSLocalizedFailureReasonErrorKey: NSLocalizedString(info, nil)
+ };
return [NSError errorWithDomain:SDLErrorDomainLifecycleManager
code:SDLManagerErrorRegistrationFailed
userInfo:userInfo];
@@ -99,9 +99,9 @@ SDLErrorDomain *const SDLErrorDomainRPCStore = @"com.sdl.rpcStore.error";
+ (NSError *)sdl_lifecycle_failedWithBadResult:(SDLResult)result info:(NSString *)info {
NSDictionary<NSString *, NSString *> *userInfo = @{
- NSLocalizedDescriptionKey: NSLocalizedString(result, nil),
- NSLocalizedFailureReasonErrorKey: NSLocalizedString(info, nil)
- };
+ NSLocalizedDescriptionKey: NSLocalizedString(result, nil),
+ NSLocalizedFailureReasonErrorKey: NSLocalizedString(info, nil)
+ };
return [NSError errorWithDomain:SDLErrorDomainLifecycleManager
code:SDLManagerErrorRegistrationFailed
userInfo:userInfo];
@@ -118,37 +118,37 @@ SDLErrorDomain *const SDLErrorDomainRPCStore = @"com.sdl.rpcStore.error";
+ (NSError *)sdl_fileManager_cannotOverwriteError {
NSDictionary<NSString *, NSString *> *userInfo = @{
- NSLocalizedDescriptionKey: NSLocalizedString(@"Cannot overwrite remote file", nil),
- NSLocalizedFailureReasonErrorKey: NSLocalizedString(@"The remote file system already has a file of this name, and the file manager is set to not automatically overwrite files", nil),
- NSLocalizedRecoverySuggestionErrorKey: NSLocalizedString(@"Set SDLFileManager autoOverwrite to YES, or call forceUploadFile:completion:", nil)
- };
+ NSLocalizedDescriptionKey: NSLocalizedString(@"Cannot overwrite remote file", nil),
+ NSLocalizedFailureReasonErrorKey: NSLocalizedString(@"The remote file system already has a file of this name, and the file manager is set to not automatically overwrite files", nil),
+ NSLocalizedRecoverySuggestionErrorKey: NSLocalizedString(@"Set SDLFileManager autoOverwrite to YES, or call forceUploadFile:completion:", nil)
+ };
return [NSError errorWithDomain:SDLErrorDomainFileManager code:SDLFileManagerErrorCannotOverwrite userInfo:userInfo];
}
+ (NSError *)sdl_fileManager_noKnownFileError {
NSDictionary<NSString *, NSString *> *userInfo = @{
- NSLocalizedDescriptionKey: NSLocalizedString(@"No such remote file is currently known", nil),
- NSLocalizedFailureReasonErrorKey: NSLocalizedString(@"The remote file is not currently known by the file manager. It could be that this file does not exist on the remote system or that the file manager has not completed its initialization and received a list of files from the remote system.", nil),
- NSLocalizedRecoverySuggestionErrorKey: NSLocalizedString(@"Make sure a file with this name is present on the remote system and that the file manager has finished its initialization.", nil)
- };
+ NSLocalizedDescriptionKey: NSLocalizedString(@"No such remote file is currently known", nil),
+ NSLocalizedFailureReasonErrorKey: NSLocalizedString(@"The remote file is not currently known by the file manager. It could be that this file does not exist on the remote system or that the file manager has not completed its initialization and received a list of files from the remote system.", nil),
+ NSLocalizedRecoverySuggestionErrorKey: NSLocalizedString(@"Make sure a file with this name is present on the remote system and that the file manager has finished its initialization.", nil)
+ };
return [NSError errorWithDomain:SDLErrorDomainFileManager code:SDLFileManagerErrorNoKnownFile userInfo:userInfo];
}
+ (NSError *)sdl_fileManager_unableToStartError {
NSDictionary<NSString *, NSString *> *userInfo = @{
- NSLocalizedDescriptionKey: NSLocalizedString(@"The file manager was unable to start", nil),
- NSLocalizedFailureReasonErrorKey: NSLocalizedString(@"This may be because files are not supported on this unit and / or LISTFILES returned an error", nil),
- NSLocalizedRecoverySuggestionErrorKey: NSLocalizedString(@"Make sure that the system is sending back a proper LIST FILES response", nil)
- };
+ NSLocalizedDescriptionKey: NSLocalizedString(@"The file manager was unable to start", nil),
+ NSLocalizedFailureReasonErrorKey: NSLocalizedString(@"This may be because files are not supported on this unit and / or LISTFILES returned an error", nil),
+ NSLocalizedRecoverySuggestionErrorKey: NSLocalizedString(@"Make sure that the system is sending back a proper LIST FILES response", nil)
+ };
return [NSError errorWithDomain:SDLErrorDomainFileManager code:SDLFileManagerErrorUnableToStart userInfo:userInfo];
}
+ (NSError *)sdl_fileManager_unableToUploadError {
NSDictionary<NSString *, NSString *> *userInfo = @{
- NSLocalizedDescriptionKey: NSLocalizedString(@"The file manager was unable to send this file", nil),
- NSLocalizedFailureReasonErrorKey: NSLocalizedString(@"This could be because the file manager has not started, or the head unit does not support files", nil),
- NSLocalizedRecoverySuggestionErrorKey: NSLocalizedString(@"Make sure that the system is sending back a proper LIST FILES response and check the file manager's state", nil)
- };
+ NSLocalizedDescriptionKey: NSLocalizedString(@"The file manager was unable to send this file", nil),
+ NSLocalizedFailureReasonErrorKey: NSLocalizedString(@"This could be because the file manager has not started, or the head unit does not support files", nil),
+ NSLocalizedRecoverySuggestionErrorKey: NSLocalizedString(@"Make sure that the system is sending back a proper LIST FILES response and check the file manager's state", nil)
+ };
return [NSError errorWithDomain:SDLErrorDomainFileManager code:SDLFileManagerErrorUnableToUpload userInfo:userInfo];
}
@@ -232,7 +232,7 @@ SDLErrorDomain *const SDLErrorDomainRPCStore = @"com.sdl.rpcStore.error";
NSDictionary<NSString *, NSString *> *userInfo = @{
NSLocalizedDescriptionKey: NSLocalizedString(@"Choice Set Manager error", nil),
NSLocalizedFailureReasonErrorKey: NSLocalizedString(@"Choice set manager failed to create menu items due to menuName being empty.", nil),
- NSLocalizedRecoverySuggestionErrorKey: NSLocalizedString(@"If you are setting the menuName, it is possible that the head unit is sending incorrect displayCapabilities.", nil)
+ NSLocalizedRecoverySuggestionErrorKey: NSLocalizedString(@"If you are setting the menuName, it is possible that the head unit is sending incorrect displayCapabilities.", nil)
};
return [NSError errorWithDomain:SDLErrorDomainChoiceSetManager code:SDLChoiceSetManagerErrorFailedToCreateMenuItems userInfo:userInfo];
}
@@ -293,16 +293,16 @@ SDLErrorDomain *const SDLErrorDomainRPCStore = @"com.sdl.rpcStore.error";
+ (NSException *)sdl_missingHandlerException {
return [NSException
- exceptionWithName:@"MissingHandlerException"
- reason:@"This request requires a handler to be specified using the <RPC>WithHandler class"
- userInfo:nil];
+ exceptionWithName:@"MissingHandlerException"
+ reason:@"This request requires a handler to be specified using the <RPC>WithHandler class"
+ userInfo:nil];
}
+ (NSException *)sdl_missingIdException {
return [NSException
- exceptionWithName:@"MissingIdException"
- reason:@"This request requires an ID (command, softbutton, etc) to be specified"
- userInfo:nil];
+ exceptionWithName:@"MissingIdException"
+ reason:@"This request requires an ID (command, softbutton, etc) to be specified"
+ userInfo:nil];
}
+ (NSException *)sdl_missingFilesException {
@@ -322,6 +322,12 @@ SDLErrorDomain *const SDLErrorDomainRPCStore = @"com.sdl.rpcStore.error";
userInfo:nil];
}
++ (NSException *)sdl_invalidLockscreenSetupException {
+ return [NSException exceptionWithName:@"com.sdl.lockscreen.setupException"
+ reason:@"SDL must be setup _after_ your app's window already exists"
+ userInfo:nil];
+}
+
@end
NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLProxy.m b/SmartDeviceLink/SDLProxy.m
index c302a63a8..bfc01bc8a 100644
--- a/SmartDeviceLink/SDLProxy.m
+++ b/SmartDeviceLink/SDLProxy.m
@@ -51,7 +51,7 @@ typedef NSString SDLVehicleMake;
typedef void (^URLSessionTaskCompletionHandler)(NSData *data, NSURLResponse *response, NSError *error);
typedef void (^URLSessionDownloadTaskCompletionHandler)(NSURL *location, NSURLResponse *response, NSError *error);
-NSString *const SDLProxyVersion = @"6.2.1";
+NSString *const SDLProxyVersion = @"6.2.2";
const float StartSessionTime = 10.0;
const float NotifyProxyClosedDelay = (float)0.1;
const int PoliciesCorrelationId = 65535;
diff --git a/SmartDeviceLink/SDLScreenshotViewController.m b/SmartDeviceLink/SDLScreenshotViewController.m
index e0e965f7a..8a817e51d 100755
--- a/SmartDeviceLink/SDLScreenshotViewController.m
+++ b/SmartDeviceLink/SDLScreenshotViewController.m
@@ -8,6 +8,8 @@
#import "SDLScreenshotViewController.h"
+#import "SDLError.h"
+
@interface SDLScreenshotViewController ()
@property (nonatomic, strong) UIImageView *imageView;
@@ -30,18 +32,20 @@
return self;
}
-// HAX: https://github.com/smartdevicelink/sdl_ios/issues/1250
+ // HAX: https://github.com/smartdevicelink/sdl_ios/issues/1250
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
UIViewController *viewController = [self sdl_topMostControllerForWindow:[UIApplication sharedApplication].windows[0]];
- if (viewController != nil) {
+ if (viewController == self) {
+ @throw [NSException sdl_invalidLockscreenSetupException];
+ } else if (viewController != nil) {
return viewController.supportedInterfaceOrientations;
}
- return super.supportedInterfaceOrientations;
+ return UIInterfaceOrientationMaskAll;
}
-// HAX: https://github.com/smartdevicelink/sdl_ios/issues/1250
+ // HAX: https://github.com/smartdevicelink/sdl_ios/issues/1250
- (BOOL)shouldAutorotate {
UIViewController *viewController = [self sdl_topMostControllerForWindow:[UIApplication sharedApplication].windows[0]];
@@ -69,12 +73,11 @@
- (void)loadScreenshotOfWindow:(UIWindow *)window {
UIGraphicsBeginImageContextWithOptions(window.bounds.size, YES, 0.0f);
[window drawViewHierarchyInRect:window.bounds afterScreenUpdates:NO];
-
+
UIImage* image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
self.imageView.image = image;
}
-
@end
diff --git a/SmartDeviceLinkSwift/Info.plist b/SmartDeviceLinkSwift/Info.plist
index a284e7697..0d234b4fc 100644
--- a/SmartDeviceLinkSwift/Info.plist
+++ b/SmartDeviceLinkSwift/Info.plist
@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
- <string>6.2.1</string>
+ <string>6.2.2</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>