summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/public
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2021-09-24 11:38:51 -0400
committerJoel Fischer <joeljfischer@gmail.com>2021-09-24 11:38:51 -0400
commit7769ece279def35c1cb204c93724a9791c9ebfb5 (patch)
tree38c500e98e6a5691e232acc7c6810f0cb6e87255 /SmartDeviceLink/public
parent1844b32b14121d3c2ecbb6d263fb96a7b7d30e1d (diff)
downloadsdl_ios-7769ece279def35c1cb204c93724a9791c9ebfb5.tar.gz
Additional completion handler fixes
Diffstat (limited to 'SmartDeviceLink/public')
-rw-r--r--SmartDeviceLink/public/SDLErrorConstants.h13
-rw-r--r--SmartDeviceLink/public/SDLFileManager.m5
-rw-r--r--SmartDeviceLink/public/SDLSystemCapabilityManager.m4
3 files changed, 16 insertions, 6 deletions
diff --git a/SmartDeviceLink/public/SDLErrorConstants.h b/SmartDeviceLink/public/SDLErrorConstants.h
index c5e0fc88f..ce433d396 100644
--- a/SmartDeviceLink/public/SDLErrorConstants.h
+++ b/SmartDeviceLink/public/SDLErrorConstants.h
@@ -177,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,
};
/**
@@ -251,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/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;
}