summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuller, Alexander (A.) <amulle19@ford.com>2017-03-01 12:32:56 -0800
committerMuller, Alexander (A.) <amulle19@ford.com>2017-03-01 12:32:56 -0800
commit8f92e6194a538004da32011155cc8c9c6faedcce (patch)
tree89fa8484c7b9ba737508c4d90f4a1206135ea635
parent61e6f87b536bc33b944f42be7bad6786c0bab4d1 (diff)
parent1109f73e492a593c1d1c53ed6d19999c5e5f16f3 (diff)
downloadsdl_ios-hotfix/issue_538.tar.gz
Merge remote-tracking branch 'origin/master' into hotfix/issue_538hotfix/issue_538
* origin/master: Update to v4.5.4 Improved state machine throw. Also added in more specific spec to handle this. Added in more descriptive exception throw for debugging. Fixes #539 Xcode 8.3 beta 2 fixes Adding in check for nullable properties of video encoder callback
-rw-r--r--CHANGELOG.md8
-rw-r--r--SmartDeviceLink-iOS.podspec2
-rw-r--r--SmartDeviceLink/Info.plist2
-rw-r--r--SmartDeviceLink/SDLConsoleController.m2
-rw-r--r--SmartDeviceLink/SDLFileManager.m2
-rw-r--r--SmartDeviceLink/SDLLockScreenStatusManager.m11
-rw-r--r--SmartDeviceLink/SDLPerformInteraction.m2
-rw-r--r--SmartDeviceLink/SDLPermissionManager.m4
-rw-r--r--SmartDeviceLink/SDLProxy.m2
-rw-r--r--SmartDeviceLink/SDLRegisterAppInterfaceResponse.m2
-rw-r--r--SmartDeviceLink/SDLSetGlobalProperties.m2
-rw-r--r--SmartDeviceLink/SDLStateMachine.m6
-rw-r--r--SmartDeviceLink/SDLStreamingMediaManager.m6
-rw-r--r--SmartDeviceLink/SDLVrCapabilities.m2
-rw-r--r--SmartDeviceLink/SDLVrHelpItem.m2
-rw-r--r--SmartDeviceLinkTests/DevAPISpecs/SDLStateMachineSpec.m9
-rw-r--r--SmartDeviceLinkTests/ProxySpecs/SDLLockScreenStatusManagerSpec.m28
-rw-r--r--SmartDeviceLink_Example/Info.plist2
18 files changed, 71 insertions, 23 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b18a45934..27a7b1eb9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,11 @@
+# 4.5.4 Release Notes
+### Bug Fixes
+* Streaming video will not crash if data is unexpectedly NULL.
+* SDL now compiles on Xcode 8.3.
+* Lockscreen will now appear appropriately when it's remote HMI is in the background.
+* Internal state machines now throw more descriptive exceptions.
+
+
# 4.5.3 Release Notes
### Bug Fixes
* `SDLManager`'s `delegate` method `hmiLevel:didChangeToLevel:` now only triggers when the HMI level changes, instead of whenever an `onHMIStatus` is received.
diff --git a/SmartDeviceLink-iOS.podspec b/SmartDeviceLink-iOS.podspec
index 23cc8bac9..3d9e0d0d4 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.3"
+s.version = "4.5.4"
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 d5d82ded6..4d3548d19 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.3</string>
+ <string>4.5.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
diff --git a/SmartDeviceLink/SDLConsoleController.m b/SmartDeviceLink/SDLConsoleController.m
index ade1c17df..fcbcd78a7 100644
--- a/SmartDeviceLink/SDLConsoleController.m
+++ b/SmartDeviceLink/SDLConsoleController.m
@@ -3,7 +3,7 @@
#import "SDLConsoleController.h"
-#import "SDLJSONEncoder.h"
+#import "SDLJsonEncoder.h"
#import "SDLRPCResponse.h"
diff --git a/SmartDeviceLink/SDLFileManager.m b/SmartDeviceLink/SDLFileManager.m
index 86507224b..0321691ac 100644
--- a/SmartDeviceLink/SDLFileManager.m
+++ b/SmartDeviceLink/SDLFileManager.m
@@ -40,7 +40,7 @@ SDLFileManagerState *const SDLFileManagerStateStartupError = @"StartupError";
@property (weak, nonatomic) id<SDLConnectionManagerType> connectionManager;
// Remote state
-@property (copy, nonatomic, readwrite) NSMutableSet<SDLFileName *> *mutableRemoteFileNames;
+@property (strong, nonatomic, readwrite) NSMutableSet<SDLFileName *> *mutableRemoteFileNames;
@property (assign, nonatomic, readwrite) NSUInteger bytesAvailable;
// Local state
diff --git a/SmartDeviceLink/SDLLockScreenStatusManager.m b/SmartDeviceLink/SDLLockScreenStatusManager.m
index 86350b0d0..956da2dcf 100644
--- a/SmartDeviceLink/SDLLockScreenStatusManager.m
+++ b/SmartDeviceLink/SDLLockScreenStatusManager.m
@@ -71,10 +71,17 @@
return [SDLLockScreenStatus OFF];
} else if ([self.hmiLevel isEqualToEnum:[SDLHMILevel BACKGROUND]]) {
// App is in the background on the car
- // The lockscreen depends entirely on if the user selected the app
if (self.userSelected) {
- return [SDLLockScreenStatus REQUIRED];
+ // It was user selected
+ if (self.haveDriverDistractionStatus && !self.driverDistracted) {
+ // We have the distraction status, and the driver is not distracted
+ return [SDLLockScreenStatus OPTIONAL];
+ } else {
+ // We don't have the distraction status, and/or the driver is distracted
+ return [SDLLockScreenStatus REQUIRED];
+ }
} else {
+ // It wasn't user selected
return [SDLLockScreenStatus OFF];
}
} else if ([self.hmiLevel isEqualToEnum:[SDLHMILevel FULL]] || [self.hmiLevel isEqualToEnum:[SDLHMILevel LIMITED]]) {
diff --git a/SmartDeviceLink/SDLPerformInteraction.m b/SmartDeviceLink/SDLPerformInteraction.m
index 9496aa7a2..f769e835e 100644
--- a/SmartDeviceLink/SDLPerformInteraction.m
+++ b/SmartDeviceLink/SDLPerformInteraction.m
@@ -9,7 +9,7 @@
#import "SDLNames.h"
#import "SDLTTSChunk.h"
#import "SDLTTSChunkFactory.h"
-#import "SDLVRHelpItem.h"
+#import "SDLVrHelpItem.h"
static UInt16 const SDLDefaultTimeout = 10000;
diff --git a/SmartDeviceLink/SDLPermissionManager.m b/SmartDeviceLink/SDLPermissionManager.m
index a6898ee55..af8df0ce9 100644
--- a/SmartDeviceLink/SDLPermissionManager.m
+++ b/SmartDeviceLink/SDLPermissionManager.m
@@ -23,8 +23,8 @@ NS_ASSUME_NONNULL_BEGIN
@interface SDLPermissionManager ()
-@property (copy, nonatomic) NSMutableDictionary<SDLPermissionRPCName, SDLPermissionItem *> *permissions;
-@property (copy, nonatomic) NSMutableArray<SDLPermissionFilter *> *filters;
+@property (strong, nonatomic) NSMutableDictionary<SDLPermissionRPCName, SDLPermissionItem *> *permissions;
+@property (strong, nonatomic) NSMutableArray<SDLPermissionFilter *> *filters;
@property (copy, nonatomic, nullable) SDLHMILevel *currentHMILevel;
@end
diff --git a/SmartDeviceLink/SDLProxy.m b/SmartDeviceLink/SDLProxy.m
index 4ead56361..e35df95ec 100644
--- a/SmartDeviceLink/SDLProxy.m
+++ b/SmartDeviceLink/SDLProxy.m
@@ -49,7 +49,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.3";
+NSString *const SDLProxyVersion = @"4.5.4";
const float startSessionTime = 10.0;
const float notifyProxyClosedDelay = 0.1;
const int POLICIES_CORRELATION_ID = 65535;
diff --git a/SmartDeviceLink/SDLRegisterAppInterfaceResponse.m b/SmartDeviceLink/SDLRegisterAppInterfaceResponse.m
index 18356c34f..0dcab3498 100644
--- a/SmartDeviceLink/SDLRegisterAppInterfaceResponse.m
+++ b/SmartDeviceLink/SDLRegisterAppInterfaceResponse.m
@@ -16,7 +16,7 @@
#import "SDLSoftButtonCapabilities.h"
#import "SDLSpeechCapabilities.h"
#import "SDLSyncMsgVersion.h"
-#import "SDLVRCapabilities.h"
+#import "SDLVrCapabilities.h"
#import "SDLVehicleType.h"
diff --git a/SmartDeviceLink/SDLSetGlobalProperties.m b/SmartDeviceLink/SDLSetGlobalProperties.m
index 490c1fc34..9c7a500e5 100644
--- a/SmartDeviceLink/SDLSetGlobalProperties.m
+++ b/SmartDeviceLink/SDLSetGlobalProperties.m
@@ -9,7 +9,7 @@
#import "SDLNames.h"
#import "SDLTTSChunk.h"
#import "SDLTTSChunkFactory.h"
-#import "SDLVRHelpItem.h"
+#import "SDLVrHelpItem.h"
@implementation SDLSetGlobalProperties
diff --git a/SmartDeviceLink/SDLStateMachine.m b/SmartDeviceLink/SDLStateMachine.m
index ab5c54689..2d197344d 100644
--- a/SmartDeviceLink/SDLStateMachine.m
+++ b/SmartDeviceLink/SDLStateMachine.m
@@ -62,9 +62,11 @@ SDLStateMachineTransitionFormat const SDLStateMachineTransitionFormatDidEnter =
}
if (![self sdl_canState:self.currentState transitionToState:state]) {
+ NSString *targetClassString = NSStringFromClass([self.target class]);
+ NSString *reasonMessage = [NSString stringWithFormat:@"Invalid state machine %@ transition of target %@ occurred from %@ to %@", NSStringFromClass(self.class), targetClassString, self.currentState, state];
@throw [NSException exceptionWithName:NSInternalInconsistencyException
- reason:@"Invalid state machine transition occurred"
- userInfo:@{SDLStateMachineExceptionInfoKeyTargetClass: NSStringFromClass([self.target class]),
+ reason:reasonMessage
+ userInfo:@{SDLStateMachineExceptionInfoKeyTargetClass: targetClassString,
SDLStateMachineExceptionInfoKeyFromState: self.currentState,
SDLStateMachineExceptionInfoKeyToClass: state}];
}
diff --git a/SmartDeviceLink/SDLStreamingMediaManager.m b/SmartDeviceLink/SDLStreamingMediaManager.m
index d05daa93e..ab7cde8c5 100644
--- a/SmartDeviceLink/SDLStreamingMediaManager.m
+++ b/SmartDeviceLink/SDLStreamingMediaManager.m
@@ -384,13 +384,17 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark Callbacks
-void sdl_videoEncoderOutputCallback(void *outputCallbackRefCon, void *sourceFrameRefCon, OSStatus status, VTEncodeInfoFlags infoFlags, CMSampleBufferRef sampleBuffer) {
+void sdl_videoEncoderOutputCallback(void * CM_NULLABLE outputCallbackRefCon, void * CM_NULLABLE sourceFrameRefCon, OSStatus status, VTEncodeInfoFlags infoFlags, CM_NULLABLE CMSampleBufferRef sampleBuffer) {
// If there was an error in the encoding, drop the frame
if (status != noErr) {
[SDLDebugTool logFormat:@"Error encoding video, err=%lld", (int64_t)status];
return;
}
+ if (outputCallbackRefCon == NULL || sourceFrameRefCon == NULL || sampleBuffer == NULL) {
+ return;
+ }
+
SDLStreamingMediaManager *mediaManager = (__bridge SDLStreamingMediaManager *)sourceFrameRefCon;
NSData *elementaryStreamData = [mediaManager.class sdl_encodeElementaryStreamWithSampleBuffer:sampleBuffer];
diff --git a/SmartDeviceLink/SDLVrCapabilities.m b/SmartDeviceLink/SDLVrCapabilities.m
index 72c8c39d2..985d33726 100644
--- a/SmartDeviceLink/SDLVrCapabilities.m
+++ b/SmartDeviceLink/SDLVrCapabilities.m
@@ -2,7 +2,7 @@
//
-#import "SDLVRCapabilities.h"
+#import "SDLVrCapabilities.h"
SDLVRCapabilities *SDLVRCapabilities_TEXT = nil;
diff --git a/SmartDeviceLink/SDLVrHelpItem.m b/SmartDeviceLink/SDLVrHelpItem.m
index 97dc86df4..b24bc9504 100644
--- a/SmartDeviceLink/SDLVrHelpItem.m
+++ b/SmartDeviceLink/SDLVrHelpItem.m
@@ -2,7 +2,7 @@
//
-#import "SDLVRHelpItem.h"
+#import "SDLVrHelpItem.h"
#import "SDLImage.h"
#import "SDLNames.h"
diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLStateMachineSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLStateMachineSpec.m
index d657586e5..af851d09b 100644
--- a/SmartDeviceLinkTests/DevAPISpecs/SDLStateMachineSpec.m
+++ b/SmartDeviceLinkTests/DevAPISpecs/SDLStateMachineSpec.m
@@ -121,11 +121,14 @@ describe(@"A state machine", ^{
});
it(@"should throw an exception trying to transition incorrectly and nothing should be called", ^{
+ NSString *stateMachineClassString = NSStringFromClass(testStateMachine.class);
+ NSString *targetClassString = NSStringFromClass(testTarget.class);
+
// Side effects, but I can't think of any other way around it.
expectAction(^{
[testStateMachine transitionToState:thirdState];
- }).to(raiseException().named(NSInternalInconsistencyException));
-
+ }).to(raiseException().named(NSInternalInconsistencyException).reason([NSString stringWithFormat:@"Invalid state machine %@ transition of target %@ occurred from %@ to %@", stateMachineClassString, targetClassString, initialState, thirdState]).userInfo(@{@"fromState": initialState, @"toState": thirdState, @"targetClass": targetClassString}));
+
expect(@([testStateMachine isCurrentState:initialState])).to(equal(@YES));
expect(@([testStateMachine isCurrentState:thirdState])).to(equal(@NO));
expect(@(willLeaveNotificationCalled)).to(equal(@NO));
@@ -141,4 +144,6 @@ describe(@"A state machine", ^{
});
});
+// Invalid state machine transition of TestStateMachineTarget occurred from Initial to Third
+
QuickSpecEnd
diff --git a/SmartDeviceLinkTests/ProxySpecs/SDLLockScreenStatusManagerSpec.m b/SmartDeviceLinkTests/ProxySpecs/SDLLockScreenStatusManagerSpec.m
index 546380367..8a61980fe 100644
--- a/SmartDeviceLinkTests/ProxySpecs/SDLLockScreenStatusManagerSpec.m
+++ b/SmartDeviceLinkTests/ProxySpecs/SDLLockScreenStatusManagerSpec.m
@@ -122,9 +122,31 @@ describe(@"the lockscreen status manager", ^{
beforeEach(^{
lockScreenManager.userSelected = YES;
});
-
- it(@"should return lock screen required", ^{
- expect(lockScreenManager.lockScreenStatus).to(equal([SDLLockScreenStatus REQUIRED]));
+
+ context(@"if we do not set the driver distraction state", ^{
+ it(@"should return lock screen required", ^{
+ expect(lockScreenManager.lockScreenStatus).to(equal([SDLLockScreenStatus REQUIRED]));
+ });
+ });
+
+ context(@"if we set the driver distraction state to false", ^{
+ beforeEach(^{
+ lockScreenManager.driverDistracted = NO;
+ });
+
+ it(@"should return lock screen optional", ^{
+ expect(lockScreenManager.lockScreenStatus).to(equal([SDLLockScreenStatus OPTIONAL]));
+ });
+ });
+
+ context(@"if we set the driver distraction state to true", ^{
+ beforeEach(^{
+ lockScreenManager.driverDistracted = YES;
+ });
+
+ it(@"should return lock screen required", ^{
+ expect(lockScreenManager.lockScreenStatus).to(equal([SDLLockScreenStatus REQUIRED]));
+ });
});
});
diff --git a/SmartDeviceLink_Example/Info.plist b/SmartDeviceLink_Example/Info.plist
index 0c4b3f0a3..ff523f6b7 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.3</string>
+ <string>4.5.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>