summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2021-09-27 09:01:59 -0400
committerGitHub <noreply@github.com>2021-09-27 09:01:59 -0400
commit6eaf543e6b6ecea478bd760be9cbf37564398681 (patch)
treebab06789f2540b11fd83c3acc7a71aa1a7b887d8
parent095d0a2eaba8c7d607b28f1e78aa2af911740d27 (diff)
parentd888ebe7a61794c42a551bf7ca109b03c64ce544 (diff)
downloadsdl_ios-6eaf543e6b6ecea478bd760be9cbf37564398681.tar.gz
Merge pull request #2045 from smartdevicelink/bugfix/issue-2044-completion-handlers-not-called
Fix completion handlers not being called
-rw-r--r--SmartDeviceLink/private/SDLCheckChoiceVROptionalOperation.m8
-rw-r--r--SmartDeviceLink/private/SDLChoiceSetManager.m11
-rw-r--r--SmartDeviceLink/private/SDLDeleteChoicesOperation.m5
-rw-r--r--SmartDeviceLink/private/SDLDeleteFileOperation.m4
-rw-r--r--SmartDeviceLink/private/SDLError.h5
-rw-r--r--SmartDeviceLink/private/SDLError.m32
-rw-r--r--SmartDeviceLink/private/SDLFileWrapper.m4
-rw-r--r--SmartDeviceLink/private/SDLListFilesOperation.m4
-rw-r--r--SmartDeviceLink/private/SDLMenuShowOperation.m7
-rw-r--r--SmartDeviceLink/private/SDLProtocolMessageAssembler.m2
-rw-r--r--SmartDeviceLink/private/SDLSequentialRPCRequestOperation.m7
-rw-r--r--SmartDeviceLink/private/SDLTextAndGraphicManager.m13
-rw-r--r--SmartDeviceLink/private/SDLVoiceCommandUpdateOperation.m5
-rw-r--r--SmartDeviceLink/public/SDLErrorConstants.h22
-rw-r--r--SmartDeviceLink/public/SDLErrorConstants.m1
-rw-r--r--SmartDeviceLink/public/SDLFileManager.m5
-rw-r--r--SmartDeviceLink/public/SDLSystemCapabilityManager.m4
-rw-r--r--SmartDeviceLinkTests/DevAPISpecs/SDLPreloadPresentChoicesOperationSpec.m2
18 files changed, 121 insertions, 20 deletions
diff --git a/SmartDeviceLink/private/SDLCheckChoiceVROptionalOperation.m b/SmartDeviceLink/private/SDLCheckChoiceVROptionalOperation.m
index f9ee3168b..0b661c6c5 100644
--- a/SmartDeviceLink/private/SDLCheckChoiceVROptionalOperation.m
+++ b/SmartDeviceLink/private/SDLCheckChoiceVROptionalOperation.m
@@ -12,6 +12,7 @@
#import "SDLCreateInteractionChoiceSet.h"
#import "SDLConnectionManagerType.h"
#import "SDLDeleteInteractionChoiceSet.h"
+#import "SDLError.h"
#import "SDLLogMacros.h"
NS_ASSUME_NONNULL_BEGIN
@@ -28,9 +29,12 @@ NS_ASSUME_NONNULL_BEGIN
@implementation SDLCheckChoiceVROptionalOperation
-- (instancetype)initWithConnectionManager:(id<SDLConnectionManagerType>)connectionManager completionHandler:(nonnull SDLCheckChoiceVROptionalCompletionHandler)completionHandler {
+- (instancetype)initWithConnectionManager:(id<SDLConnectionManagerType>)connectionManager completionHandler:(SDLCheckChoiceVROptionalCompletionHandler)completionHandler {
self = [super init];
- if (!self) { return nil; }
+ if (!self) {
+ completionHandler(NO, [NSError sdl_failedToCreateObjectOfClass:[SDLCheckChoiceVROptionalOperation class]]);
+ return nil;
+ }
_connectionManager = connectionManager;
_operationId = [NSUUID UUID];
diff --git a/SmartDeviceLink/private/SDLChoiceSetManager.m b/SmartDeviceLink/private/SDLChoiceSetManager.m
index 006cff639..ae41c39c1 100644
--- a/SmartDeviceLink/private/SDLChoiceSetManager.m
+++ b/SmartDeviceLink/private/SDLChoiceSetManager.m
@@ -222,7 +222,16 @@ UInt16 const ChoiceCellCancelIdMax = 200;
- (void)preloadChoices:(NSArray<SDLChoiceCell *> *)choices withCompletionHandler:(nullable SDLPreloadChoiceCompletionHandler)handler {
SDLLogV(@"Request to preload choices: %@", choices);
- if (choices.count == 0) { return; }
+ if (choices.count == 0) {
+ if (handler != nil) {
+ handler([NSError sdl_choiceSetManager_choiceUploadFailed:@{
+ NSLocalizedDescriptionKey: @"Choice upload failed",
+ NSLocalizedFailureReasonErrorKey: @"No choices were provided for upload",
+ NSLocalizedRecoverySuggestionErrorKey: @"Provide some choice cells to upload instead of an empty list"
+ }]);
+ }
+ return;
+ }
if (![self.currentState isEqualToString:SDLChoiceManagerStateReady]) {
NSError *error = [NSError sdl_choiceSetManager_incorrectState:self.currentState];
SDLLogE(@"Cannot preload choices when the manager isn't in the ready state: %@", error);
diff --git a/SmartDeviceLink/private/SDLDeleteChoicesOperation.m b/SmartDeviceLink/private/SDLDeleteChoicesOperation.m
index 189460b34..03ca2a4ab 100644
--- a/SmartDeviceLink/private/SDLDeleteChoicesOperation.m
+++ b/SmartDeviceLink/private/SDLDeleteChoicesOperation.m
@@ -37,7 +37,10 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)initWithConnectionManager:(id<SDLConnectionManagerType>)connectionManager cellsToDelete:(NSSet<SDLChoiceCell *> *)cellsToDelete loadedCells:(NSSet<SDLChoiceCell *> *)loadedCells completionHandler:(SDLDeleteChoicesCompletionHandler)completionHandler {
self = [super init];
- if (!self) { return nil; }
+ if (!self) {
+ completionHandler(loadedCells, [NSError sdl_failedToCreateObjectOfClass:[SDLDeleteChoicesOperation class]]);
+ return nil;
+ }
_connectionManager = connectionManager;
_cellsToDelete = cellsToDelete;
diff --git a/SmartDeviceLink/private/SDLDeleteFileOperation.m b/SmartDeviceLink/private/SDLDeleteFileOperation.m
index e7ce7e204..80efdf332 100644
--- a/SmartDeviceLink/private/SDLDeleteFileOperation.m
+++ b/SmartDeviceLink/private/SDLDeleteFileOperation.m
@@ -11,6 +11,7 @@
#import "SDLConnectionManagerType.h"
#import "SDLDeleteFile.h"
#import "SDLDeleteFileResponse.h"
+#import "SDLError.h"
NS_ASSUME_NONNULL_BEGIN
@@ -28,6 +29,9 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)initWithFileName:(NSString *)fileName connectionManager:(id<SDLConnectionManagerType>)connectionManager completionHandler:(nullable SDLFileManagerDeleteCompletionHandler)completionHandler {
self = [super init];
if (!self) {
+ if (completionHandler != nil) {
+ completionHandler(NO, NSNotFound, [NSError sdl_failedToCreateObjectOfClass:[SDLDeleteFileOperation class]]);
+ }
return nil;
}
diff --git a/SmartDeviceLink/private/SDLError.h b/SmartDeviceLink/private/SDLError.h
index 7baabc7d1..72453b06f 100644
--- a/SmartDeviceLink/private/SDLError.h
+++ b/SmartDeviceLink/private/SDLError.h
@@ -20,6 +20,8 @@ NS_ASSUME_NONNULL_BEGIN
@interface NSError (SDLErrors)
++ (NSError *)sdl_failedToCreateObjectOfClass:(Class)objectClass;
+
#pragma mark SDLEncryptionLifecycleManager
+ (NSError *)sdl_encryption_lifecycle_notReadyError;
+ (NSError *)sdl_encryption_lifecycle_encryption_off;
@@ -56,6 +58,8 @@ NS_ASSUME_NONNULL_BEGIN
+ (NSError *)sdl_softButtonManager_pendingUpdateSuperseded;
+ (NSError *)sdl_subscribeButtonManager_notSubscribed;
+ (NSError *)sdl_textAndGraphicManager_pendingUpdateSuperseded;
++ (NSError *)sdl_textAndGraphicManager_batchingUpdate;
++ (NSError *)sdl_textAndGraphicManager_nothingToUpdate;
#pragma mark Menu Manager
@@ -89,6 +93,7 @@ NS_ASSUME_NONNULL_BEGIN
+ (NSError *)sdl_systemCapabilityManager_moduleDoesNotSupportSystemCapabilities;
+ (NSError *)sdl_systemCapabilityManager_cannotUpdateInHMINONE;
+ (NSError *)sdl_systemCapabilityManager_cannotUpdateTypeDISPLAYS;
++ (NSError *)sdl_systemCapabilityManager_unknownSystemCapabilityType;
#pragma mark Transport
diff --git a/SmartDeviceLink/private/SDLError.m b/SmartDeviceLink/private/SDLError.m
index a1dc6b52d..120077f88 100644
--- a/SmartDeviceLink/private/SDLError.m
+++ b/SmartDeviceLink/private/SDLError.m
@@ -15,6 +15,14 @@ NS_ASSUME_NONNULL_BEGIN
@implementation NSError (SDLErrors)
++ (NSError *)sdl_failedToCreateObjectOfClass:(Class)objectClass {
+ return [NSError errorWithDomain:SDLErrorDomainSystem code:SDLSystemErrorFailedToCreateObject userInfo:@{
+ NSLocalizedDescriptionKey: [NSString stringWithFormat: @"iOS system failed to create a new object of class: %@", objectClass],
+ NSLocalizedFailureReasonErrorKey: @"An unknown error caused iOS to fail to create an object",
+ NSLocalizedRecoverySuggestionErrorKey: @"There is no known way to fix this error"
+ }];
+}
+
#pragma mark - SDLEncryptionLifecycleManager
+ (NSError *)sdl_encryption_lifecycle_notReadyError {
NSDictionary<NSString *, NSString *> *userInfo = @{
@@ -269,6 +277,22 @@ NS_ASSUME_NONNULL_BEGIN
return [NSError errorWithDomain:SDLErrorDomainSubscribeButtonManager code:SDLSubscribeButtonManagerErrorNotSubscribed userInfo:userInfo];
}
++ (NSError *)sdl_textAndGraphicManager_batchingUpdate {
+ return [NSError errorWithDomain:SDLErrorDomainTextAndGraphicManager code:SDLTextAndGraphicManagerErrorCurrentlyBatching userInfo:@{
+ NSLocalizedDescriptionKey: @"Update will not run because batching is enabled",
+ NSLocalizedFailureReasonErrorKey: @"Text and Graphic manager will not run this update and call this handler because its currently batching updates. The update will occur when batching ends.",
+ NSLocalizedRecoverySuggestionErrorKey: @"This callback shouldn't occur. Please open an issue on https://www.github.com/smartdevicelink/sdl_ios/ if it does"
+ }];
+}
+
++ (NSError *)sdl_textAndGraphicManager_nothingToUpdate {
+ return [NSError errorWithDomain:SDLErrorDomainTextAndGraphicManager code:SDLTextAndGraphicManagerErrorNothingToUpdate userInfo:@{
+ NSLocalizedDescriptionKey: @"Update will not run because there's nothing to update",
+ NSLocalizedFailureReasonErrorKey: @"This callback shouldn't occur, so there's no known reason for this failure.",
+ NSLocalizedRecoverySuggestionErrorKey: @"This callback shouldn't occur. Please open an issue on https://www.github.com/smartdevicelink/sdl_ios/ if it does"
+ }];
+}
+
#pragma mark Menu Manager
+ (NSError *)sdl_menuManager_configurationOperationLayoutsNotSupported {
@@ -446,6 +470,14 @@ NS_ASSUME_NONNULL_BEGIN
return [NSError errorWithDomain:SDLErrorDomainSystemCapabilityManager code:SDLSystemCapabilityManagerErrorCannotUpdateTypeDisplays userInfo:userInfo];
}
++ (NSError *)sdl_systemCapabilityManager_unknownSystemCapabilityType {
+ return [NSError errorWithDomain:SDLErrorDomainSystemCapabilityManager code:SDLSystemCapabilityManagerErrorUnknownType userInfo:@{
+ NSLocalizedDescriptionKey: @"An unknown system capability type was received.",
+ NSLocalizedFailureReasonErrorKey: @"Failure reason unknown. If you see this, please open an issue on https://www.github.com/smartdevicelink/sdl_ios/",
+ NSLocalizedRecoverySuggestionErrorKey: @"Ensure you are only attempting to manually subscribe to known system capability types for the version of this library. You may also want to update this library to its latest version."
+ }];
+}
+
#pragma mark Transport
+ (NSError *)sdl_transport_unknownError {
diff --git a/SmartDeviceLink/private/SDLFileWrapper.m b/SmartDeviceLink/private/SDLFileWrapper.m
index fac2b6580..c6500171d 100644
--- a/SmartDeviceLink/private/SDLFileWrapper.m
+++ b/SmartDeviceLink/private/SDLFileWrapper.m
@@ -8,6 +8,7 @@
#import "SDLFileWrapper.h"
+#import "SDLError.h"
#import "SDLFile.h"
@@ -18,6 +19,7 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)initWithFile:(SDLFile *)file completionHandler:(SDLFileManagerUploadCompletionHandler)completionHandler {
self = [super init];
if (!self) {
+ completionHandler(NO, NSNotFound, [NSError sdl_failedToCreateObjectOfClass:[SDLFileWrapper class]]);
return nil;
}
@@ -33,4 +35,4 @@ NS_ASSUME_NONNULL_BEGIN
@end
-NS_ASSUME_NONNULL_END \ No newline at end of file
+NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/private/SDLListFilesOperation.m b/SmartDeviceLink/private/SDLListFilesOperation.m
index 693d52eea..2eb3102b0 100644
--- a/SmartDeviceLink/private/SDLListFilesOperation.m
+++ b/SmartDeviceLink/private/SDLListFilesOperation.m
@@ -9,6 +9,7 @@
#import "SDLListFilesOperation.h"
#import "SDLConnectionManagerType.h"
+#import "SDLError.h"
#import "SDLListFiles.h"
#import "SDLListFilesResponse.h"
@@ -29,6 +30,9 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)initWithConnectionManager:(id<SDLConnectionManagerType>)connectionManager completionHandler:(nullable SDLFileManagerListFilesCompletionHandler)completionHandler {
self = [super init];
if (!self) {
+ if (completionHandler != nil) {
+ completionHandler(NO, NSNotFound, @[], [NSError sdl_failedToCreateObjectOfClass:[SDLListFilesOperation class]]);
+ }
return nil;
}
diff --git a/SmartDeviceLink/private/SDLMenuShowOperation.m b/SmartDeviceLink/private/SDLMenuShowOperation.m
index 92fa5a971..c62bfb5c4 100644
--- a/SmartDeviceLink/private/SDLMenuShowOperation.m
+++ b/SmartDeviceLink/private/SDLMenuShowOperation.m
@@ -38,9 +38,12 @@ NS_ASSUME_NONNULL_BEGIN
@implementation SDLMenuShowOperation
-- (instancetype)initWithConnectionManager:(id<SDLConnectionManagerType>)connectionManager toMenuCell:(nullable SDLMenuCell *)menuCell completionHandler:(nonnull SDLMenuShowCompletionBlock)completionHandler {
+- (instancetype)initWithConnectionManager:(id<SDLConnectionManagerType>)connectionManager toMenuCell:(nullable SDLMenuCell *)menuCell completionHandler:(SDLMenuShowCompletionBlock)completionHandler {
self = [super init];
- if (!self) { return nil; }
+ if (!self) {
+ completionHandler([NSError sdl_failedToCreateObjectOfClass:[SDLMenuShowOperation class]]);
+ return nil;
+ }
_connectionManager = connectionManager;
_submenuCell = menuCell;
diff --git a/SmartDeviceLink/private/SDLProtocolMessageAssembler.m b/SmartDeviceLink/private/SDLProtocolMessageAssembler.m
index e4a07541c..6df71e5d9 100644
--- a/SmartDeviceLink/private/SDLProtocolMessageAssembler.m
+++ b/SmartDeviceLink/private/SDLProtocolMessageAssembler.m
@@ -28,7 +28,7 @@ NS_ASSUME_NONNULL_BEGIN
// Validate input
if (message.header.sessionID != self.sessionID) {
SDLLogE(@"Message part sent to the wrong assembler. This session id: %d, message session id: %d", self.sessionID, message.header.sessionID);
- return;
+ return completionHandler(NO, nil);
}
if (self.parts == nil) {
diff --git a/SmartDeviceLink/private/SDLSequentialRPCRequestOperation.m b/SmartDeviceLink/private/SDLSequentialRPCRequestOperation.m
index 96c44b82c..9fb348986 100644
--- a/SmartDeviceLink/private/SDLSequentialRPCRequestOperation.m
+++ b/SmartDeviceLink/private/SDLSequentialRPCRequestOperation.m
@@ -34,7 +34,12 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)initWithConnectionManager:(id<SDLConnectionManagerType>)connectionManager requests:(NSArray<SDLRPCRequest *> *)requests progressHandler:(nullable SDLMultipleSequentialRequestProgressHandler)progressHandler completionHandler:(nullable SDLMultipleRequestCompletionHandler)completionHandler {
self = [super init];
- if (!self) { return nil; }
+ if (!self) {
+ if (completionHandler != nil) {
+ completionHandler(NO);
+ }
+ return nil;
+ }
executing = NO;
finished = NO;
diff --git a/SmartDeviceLink/private/SDLTextAndGraphicManager.m b/SmartDeviceLink/private/SDLTextAndGraphicManager.m
index 37b9f95fa..34c4dcf54 100644
--- a/SmartDeviceLink/private/SDLTextAndGraphicManager.m
+++ b/SmartDeviceLink/private/SDLTextAndGraphicManager.m
@@ -150,11 +150,18 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark - Upload / Send
- (void)updateWithCompletionHandler:(nullable SDLTextAndGraphicUpdateCompletionHandler)handler {
- if (self.isBatchingUpdates) { return; }
-
- if (self.isDirty) {
+ if (self.isBatchingUpdates) {
+ if (handler != nil) {
+ // This shouldn't be possible, but just in case
+ handler([NSError sdl_textAndGraphicManager_batchingUpdate]);
+ }
+ } else if (self.isDirty) {
self.isDirty = NO;
[self sdl_updateAndCancelPreviousOperations:YES completionHandler:handler];
+ } else {
+ if (handler != nil) {
+ handler([NSError sdl_textAndGraphicManager_nothingToUpdate]);
+ }
}
}
diff --git a/SmartDeviceLink/private/SDLVoiceCommandUpdateOperation.m b/SmartDeviceLink/private/SDLVoiceCommandUpdateOperation.m
index 548c3fbcb..9d80ea8a3 100644
--- a/SmartDeviceLink/private/SDLVoiceCommandUpdateOperation.m
+++ b/SmartDeviceLink/private/SDLVoiceCommandUpdateOperation.m
@@ -39,7 +39,10 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)initWithConnectionManager:(id<SDLConnectionManagerType>)connectionManager pendingVoiceCommands:(NSArray<SDLVoiceCommand *> *)pendingVoiceCommands oldVoiceCommands:(NSArray<SDLVoiceCommand *> *)oldVoiceCommands updateCompletionHandler:(SDLVoiceCommandUpdateCompletionHandler)completionHandler {
self = [self init];
- if (!self) { return nil; }
+ if (!self) {
+ completionHandler(@[], [NSError sdl_failedToCreateObjectOfClass:[SDLVoiceCommandUpdateOperation class]]);
+ return nil;
+ }
_connectionManager = connectionManager;
_pendingVoiceCommands = pendingVoiceCommands;
diff --git a/SmartDeviceLink/public/SDLErrorConstants.h b/SmartDeviceLink/public/SDLErrorConstants.h
index a148e9f57..ce433d396 100644
--- a/SmartDeviceLink/public/SDLErrorConstants.h
+++ b/SmartDeviceLink/public/SDLErrorConstants.h
@@ -13,6 +13,9 @@
/// A typedef declaration of the SDL error domain
typedef NSString SDLErrorDomain;
+/// An error with the iOS system
+extern SDLErrorDomain *const SDLErrorDomainSystem;
+
/// An error in the SDLAudioStreamManager
extern SDLErrorDomain *const SDLErrorDomainAudioStreamManager;
@@ -58,6 +61,12 @@ extern SDLErrorDomain *const SDLErrorDomainTransport;
#pragma mark Error Codes
+/// Error associated with the underlying operating system
+typedef NS_ENUM(NSInteger, SDLSystemError) {
+ /// iOS failed to create an object
+ SDLSystemErrorFailedToCreateObject = -1
+};
+
/**
* Errors associated with the SDLManager class.
*/
@@ -168,7 +177,13 @@ typedef NS_ENUM(NSInteger, SDLFileManagerError) {
*/
typedef NS_ENUM(NSInteger, SDLTextAndGraphicManagerError) {
/// A pending update was superseded by a newer requested update. The old update will not be sent
- SDLTextAndGraphicManagerErrorPendingUpdateSuperseded = -1
+ SDLTextAndGraphicManagerErrorPendingUpdateSuperseded = -1,
+
+ /// The manager is currently batching updates so the update will not yet be sent and the handler will not be called
+ SDLTextAndGraphicManagerErrorCurrentlyBatching = -2,
+
+ /// The manager could find nothing to update
+ SDLTextAndGraphicManagerErrorNothingToUpdate = -3,
};
/**
@@ -242,7 +257,10 @@ typedef NS_ENUM(NSInteger, SDLSystemCapabilityManagerError) {
SDLSystemCapabilityManagerErrorHMINone = -2,
/// You may not update the system capability type DISPLAYS because it is always subscribed
- SDLSystemCapabilityManagerErrorCannotUpdateTypeDisplays = -3
+ SDLSystemCapabilityManagerErrorCannotUpdateTypeDisplays = -3,
+
+ /// The module sent an unknown system capability type
+ SDLSystemCapabilityManagerErrorUnknownType = -4,
};
/**
diff --git a/SmartDeviceLink/public/SDLErrorConstants.m b/SmartDeviceLink/public/SDLErrorConstants.m
index ccfc62472..b6e77a210 100644
--- a/SmartDeviceLink/public/SDLErrorConstants.m
+++ b/SmartDeviceLink/public/SDLErrorConstants.m
@@ -10,6 +10,7 @@
#pragma mark Error Domains
+SDLErrorDomain *const SDLErrorDomainSystem = @"com.sdl.system.error";
SDLErrorDomain *const SDLErrorDomainAudioStreamManager = @"com.sdl.extension.pcmAudioStreamManager";
SDLErrorDomain *const SDLErrorDomainCacheFileManager = @"com.sdl.cachefilemanager.error";
SDLErrorDomain *const SDLErrorDomainChoiceSetManager = @"com.sdl.choicesetmanager.error";
diff --git a/SmartDeviceLink/public/SDLFileManager.m b/SmartDeviceLink/public/SDLFileManager.m
index 2acf44626..8407dd748 100644
--- a/SmartDeviceLink/public/SDLFileManager.m
+++ b/SmartDeviceLink/public/SDLFileManager.m
@@ -407,7 +407,6 @@ SDLFileManagerState *const SDLFileManagerStateStartupError = @"StartupError";
- (void)sdl_uploadFile:(SDLFile *)file completionHandler:(nullable SDLFileManagerUploadCompletionHandler)handler {
__block NSString *fileName = file.name;
- __block SDLFileManagerUploadCompletionHandler uploadCompletion = [handler copy];
__weak typeof(self) weakSelf = self;
SDLFileWrapper *fileWrapper = [SDLFileWrapper wrapperWithFile:file completionHandler:^(BOOL success, NSUInteger bytesAvailable, NSError *_Nullable error) {
@@ -425,8 +424,8 @@ SDLFileManagerState *const SDLFileManagerStateStartupError = @"StartupError";
}
}
- if (uploadCompletion != nil) {
- uploadCompletion(success, bytesAvailable, error);
+ if (handler != nil) {
+ handler(success, bytesAvailable, error);
}
}];
diff --git a/SmartDeviceLink/public/SDLSystemCapabilityManager.m b/SmartDeviceLink/public/SDLSystemCapabilityManager.m
index 9130cd673..849f8f2e8 100644
--- a/SmartDeviceLink/public/SDLSystemCapabilityManager.m
+++ b/SmartDeviceLink/public/SDLSystemCapabilityManager.m
@@ -450,11 +450,13 @@ typedef NSString * SDLServiceID;
[self sdl_saveDisplayCapabilityListUpdate:systemCapability.displayCapabilities];
} else {
SDLLogW(@"Received response for unknown System Capability Type: %@", systemCapabilityType);
+ if (handler != nil) {
+ handler(systemCapability, NO, [NSError sdl_systemCapabilityManager_unknownSystemCapabilityType]);
+ }
return NO;
}
SDLLogD(@"Updated system capability manager with new data: %@", systemCapability);
-
[self sdl_callObserversForUpdate:systemCapability error:error handler:handler];
return YES;
}
diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLPreloadPresentChoicesOperationSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLPreloadPresentChoicesOperationSpec.m
index 45e4b7efc..dfb910a99 100644
--- a/SmartDeviceLinkTests/DevAPISpecs/SDLPreloadPresentChoicesOperationSpec.m
+++ b/SmartDeviceLinkTests/DevAPISpecs/SDLPreloadPresentChoicesOperationSpec.m
@@ -293,7 +293,7 @@ describe(@"a preload choices operation", ^{
});
});
- fcontext(@"when artworks are not already on the system", ^{
+ context(@"when artworks are not already on the system", ^{
beforeEach(^{
OCMStub([testFileManager hasUploadedFile:[OCMArg isNotNil]]).andReturn(NO);
});