summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuller, Alexander (A.) <amulle19@ford.com>2017-03-08 08:47:19 -0800
committerMuller, Alexander (A.) <amulle19@ford.com>2017-03-08 08:47:19 -0800
commit71ed87f0bcf0b8b293fb8e0077feadcf724738f5 (patch)
treed850cf5a07f0398f75ee8d6919c00d731f3d63ea
parent4a457426c1eef2b54a3aac53b24fa363ac23d9c0 (diff)
parent7fc139d38bd72716950e3b771dcc33d289a8bfd5 (diff)
downloadsdl_ios-71ed87f0bcf0b8b293fb8e0077feadcf724738f5.tar.gz
Merge remote-tracking branch 'origin/develop' into feature/issue_569_hmi_status_delegate
* origin/develop: Update LICENSE Update to v4.5.5 Added additional error code for registration successful, but with a warning. Fixed typo in function declaration comment. Tiny style update Prevent infinite loops in send block while by checking ostream state. Added an additional method to compare both membership and kindof for notification and responses. Fixed issue with incorrectly setting state on manager disconnect. Fixed misspellings and formatting for templats Updated tests to correctly send out notifications Updated all classes to use new convenience methods. Added convenience methods for notification and response notification objects.
-rw-r--r--.github/ISSUE_TEMPLATE.md4
-rw-r--r--.github/PULL_REQUEST_TEMPLATE.md4
-rw-r--r--CHANGELOG.md8
-rw-r--r--LICENSE4
-rw-r--r--SmartDeviceLink-iOS.podspec2
-rw-r--r--SmartDeviceLink/Info.plist2
-rw-r--r--SmartDeviceLink/SDLError.h1
-rw-r--r--SmartDeviceLink/SDLError.m10
-rw-r--r--SmartDeviceLink/SDLErrorConstants.h4
-rw-r--r--SmartDeviceLink/SDLIAPTransport.m4
-rw-r--r--SmartDeviceLink/SDLLifecycleManager.m17
-rw-r--r--SmartDeviceLink/SDLLockScreenManager.m3
-rw-r--r--SmartDeviceLink/SDLPermissionManager.m12
-rw-r--r--SmartDeviceLink/SDLProxy.m2
-rw-r--r--SmartDeviceLink/SDLRPCNotificationNotification.h15
-rw-r--r--SmartDeviceLink/SDLRPCNotificationNotification.m10
-rw-r--r--SmartDeviceLink/SDLRPCResponseNotification.h14
-rw-r--r--SmartDeviceLink/SDLRPCResponseNotification.m13
-rw-r--r--SmartDeviceLink/SDLResponseDispatcher.m19
-rw-r--r--SmartDeviceLinkTests/DevAPISpecs/SDLPermissionsManagerSpec.m10
-rw-r--r--SmartDeviceLinkTests/DevAPISpecs/SDLResponseDispatcherSpec.m76
-rw-r--r--SmartDeviceLink_Example/Classes/ProxyManager.m2
-rw-r--r--SmartDeviceLink_Example/Info.plist2
23 files changed, 168 insertions, 70 deletions
diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md
index 9d11929f5..84c2de694 100644
--- a/.github/ISSUE_TEMPLATE.md
+++ b/.github/ISSUE_TEMPLATE.md
@@ -5,8 +5,8 @@
##### Reproduction Steps
1. [Step 1]
-1. [Step 2]
-1. [Step 3]
+2. [Step 2]
+3. [Step 3]
##### Expected Behavior
[Some expected behavior]
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index 2b3f22d93..9a41515c7 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -19,8 +19,8 @@ This PR makes **[no / minor / major]** API changes.
##### Breaking Changes
* [Breaking change info]
-##### Enchancements
-* [Enchancement info]
+##### Enhancements
+* [Enhancement info]
##### Bug Fixes
* [Bug Fix Info]
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 27a7b1eb9..1331800f4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,11 @@
+# 4.5.5 Release Notes
+### Bug Fixes
+* Added a check for if `SDLManager` is already started and prevent starting it again.
+* Prevent infinite loops in IAP transport.
+
+### Example App
+* Fixed incorrectly setting button state on disconnect.
+
# 4.5.4 Release Notes
### Bug Fixes
* Streaming video will not crash if data is unexpectedly NULL.
diff --git a/LICENSE b/LICENSE
index 7f7887c5d..255251f17 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2016 Ford Motor Company,
+Copyright (c) 2017 SmartDeviceLink Consortium, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -11,7 +11,7 @@ modification, are permitted provided that the following conditions are met:
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
-* Neither the name of Ford Motor Company nor the names of its
+* Neither the name of SmartDeviceLink Consortium, Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
diff --git a/SmartDeviceLink-iOS.podspec b/SmartDeviceLink-iOS.podspec
index da50057bf..29a0d032f 100644
--- a/SmartDeviceLink-iOS.podspec
+++ b/SmartDeviceLink-iOS.podspec
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "SmartDeviceLink-iOS"
-s.version = "4.5.4"
+s.version = "4.5.5"
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 38fffc19a..ca833e17c 100644
--- a/SmartDeviceLink/Info.plist
+++ b/SmartDeviceLink/Info.plist
@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
- <string>4.5.4</string>
+ <string>4.5.5</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
diff --git a/SmartDeviceLink/SDLError.h b/SmartDeviceLink/SDLError.h
index 71472f30a..09ec20ee8 100644
--- a/SmartDeviceLink/SDLError.h
+++ b/SmartDeviceLink/SDLError.h
@@ -30,6 +30,7 @@ extern SDLErrorDomain *const SDLErrorDomainFileManager;
+ (NSError *)sdl_lifecycle_unknownRemoteErrorWithDescription:(NSString *)description andReason:(NSString *)reason;
+ (NSError *)sdl_lifecycle_managersFailedToStart;
+ (NSError *)sdl_lifecycle_startedWithBadResult:(SDLResult)result info:(NSString *)info;
++ (NSError *)sdl_lifecycle_startedWithWarning:(SDLResult)result info:(NSString *)info;
+ (NSError *)sdl_lifecycle_failedWithBadResult:(SDLResult)result info:(NSString *)info;
#pragma mark SDLFileManager
diff --git a/SmartDeviceLink/SDLError.m b/SmartDeviceLink/SDLError.m
index 5afad3fac..511f91deb 100644
--- a/SmartDeviceLink/SDLError.m
+++ b/SmartDeviceLink/SDLError.m
@@ -81,6 +81,16 @@ SDLErrorDomain *const SDLErrorDomainFileManager = @"com.sdl.filemanager.error";
userInfo:userInfo];
}
++ (NSError *)sdl_lifecycle_startedWithWarning:(SDLResult)result info:(NSString *)info {
+ NSDictionary<NSString *, NSString *> *userInfo = @{
+ NSLocalizedDescriptionKey: NSLocalizedString(result, nil),
+ NSLocalizedFailureReasonErrorKey: NSLocalizedString(info, nil)
+ };
+ return [NSError errorWithDomain:SDLErrorDomainLifecycleManager
+ code:SDLManagerErrorRegistrationSuccessWithWarning
+ userInfo:userInfo];
+}
+
+ (NSError *)sdl_lifecycle_failedWithBadResult:(SDLResult)result info:(NSString *)info {
NSDictionary<NSString *, NSString *> *userInfo = @{
NSLocalizedDescriptionKey: NSLocalizedString(result, nil),
diff --git a/SmartDeviceLink/SDLErrorConstants.h b/SmartDeviceLink/SDLErrorConstants.h
index 24d1d58f7..c439d3fd6 100644
--- a/SmartDeviceLink/SDLErrorConstants.h
+++ b/SmartDeviceLink/SDLErrorConstants.h
@@ -36,6 +36,10 @@ typedef NS_ENUM(NSInteger, SDLManagerError) {
* Registering with the remote system failed.
*/
SDLManagerErrorRegistrationFailed = -6,
+ /**
+ * Registering with the remote system was successful, but had a warning.
+ */
+ SDLManagerErrorRegistrationSuccessWithWarning = -7
};
/**
diff --git a/SmartDeviceLink/SDLIAPTransport.m b/SmartDeviceLink/SDLIAPTransport.m
index e2a85bc78..043c8ab5a 100644
--- a/SmartDeviceLink/SDLIAPTransport.m
+++ b/SmartDeviceLink/SDLIAPTransport.m
@@ -272,8 +272,8 @@ int const streamOpenTimeoutSeconds = 2;
NSOutputStream *ostream = self.session.easession.outputStream;
NSMutableData *remainder = data.mutableCopy;
- while (remainder.length != 0) {
- if (ostream.streamStatus == NSStreamStatusOpen && ostream.hasSpaceAvailable) {
+ while (ostream.streamStatus == NSStreamStatusOpen && remainder.length != 0) {
+ if (ostream.hasSpaceAvailable){
NSInteger bytesWritten = [ostream write:remainder.bytes maxLength:remainder.length];
if (bytesWritten == -1) {
diff --git a/SmartDeviceLink/SDLLifecycleManager.m b/SmartDeviceLink/SDLLifecycleManager.m
index d20aad3d7..3eacc4ee3 100644
--- a/SmartDeviceLink/SDLLifecycleManager.m
+++ b/SmartDeviceLink/SDLLifecycleManager.m
@@ -288,7 +288,7 @@ SDLLifecycleState *const SDLLifecycleStateReady = @"Ready";
// If the resultCode isn't success, we got a warning. Errors were handled in `didEnterStateConnected`.
if (![registerResult isEqualToString:SDLResultSuccess]) {
- startError = [NSError sdl_lifecycle_startedWithBadResult:registerResult info:registerInfo];
+ startError = [NSError sdl_lifecycle_startedWithWarning:registerResult info:registerInfo];
}
// If we got to this point, we succeeded, send the error if there was a warning.
@@ -407,16 +407,7 @@ SDLLifecycleState *const SDLLifecycleStateReady = @"Ready";
return @(++self.lastCorrelationId);
}
-+ (BOOL)sdl_checkNotification:(NSNotification *)notification containsKindOfClass:(Class)class {
- NSAssert([notification.userInfo[SDLNotificationUserInfoObject] isKindOfClass:class], @"A notification was sent with an unanticipated object");
- if (![notification.userInfo[SDLNotificationUserInfoObject] isKindOfClass:class]) {
- return NO;
- }
-
- return YES;
-}
-
-+ (void)sdl_updateLoggingWithFlags : (SDLLogOutput)logFlags {
++ (void)sdl_updateLoggingWithFlags:(SDLLogOutput)logFlags {
if (logFlags == SDLLogOutputNone) {
[SDLDebugTool disable];
return;
@@ -449,7 +440,7 @@ SDLLifecycleState *const SDLLifecycleStateReady = @"Ready";
}
- (void)hmiStatusDidChange:(SDLRPCNotificationNotification *)notification {
- if (![self.class sdl_checkNotification:notification containsKindOfClass:[SDLOnHMIStatus class]]) {
+ if (![notification isNotificationMemberOfClass:[SDLOnHMIStatus class]]) {
return;
}
@@ -483,7 +474,7 @@ SDLLifecycleState *const SDLLifecycleStateReady = @"Ready";
}
- (void)remoteHardwareDidUnregister:(SDLRPCNotificationNotification *)notification {
- if (![self.class sdl_checkNotification:notification containsKindOfClass:[SDLOnAppInterfaceUnregistered class]]) {
+ if (![notification isNotificationMemberOfClass:[SDLOnAppInterfaceUnregistered class]]) {
return;
}
diff --git a/SmartDeviceLink/SDLLockScreenManager.m b/SmartDeviceLink/SDLLockScreenManager.m
index 74bb9010a..b582e5996 100644
--- a/SmartDeviceLink/SDLLockScreenManager.m
+++ b/SmartDeviceLink/SDLLockScreenManager.m
@@ -93,8 +93,7 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark - Notification Selectors
- (void)sdl_lockScreenStatusDidChange:(SDLRPCNotificationNotification *)notification {
- NSAssert([notification.notification isKindOfClass:[SDLOnLockScreenStatus class]], @"A notification was sent with an unanticipated object");
- if (![notification.notification isKindOfClass:[SDLOnLockScreenStatus class]]) {
+ if (![notification isNotificationMemberOfClass:[SDLOnLockScreenStatus class]]) {
return;
}
diff --git a/SmartDeviceLink/SDLPermissionManager.m b/SmartDeviceLink/SDLPermissionManager.m
index 622a5d029..b37ca5b5b 100644
--- a/SmartDeviceLink/SDLPermissionManager.m
+++ b/SmartDeviceLink/SDLPermissionManager.m
@@ -174,13 +174,12 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark - SDL Notification Observers
-- (void)sdl_permissionsDidChange:(NSNotification *)notification {
- NSAssert([notification.userInfo[SDLNotificationUserInfoObject] isKindOfClass:[SDLOnPermissionsChange class]], @"A notification was sent with an unanticipated object");
- if (![notification.userInfo[SDLNotificationUserInfoObject] isKindOfClass:[SDLOnPermissionsChange class]]) {
+- (void)sdl_permissionsDidChange:(SDLRPCNotificationNotification *)notification {
+ if (![notification isNotificationMemberOfClass:[SDLOnPermissionsChange class]]) {
return;
}
- SDLOnPermissionsChange *onPermissionChange = notification.userInfo[SDLNotificationUserInfoObject];
+ SDLOnPermissionsChange *onPermissionChange = notification.notification;
NSArray<SDLPermissionItem *> *newPermissionItems = [onPermissionChange.permissionItem copy];
NSArray<SDLPermissionFilter *> *currentFilters = [self.filters copy];
@@ -219,12 +218,11 @@ NS_ASSUME_NONNULL_BEGIN
}
- (void)sdl_hmiLevelDidChange:(SDLRPCNotificationNotification *)notification {
- NSAssert([notification.notification isKindOfClass:[SDLOnHMIStatus class]], @"A notification was sent with an unanticipated object");
- if (![notification.notification isKindOfClass:[SDLOnHMIStatus class]]) {
+ if (![notification isNotificationMemberOfClass:[SDLOnHMIStatus class]]) {
return;
}
- SDLOnHMIStatus *hmiStatus = notification.userInfo[SDLNotificationUserInfoObject];
+ SDLOnHMIStatus *hmiStatus = notification.notification;
SDLHMILevel oldHMILevel = [self.currentHMILevel copy];
self.currentHMILevel = hmiStatus.hmiLevel;
diff --git a/SmartDeviceLink/SDLProxy.m b/SmartDeviceLink/SDLProxy.m
index 6d5159c72..463b8bd71 100644
--- a/SmartDeviceLink/SDLProxy.m
+++ b/SmartDeviceLink/SDLProxy.m
@@ -47,7 +47,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 = @"4.5.4";
+NSString *const SDLProxyVersion = @"4.5.5";
const float startSessionTime = 10.0;
const float notifyProxyClosedDelay = 0.1;
const int POLICIES_CORRELATION_ID = 65535;
diff --git a/SmartDeviceLink/SDLRPCNotificationNotification.h b/SmartDeviceLink/SDLRPCNotificationNotification.h
index 6c548812a..6b0060a9d 100644
--- a/SmartDeviceLink/SDLRPCNotificationNotification.h
+++ b/SmartDeviceLink/SDLRPCNotificationNotification.h
@@ -19,6 +19,21 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)initWithName:(NSString *)name object:(nullable id)object rpcNotification:(__kindof SDLRPCNotification *)notification;
+/**
+ * Returns whether or not the containing notification is equal to a class, not including subclasses.
+ *
+ * @param aClass the class you are questioning
+ */
+- (BOOL)isNotificationMemberOfClass:(Class)aClass;
+
+/**
+ * Returns whether or not the containing notification is a kind of class, including subclasses.
+ *
+ * @param aClass the class you are questioning
+ */
+- (BOOL)isNotificationKindOfClass:(Class)aClass;
+
+
@end
NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLRPCNotificationNotification.m b/SmartDeviceLink/SDLRPCNotificationNotification.m
index 898580654..78645c695 100644
--- a/SmartDeviceLink/SDLRPCNotificationNotification.m
+++ b/SmartDeviceLink/SDLRPCNotificationNotification.m
@@ -31,6 +31,16 @@ NS_ASSUME_NONNULL_BEGIN
return _userInfo[SDLNotificationUserInfoObject];
}
+- (BOOL)isNotificationMemberOfClass:(Class)aClass {
+ NSAssert([self.notification isMemberOfClass:aClass], @"A notification was sent with an unanticipated object");
+ return [self.notification isMemberOfClass:aClass];
+}
+
+- (BOOL)isNotificationKindOfClass:(Class)aClass {
+ NSAssert([self.notification isKindOfClass:aClass], @"A notification was sent with an unanticipated object");
+ return [self.notification isKindOfClass:aClass];
+}
+
@end
NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLRPCResponseNotification.h b/SmartDeviceLink/SDLRPCResponseNotification.h
index 118d1f532..42647897e 100644
--- a/SmartDeviceLink/SDLRPCResponseNotification.h
+++ b/SmartDeviceLink/SDLRPCResponseNotification.h
@@ -19,6 +19,20 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)initWithName:(NSString *)name object:(nullable id)object rpcResponse:(__kindof SDLRPCResponse *)response;
+/**
+ * Returns whether or not the containing response is equal to a class, not including subclasses.
+ *
+ * @param aClass the class you are questioning
+ */
+- (BOOL)isResponseMemberOfClass:(Class)aClass;
+
+/**
+ * Returns whether or not the containing response is a kind of class, including subclasses.
+ *
+ * @param aClass the class you are questioning
+ */
+- (BOOL)isResponseKindOfClass:(Class)aClass;
+
@end
NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLRPCResponseNotification.m b/SmartDeviceLink/SDLRPCResponseNotification.m
index 6d4be548a..60e94cf8b 100644
--- a/SmartDeviceLink/SDLRPCResponseNotification.m
+++ b/SmartDeviceLink/SDLRPCResponseNotification.m
@@ -11,6 +11,7 @@
#import "SDLNotificationConstants.h"
#import "SDLRPCResponse.h"
+NS_ASSUME_NONNULL_BEGIN
@implementation SDLRPCResponseNotification
@@ -30,4 +31,16 @@
return _userInfo[SDLNotificationUserInfoObject];
}
+- (BOOL)isResponseMemberOfClass:(Class)aClass {
+ NSAssert([self.response isMemberOfClass:aClass], @"A notification was sent with an unanticipated object");
+ return [self.response isMemberOfClass:aClass];
+}
+
+- (BOOL)isResponseKindOfClass:(Class)aClass {
+ NSAssert([self.response isKindOfClass:aClass], @"A notification was sent with an unanticipated object");
+ return [self.response isKindOfClass:aClass];
+}
+
@end
+
+NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLResponseDispatcher.m b/SmartDeviceLink/SDLResponseDispatcher.m
index f6e07ea1e..09cfab31d 100644
--- a/SmartDeviceLink/SDLResponseDispatcher.m
+++ b/SmartDeviceLink/SDLResponseDispatcher.m
@@ -18,8 +18,10 @@
#import "SDLOnButtonEvent.h"
#import "SDLOnButtonPress.h"
#import "SDLOnCommand.h"
-#import "SDLRPCResponse.h"
#import "SDLResult.h"
+#import "SDLRPCResponse.h"
+#import "SDLRPCNotificationNotification.h"
+#import "SDLRPCResponseNotification.h"
#import "SDLScrollableMessage.h"
#import "SDLShow.h"
#import "SDLSoftButton.h"
@@ -130,13 +132,12 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark - Notification Handler
// Called by notifications
-- (void)sdl_runHandlersForResponse:(NSNotification *)notification {
- NSAssert([notification.userInfo[SDLNotificationUserInfoObject] isKindOfClass:[SDLRPCResponse class]], @"A notification was sent with an unanticipated object");
- if (![notification.userInfo[SDLNotificationUserInfoObject] isKindOfClass:[SDLRPCResponse class]]) {
+- (void)sdl_runHandlersForResponse:(SDLRPCResponseNotification *)notification {
+ if (![notification isResponseKindOfClass:[SDLRPCResponse class]]) {
return;
}
- __kindof SDLRPCResponse *response = notification.userInfo[SDLNotificationUserInfoObject];
+ __kindof SDLRPCResponse *response = notification.response;
NSError *error = nil;
if (![response.success boolValue]) {
@@ -173,8 +174,8 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark Command
-- (void)sdl_runHandlerForCommand:(NSNotification *)notification {
- SDLOnCommand *onCommandNotification = notification.userInfo[SDLNotificationUserInfoObject];
+- (void)sdl_runHandlerForCommand:(SDLRPCNotificationNotification *)notification {
+ SDLOnCommand *onCommandNotification = notification.notification;
SDLRPCNotificationHandler handler = nil;
handler = self.commandHandlerMap[onCommandNotification.cmdID];
@@ -185,8 +186,8 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark Button
-- (void)sdl_runHandlerForButton:(NSNotification *)notification {
- __kindof SDLRPCNotification *rpcNotification = notification.userInfo[SDLNotificationUserInfoObject];
+- (void)sdl_runHandlerForButton:(SDLRPCNotificationNotification *)notification {
+ __kindof SDLRPCNotification *rpcNotification = notification.notification;
SDLRPCNotificationHandler handler = nil;
SDLButtonName name = nil;
diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLPermissionsManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLPermissionsManagerSpec.m
index eeecebf6c..dbf5e940f 100644
--- a/SmartDeviceLinkTests/DevAPISpecs/SDLPermissionsManagerSpec.m
+++ b/SmartDeviceLinkTests/DevAPISpecs/SDLPermissionsManagerSpec.m
@@ -403,7 +403,7 @@ describe(@"SDLPermissionsManager", ^{
testPermissionChangeUpdate.permissionItem = [NSArray arrayWithObject:testPermissionUpdated];
// Send the permission update
- NSNotification *updatedNotification = [NSNotification notificationWithName:SDLDidChangePermissionsNotification object:nil userInfo:@{SDLNotificationUserInfoObject: testPermissionChangeUpdate}];
+ SDLRPCNotificationNotification *updatedNotification = [[SDLRPCNotificationNotification alloc] initWithName:SDLDidChangePermissionsNotification object:nil rpcNotification:testPermissionChangeUpdate];
[[NSNotificationCenter defaultCenter] postNotification:updatedNotification];
});
@@ -471,7 +471,7 @@ describe(@"SDLPermissionsManager", ^{
testPermissionChangeUpdate.permissionItem = [NSArray arrayWithObject:testPermissionUpdated];
// Send the permission update
- NSNotification *updatedNotification = [NSNotification notificationWithName:SDLDidChangePermissionsNotification object:nil userInfo:@{SDLNotificationUserInfoObject: testPermissionChangeUpdate}];
+ SDLRPCNotificationNotification *updatedNotification = [[SDLRPCNotificationNotification alloc] initWithName:SDLDidChangePermissionsNotification object:nil rpcNotification:testPermissionChangeUpdate];
[[NSNotificationCenter defaultCenter] postNotification:updatedNotification];
});
@@ -514,7 +514,7 @@ describe(@"SDLPermissionsManager", ^{
testPermissionChangeUpdate.permissionItem = [NSArray arrayWithObject:testPermissionUpdated];
// Send the permission update
- NSNotification *updatedNotification = [NSNotification notificationWithName:SDLDidChangePermissionsNotification object:nil userInfo:@{SDLNotificationUserInfoObject: testPermissionChangeUpdate}];
+ SDLRPCNotificationNotification *updatedNotification = [[SDLRPCNotificationNotification alloc] initWithName:SDLDidChangePermissionsNotification object:nil rpcNotification:testPermissionChangeUpdate];
[[NSNotificationCenter defaultCenter] postNotification:updatedNotification];
});
@@ -577,7 +577,7 @@ describe(@"SDLPermissionsManager", ^{
testPermissionChangeUpdate.permissionItem = [NSArray arrayWithObject:testPermissionUpdated];
// Send the permission update
- NSNotification *updatedNotification = [NSNotification notificationWithName:SDLDidChangePermissionsNotification object:nil userInfo:@{SDLNotificationUserInfoObject: testPermissionChangeUpdate}];
+ SDLRPCNotificationNotification *updatedNotification = [[SDLRPCNotificationNotification alloc] initWithName:SDLDidChangePermissionsNotification object:nil rpcNotification:testPermissionChangeUpdate];
[[NSNotificationCenter defaultCenter] postNotification:updatedNotification];
});
@@ -611,7 +611,7 @@ describe(@"SDLPermissionsManager", ^{
testPermissionChangeUpdate.permissionItem = [NSArray arrayWithObject:testPermissionUpdated];
// Send the permission update
- NSNotification *updatedNotification = [NSNotification notificationWithName:SDLDidChangePermissionsNotification object:nil userInfo:@{SDLNotificationUserInfoObject: testPermissionChangeUpdate}];
+ SDLRPCNotificationNotification *updatedNotification = [[SDLRPCNotificationNotification alloc] initWithName:SDLDidChangePermissionsNotification object:nil rpcNotification:testPermissionChangeUpdate];
[[NSNotificationCenter defaultCenter] postNotification:updatedNotification];
});
diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLResponseDispatcherSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLResponseDispatcherSpec.m
index 3d5d2ef76..ceb27c7d7 100644
--- a/SmartDeviceLinkTests/DevAPISpecs/SDLResponseDispatcherSpec.m
+++ b/SmartDeviceLinkTests/DevAPISpecs/SDLResponseDispatcherSpec.m
@@ -13,6 +13,8 @@
#import "SDLReadDID.h"
#import "SDLReadDIDResponse.h"
#import "SDLResponseDispatcher.h"
+#import "SDLRPCNotificationNotification.h"
+#import "SDLRPCResponseNotification.h"
#import "SDLScrollableMessage.h"
#import "SDLShow.h"
#import "SDLSoftButton.h"
@@ -98,7 +100,8 @@ describe(@"a response dispatcher", ^{
testResponse = [[SDLReadDIDResponse alloc] init];
testResponse.correlationID = testCorrelationId;
- [[NSNotificationCenter defaultCenter] postNotificationName:SDLDidReceiveReadDIDResponse object:nil userInfo:@{ SDLNotificationUserInfoObject: testResponse }];
+ SDLRPCResponseNotification *responseNotification = [[SDLRPCResponseNotification alloc] initWithName:SDLDidReceiveReadDIDResponse object:nil rpcResponse:testResponse];
+ [[NSNotificationCenter defaultCenter] postNotification:responseNotification];
});
it(@"should run the handler", ^{
@@ -150,8 +153,11 @@ describe(@"a response dispatcher", ^{
testButtonPress.customButtonID = testSoftButton1.softButtonID;
testButtonPress.buttonName = SDLButtonNameCustomButton;
- [[NSNotificationCenter defaultCenter] postNotificationName:SDLDidReceiveButtonEventNotification object:nil userInfo:@{ SDLNotificationUserInfoObject: testButtonEvent }];
- [[NSNotificationCenter defaultCenter] postNotificationName:SDLDidReceiveButtonPressNotification object:nil userInfo:@{ SDLNotificationUserInfoObject: testButtonPress }];
+ SDLRPCNotificationNotification *buttonEventNotification = [[SDLRPCNotificationNotification alloc] initWithName:SDLDidReceiveButtonEventNotification object:nil rpcNotification:testButtonEvent];
+ SDLRPCNotificationNotification *buttonPressNotification = [[SDLRPCNotificationNotification alloc] initWithName:SDLDidReceiveButtonPressNotification object:nil rpcNotification:testButtonPress];
+
+ [[NSNotificationCenter defaultCenter] postNotification:buttonEventNotification];
+ [[NSNotificationCenter defaultCenter] postNotification:buttonPressNotification];
});
it(@"should run the handler for each", ^{
@@ -167,8 +173,11 @@ describe(@"a response dispatcher", ^{
testButtonPress = [[SDLOnButtonPress alloc] init];
testButtonPress.buttonName = SDLButtonNameOk;
- [[NSNotificationCenter defaultCenter] postNotificationName:SDLDidReceiveButtonEventNotification object:nil userInfo:@{ SDLNotificationUserInfoObject: testButtonEvent }];
- [[NSNotificationCenter defaultCenter] postNotificationName:SDLDidReceiveButtonPressNotification object:nil userInfo:@{ SDLNotificationUserInfoObject: testButtonPress }];
+ SDLRPCNotificationNotification *buttonEventNotification = [[SDLRPCNotificationNotification alloc] initWithName:SDLDidReceiveButtonEventNotification object:nil rpcNotification:testButtonEvent];
+ SDLRPCNotificationNotification *buttonPressNotification = [[SDLRPCNotificationNotification alloc] initWithName:SDLDidReceiveButtonPressNotification object:nil rpcNotification:testButtonPress];
+
+ [[NSNotificationCenter defaultCenter] postNotification:buttonEventNotification];
+ [[NSNotificationCenter defaultCenter] postNotification:buttonPressNotification];
});
it(@"should not run the handler", ^{
@@ -261,7 +270,9 @@ describe(@"a response dispatcher", ^{
testOnCommand = [[SDLOnCommand alloc] init];
testOnCommand.cmdID = @(testCommandId);
- [[NSNotificationCenter defaultCenter] postNotificationName:SDLDidReceiveCommandNotification object:nil userInfo:@{ SDLNotificationUserInfoObject: testOnCommand }];
+ SDLRPCNotificationNotification *commandNotification = [[SDLRPCNotificationNotification alloc] initWithName:SDLDidReceiveCommandNotification object:nil rpcNotification:testOnCommand];
+
+ [[NSNotificationCenter defaultCenter] postNotification:commandNotification];
});
it(@"should run the handler for each", ^{
@@ -274,7 +285,9 @@ describe(@"a response dispatcher", ^{
testOnCommand = [[SDLOnCommand alloc] init];
testOnCommand.cmdID = @999;
- [[NSNotificationCenter defaultCenter] postNotificationName:SDLDidReceiveCommandNotification object:nil userInfo:@{ SDLNotificationUserInfoObject: testOnCommand }];
+ SDLRPCNotificationNotification *commandNotification = [[SDLRPCNotificationNotification alloc] initWithName:SDLDidReceiveCommandNotification object:nil rpcNotification:testOnCommand];
+
+ [[NSNotificationCenter defaultCenter] postNotification:commandNotification];
});
it(@"should not run the handler", ^{
@@ -303,7 +316,9 @@ describe(@"a response dispatcher", ^{
testDeleteResponse.correlationID = testDeleteCommandCorrelationId;
testDeleteResponse.success = @YES;
- [[NSNotificationCenter defaultCenter] postNotificationName:SDLDidReceiveDeleteCommandResponse object:nil userInfo:@{ SDLNotificationUserInfoObject: testDeleteResponse }];
+ SDLRPCResponseNotification *deleteCommandNotification = [[SDLRPCResponseNotification alloc] initWithName:SDLDidReceiveDeleteCommandResponse object:nil rpcResponse:testDeleteResponse];
+
+ [[NSNotificationCenter defaultCenter] postNotification:deleteCommandNotification];
});
it(@"should have removed all the handlers", ^{
@@ -378,8 +393,11 @@ describe(@"a response dispatcher", ^{
testButtonPress = [[SDLOnButtonPress alloc] init];
testButtonPress.buttonName = testButtonName;
- [[NSNotificationCenter defaultCenter] postNotificationName:SDLDidReceiveButtonEventNotification object:nil userInfo:@{ SDLNotificationUserInfoObject: testButtonEvent }];
- [[NSNotificationCenter defaultCenter] postNotificationName:SDLDidReceiveButtonPressNotification object:nil userInfo:@{ SDLNotificationUserInfoObject: testButtonPress }];
+ SDLRPCNotificationNotification *buttonEventNotification = [[SDLRPCNotificationNotification alloc] initWithName:SDLDidReceiveButtonEventNotification object:nil rpcNotification:testButtonEvent];
+ SDLRPCNotificationNotification *buttonPressNotification = [[SDLRPCNotificationNotification alloc] initWithName:SDLDidReceiveButtonPressNotification object:nil rpcNotification:testButtonPress];
+
+ [[NSNotificationCenter defaultCenter] postNotification:buttonEventNotification];
+ [[NSNotificationCenter defaultCenter] postNotification:buttonPressNotification];
});
it(@"should run the handler for each", ^{
@@ -395,8 +413,11 @@ describe(@"a response dispatcher", ^{
testButtonPress = [[SDLOnButtonPress alloc] init];
testButtonPress.buttonName = SDLButtonNamePreset0;
- [[NSNotificationCenter defaultCenter] postNotificationName:SDLDidReceiveButtonEventNotification object:nil userInfo:@{ SDLNotificationUserInfoObject: testButtonEvent }];
- [[NSNotificationCenter defaultCenter] postNotificationName:SDLDidReceiveButtonPressNotification object:nil userInfo:@{ SDLNotificationUserInfoObject: testButtonPress }];
+ SDLRPCNotificationNotification *buttonEventNotification = [[SDLRPCNotificationNotification alloc] initWithName:SDLDidReceiveButtonEventNotification object:nil rpcNotification:testButtonEvent];
+ SDLRPCNotificationNotification *buttonPressNotification = [[SDLRPCNotificationNotification alloc] initWithName:SDLDidReceiveButtonPressNotification object:nil rpcNotification:testButtonPress];
+
+ [[NSNotificationCenter defaultCenter] postNotification:buttonEventNotification];
+ [[NSNotificationCenter defaultCenter] postNotification:buttonPressNotification];
});
it(@"should not run the handler", ^{
@@ -425,7 +446,8 @@ describe(@"a response dispatcher", ^{
testUnsubscribeResponse.correlationID = testUnsubscribeCorrelationId;
testUnsubscribeResponse.success = @YES;
- [[NSNotificationCenter defaultCenter] postNotificationName:SDLDidReceiveUnsubscribeButtonResponse object:nil userInfo:@{ SDLNotificationUserInfoObject: testUnsubscribeResponse }];
+ SDLRPCResponseNotification *unsubscribeNotification = [[SDLRPCResponseNotification alloc] initWithName:SDLDidReceiveUnsubscribeButtonResponse object:nil rpcResponse:testUnsubscribeResponse];
+ [[NSNotificationCenter defaultCenter] postNotification:unsubscribeNotification];
});
it(@"should have removed all the handlers", ^{
@@ -490,8 +512,11 @@ describe(@"a response dispatcher", ^{
testButtonPress.buttonName = SDLButtonNameCustomButton;
testButtonPress.customButtonID = testSoftButton1.softButtonID;
- [[NSNotificationCenter defaultCenter] postNotificationName:SDLDidReceiveButtonEventNotification object:nil userInfo:@{ SDLNotificationUserInfoObject: testButtonEvent }];
- [[NSNotificationCenter defaultCenter] postNotificationName:SDLDidReceiveButtonPressNotification object:nil userInfo:@{ SDLNotificationUserInfoObject: testButtonPress }];
+ SDLRPCNotificationNotification *buttonEventNotification = [[SDLRPCNotificationNotification alloc] initWithName:SDLDidReceiveButtonEventNotification object:nil rpcNotification:testButtonEvent];
+ SDLRPCNotificationNotification *buttonPressNotification = [[SDLRPCNotificationNotification alloc] initWithName:SDLDidReceiveButtonPressNotification object:nil rpcNotification:testButtonPress];
+
+ [[NSNotificationCenter defaultCenter] postNotification:buttonEventNotification];
+ [[NSNotificationCenter defaultCenter] postNotification:buttonPressNotification];
});
it(@"should run the handler for each", ^{
@@ -506,9 +531,12 @@ describe(@"a response dispatcher", ^{
testButtonPress = [[SDLOnButtonPress alloc] init];
testButtonPress.buttonName = SDLButtonNameOk;
+
+ SDLRPCNotificationNotification *buttonEventNotification = [[SDLRPCNotificationNotification alloc] initWithName:SDLDidReceiveButtonEventNotification object:nil rpcNotification:testButtonEvent];
+ SDLRPCNotificationNotification *buttonPressNotification = [[SDLRPCNotificationNotification alloc] initWithName:SDLDidReceiveButtonPressNotification object:nil rpcNotification:testButtonPress];
- [[NSNotificationCenter defaultCenter] postNotificationName:SDLDidReceiveButtonEventNotification object:nil userInfo:@{ SDLNotificationUserInfoObject: testButtonEvent }];
- [[NSNotificationCenter defaultCenter] postNotificationName:SDLDidReceiveButtonPressNotification object:nil userInfo:@{ SDLNotificationUserInfoObject: testButtonPress }];
+ [[NSNotificationCenter defaultCenter] postNotification:buttonEventNotification];
+ [[NSNotificationCenter defaultCenter] postNotification:buttonPressNotification];
});
it(@"should not run the handler", ^{
@@ -595,8 +623,11 @@ describe(@"a response dispatcher", ^{
testButtonPress.buttonName = SDLButtonNameCustomButton;
testButtonPress.customButtonID = testSoftButton1.softButtonID;
- [[NSNotificationCenter defaultCenter] postNotificationName:SDLDidReceiveButtonEventNotification object:nil userInfo:@{ SDLNotificationUserInfoObject: testButtonEvent }];
- [[NSNotificationCenter defaultCenter] postNotificationName:SDLDidReceiveButtonPressNotification object:nil userInfo:@{ SDLNotificationUserInfoObject: testButtonPress }];
+ SDLRPCNotificationNotification *buttonEventNotification = [[SDLRPCNotificationNotification alloc] initWithName:SDLDidReceiveButtonEventNotification object:nil rpcNotification:testButtonEvent];
+ SDLRPCNotificationNotification *buttonPressNotification = [[SDLRPCNotificationNotification alloc] initWithName:SDLDidReceiveButtonPressNotification object:nil rpcNotification:testButtonPress];
+
+ [[NSNotificationCenter defaultCenter] postNotification:buttonEventNotification];
+ [[NSNotificationCenter defaultCenter] postNotification:buttonPressNotification];
});
it(@"should run the handler for each", ^{
@@ -612,8 +643,11 @@ describe(@"a response dispatcher", ^{
testButtonPress = [[SDLOnButtonPress alloc] init];
testButtonPress.buttonName = SDLButtonNameOk;
- [[NSNotificationCenter defaultCenter] postNotificationName:SDLDidReceiveButtonEventNotification object:nil userInfo:@{ SDLNotificationUserInfoObject: testButtonEvent }];
- [[NSNotificationCenter defaultCenter] postNotificationName:SDLDidReceiveButtonPressNotification object:nil userInfo:@{ SDLNotificationUserInfoObject: testButtonPress }];
+ SDLRPCNotificationNotification *buttonEventNotification = [[SDLRPCNotificationNotification alloc] initWithName:SDLDidReceiveButtonEventNotification object:nil rpcNotification:testButtonEvent];
+ SDLRPCNotificationNotification *buttonPressNotification = [[SDLRPCNotificationNotification alloc] initWithName:SDLDidReceiveButtonPressNotification object:nil rpcNotification:testButtonPress];
+
+ [[NSNotificationCenter defaultCenter] postNotification:buttonEventNotification];
+ [[NSNotificationCenter defaultCenter] postNotification:buttonPressNotification];
});
it(@"should not run the handler", ^{
diff --git a/SmartDeviceLink_Example/Classes/ProxyManager.m b/SmartDeviceLink_Example/Classes/ProxyManager.m
index d0fef72d1..5139da20e 100644
--- a/SmartDeviceLink_Example/Classes/ProxyManager.m
+++ b/SmartDeviceLink_Example/Classes/ProxyManager.m
@@ -357,7 +357,7 @@ NS_ASSUME_NONNULL_BEGIN
// Reset our state
self.firstTimeState = SDLHMIFirstStateNone;
self.initialShowState = SDLHMIInitialShowStateNone;
- _state = ProxyStateStopped;
+ [self sdlex_updateProxyState:ProxyStateStopped];
if (ShouldRestartOnDisconnect) {
[self startManager];
}
diff --git a/SmartDeviceLink_Example/Info.plist b/SmartDeviceLink_Example/Info.plist
index 6627f9498..9f4baef19 100644
--- a/SmartDeviceLink_Example/Info.plist
+++ b/SmartDeviceLink_Example/Info.plist
@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>4.5.4</string>
+ <string>4.5.5</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>