diff options
Diffstat (limited to 'SmartDeviceLink/SDLHMIPermissions.m')
-rw-r--r-- | SmartDeviceLink/SDLHMIPermissions.m | 36 |
1 files changed, 5 insertions, 31 deletions
diff --git a/SmartDeviceLink/SDLHMIPermissions.m b/SmartDeviceLink/SDLHMIPermissions.m index cd301151e..620c9ca6f 100644 --- a/SmartDeviceLink/SDLHMIPermissions.m +++ b/SmartDeviceLink/SDLHMIPermissions.m @@ -4,6 +4,7 @@ #import "SDLHMIPermissions.h" +#import "NSMutableDictionary+Store.h" #import "SDLNames.h" NS_ASSUME_NONNULL_BEGIN @@ -11,46 +12,19 @@ NS_ASSUME_NONNULL_BEGIN @implementation SDLHMIPermissions - (void)setAllowed:(NSMutableArray<SDLHMILevel> *)allowed { - if (allowed != nil) { - [store setObject:allowed forKey:SDLNameAllowed]; - } else { - [store removeObjectForKey:SDLNameAllowed]; - } + [store sdl_setObject:allowed forName:SDLNameAllowed]; } - (NSMutableArray<SDLHMILevel> *)allowed { - NSMutableArray<SDLHMILevel> *array = [store objectForKey:SDLNameAllowed]; - if ([array count] < 1) { - return array; - } else { - NSMutableArray<SDLHMILevel> *newList = [NSMutableArray arrayWithCapacity:[array count]]; - for (NSString *enumString in array) { - [newList addObject:(SDLHMILevel)enumString]; - } - return newList; - } + return [store sdl_enumsForName:SDLNameAllowed]; } - (void)setUserDisallowed:(NSMutableArray<SDLHMILevel> *)userDisallowed { - if (userDisallowed != nil) { - [store setObject:userDisallowed forKey:SDLNameUserDisallowed]; - } else { - [store removeObjectForKey:SDLNameUserDisallowed]; - } + [store sdl_setObject:userDisallowed forName:SDLNameUserDisallowed]; } - (NSMutableArray<SDLHMILevel> *)userDisallowed { - NSMutableArray<SDLHMILevel> *array = [store objectForKey:SDLNameUserDisallowed]; - if ([array count] < 1) { - return array; - } else { - NSMutableArray<SDLHMILevel> *newList = [NSMutableArray arrayWithCapacity:[array count]]; - for (NSString *enumString in array) { - [newList addObject:(SDLHMILevel)enumString]; - } - return newList; - } - + return [store sdl_enumsForName:SDLNameUserDisallowed]; } @end |