Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
joeljfischer committed May 8, 2019
2 parents 2e9ce57 + 5eb5cfd commit 90b48be
Show file tree
Hide file tree
Showing 11 changed files with 75 additions and 58 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion SmartDeviceLink-iOS.podspec
Original file line number Diff line number Diff line change
@@ -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" }
Expand Down
2 changes: 1 addition & 1 deletion SmartDeviceLink.podspec
Original file line number Diff line number Diff line change
@@ -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" }
Expand Down
2 changes: 1 addition & 1 deletion SmartDeviceLink/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions SmartDeviceLink/SDLError.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ extern SDLErrorDomain *const SDLErrorDomainRPCStore;
+ (NSException *)sdl_missingFilesException;
+ (NSException *)sdl_invalidSoftButtonStateException;
+ (NSException *)sdl_carWindowOrientationException;
+ (NSException *)sdl_invalidLockscreenSetupException;

@end

Expand Down
96 changes: 51 additions & 45 deletions SmartDeviceLink/SDLError.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@ @implementation NSError (SDLErrors)

+ (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];
}

+ (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
Expand All @@ -50,10 +50,10 @@ + (NSError *)sdl_lifecycle_notConnectedError {

+ (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
Expand All @@ -62,10 +62,10 @@ + (NSError *)sdl_lifecycle_notReadyError {

+ (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];
Expand All @@ -79,9 +79,9 @@ + (NSError *)sdl_lifecycle_managersFailedToStart {

+ (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];
Expand All @@ -99,9 +99,9 @@ + (NSError *)sdl_lifecycle_startedWithWarning:(SDLResult)result info:(NSString *

+ (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];
Expand All @@ -118,37 +118,37 @@ + (NSError *)sdl_lifecycle_multipleRequestsCancelled {

+ (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];
}

Expand Down Expand Up @@ -232,7 +232,7 @@ + (NSError *)sdl_choiceSetManager_failedToCreateMenuItems {
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];
}
Expand Down Expand Up @@ -293,16 +293,16 @@ @implementation NSException (SDLExceptions)

+ (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 {
Expand All @@ -322,6 +322,12 @@ + (NSException *)sdl_carWindowOrientationException {
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
2 changes: 1 addition & 1 deletion SmartDeviceLink/SDLProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
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;
Expand Down
15 changes: 9 additions & 6 deletions SmartDeviceLink/SDLScreenshotViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#import "SDLScreenshotViewController.h"

#import "SDLError.h"

@interface SDLScreenshotViewController ()

@property (nonatomic, strong) UIImageView *imageView;
Expand All @@ -30,18 +32,20 @@ - (instancetype)init {
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]];

Expand Down Expand Up @@ -69,12 +73,11 @@ - (void)layoutSubviews {
- (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
2 changes: 1 addition & 1 deletion SmartDeviceLinkSwift/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 90b48be

Please sign in to comment.