summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2019-10-30 16:19:47 -0400
committerJoel Fischer <joeljfischer@gmail.com>2019-10-30 16:19:47 -0400
commitc00cdd502321712cfc338f1f43585766f00fe373 (patch)
tree0e0c2367bb45b0a7fdae2fb98ed66d504ac705cd
parent0d8164e365e90ec61b2dc51841c05de607814f96 (diff)
downloadsdl_ios-bugfix/issue-1465-subscribe-returns-wrong-type.tar.gz
Fix subscribing system capability manager with selector returns wrong object typebugfix/issue-1465-subscribe-returns-wrong-type
-rw-r--r--SmartDeviceLink/SDLSystemCapabilityManager.m4
1 files changed, 2 insertions, 2 deletions
diff --git a/SmartDeviceLink/SDLSystemCapabilityManager.m b/SmartDeviceLink/SDLSystemCapabilityManager.m
index 89cce9612..0f1c4faf3 100644
--- a/SmartDeviceLink/SDLSystemCapabilityManager.m
+++ b/SmartDeviceLink/SDLSystemCapabilityManager.m
@@ -579,7 +579,7 @@ typedef NSString * SDLServiceID;
- (BOOL)subscribeToCapabilityType:(SDLSystemCapabilityType)type withObserver:(id<NSObject>)observer selector:(SEL)selector {
// DISPLAYS always works due to old-style SetDisplayLayoutRepsonse updates, but otherwise, subscriptions won't work
- if (!self.supportsSubscriptions && ![type isEqualToEnum:SDLSystemCapabilityTypeDisplays]) { return nil; }
+ if (!self.supportsSubscriptions && ![type isEqualToEnum:SDLSystemCapabilityTypeDisplays]) { return NO; }
NSUInteger numberOfParametersInSelector = [NSStringFromSelector(selector) componentsSeparatedByString:@":"].count - 1;
if (numberOfParametersInSelector > 1) { return NO; }
@@ -587,7 +587,7 @@ typedef NSString * SDLServiceID;
SDLSystemCapabilityObserver *observerObject = [[SDLSystemCapabilityObserver alloc] initWithObserver:observer selector:selector];
[self.capabilityObservers[type] addObject:observerObject];
- return observerObject.observer;
+ return YES;
}
- (void)unsubscribeFromCapabilityType:(SDLSystemCapabilityType)type withObserver:(id)observer {