summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2018-10-03 11:02:00 -0400
committerJoel Fischer <joeljfischer@gmail.com>2018-10-03 11:02:00 -0400
commit825f4f20ead51c95df770247116e18ff10b679a4 (patch)
treee85d3538e105c33580a206a8495ea6bd27d5ffce
parent60ea18a30080d325ed536b2c98d23e11dd840d73 (diff)
parentc9cf66a23bbba9ea2df6b7ff01a3f27f626a068f (diff)
downloadsdl_ios-825f4f20ead51c95df770247116e18ff10b679a4.tar.gz
Merge branch 'develop' of https://github.com/smartdevicelink/sdl_ios into develop
-rw-r--r--SmartDeviceLink/SDLAudioControlCapabilities.h9
-rw-r--r--SmartDeviceLink/SDLAudioControlCapabilities.m11
-rw-r--r--SmartDeviceLink/SDLNames.h1
-rw-r--r--SmartDeviceLink/SDLNames.m1
-rw-r--r--SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAudioControlCapabilitiesSpec.m9
5 files changed, 28 insertions, 3 deletions
diff --git a/SmartDeviceLink/SDLAudioControlCapabilities.h b/SmartDeviceLink/SDLAudioControlCapabilities.h
index b21317753..b7f29a01c 100644
--- a/SmartDeviceLink/SDLAudioControlCapabilities.h
+++ b/SmartDeviceLink/SDLAudioControlCapabilities.h
@@ -25,7 +25,7 @@ NS_ASSUME_NONNULL_BEGIN
@param equalizerMaxChannelID Equalizer channel ID (between 1-100).
@return An instance of the SDLAudioControlCapabilities class.
*/
-- (instancetype)initWithModuleName:(NSString *)name sourceAvailable:(nullable NSNumber<SDLBool> *)sourceAvailable volueAvailable:(nullable NSNumber<SDLBool> *)volumeAvailable equalizerAvailable:(nullable NSNumber<SDLBool> *)equalizerAvailable equalizerMaxChannelID:(nullable NSNumber<SDLInt> *)equalizerMaxChannelID;
+- (instancetype)initWithModuleName:(NSString *)name sourceAvailable:(nullable NSNumber<SDLBool> *)sourceAvailable keepContextAvailable:(nullable NSNumber<SDLBool> *)keepContextAvailable volumeAvailable:(nullable NSNumber<SDLBool> *)volumeAvailable equalizerAvailable:(nullable NSNumber<SDLBool> *)equalizerAvailable equalizerMaxChannelID:(nullable NSNumber<SDLInt> *)equalizerMaxChannelID;
/**
* @abstract The short friendly name of the audio control module.
@@ -43,6 +43,13 @@ NS_ASSUME_NONNULL_BEGIN
@property (nullable, strong, nonatomic) NSNumber<SDLBool> *sourceAvailable;
/**
+ Availability of the keepContext parameter.
+
+ Optional, Boolean
+ */
+@property (nullable, strong, nonatomic) NSNumber<SDLBool> *keepContextAvailable;
+
+/**
* @abstract Availability of the control of audio volume.
*
* Optional, Boolean
diff --git a/SmartDeviceLink/SDLAudioControlCapabilities.m b/SmartDeviceLink/SDLAudioControlCapabilities.m
index 32832c627..e0d64d4da 100644
--- a/SmartDeviceLink/SDLAudioControlCapabilities.m
+++ b/SmartDeviceLink/SDLAudioControlCapabilities.m
@@ -19,13 +19,14 @@ NS_ASSUME_NONNULL_BEGIN
return self;
}
-- (instancetype)initWithModuleName:(NSString *)name sourceAvailable:(nullable NSNumber<SDLBool> *)sourceAvailable volueAvailable:(nullable NSNumber<SDLBool> *)volumeAvailable equalizerAvailable:(nullable NSNumber<SDLBool> *)equalizerAvailable equalizerMaxChannelID:(nullable NSNumber<SDLInt> *)equalizerMaxChannelID {
+- (instancetype)initWithModuleName:(NSString *)name sourceAvailable:(nullable NSNumber<SDLBool> *)sourceAvailable keepContextAvailable:(nullable NSNumber<SDLBool> *)keepContextAvailable volumeAvailable:(nullable NSNumber<SDLBool> *)volumeAvailable equalizerAvailable:(nullable NSNumber<SDLBool> *)equalizerAvailable equalizerMaxChannelID:(nullable NSNumber<SDLInt> *)equalizerMaxChannelID {
self = [self init];
if (!self) {
return nil;
}
self.moduleName = name;
self.sourceAvailable = sourceAvailable;
+ self.keepContextAvailable = keepContextAvailable;
self.volumeAvailable = volumeAvailable;
self.equalizerAvailable = equalizerAvailable;
self.equalizerMaxChannelId = equalizerMaxChannelID;
@@ -49,6 +50,14 @@ NS_ASSUME_NONNULL_BEGIN
return [store sdl_objectForName:SDLNameSourceAvailable];
}
+- (void)setKeepContextAvailable:(nullable NSNumber<SDLBool> *)keepContextAvailable {
+ [store sdl_setObject:keepContextAvailable forName:SDLNameKeepContextAvailable];
+}
+
+- (nullable NSNumber<SDLBool> *)keepContextAvailable {
+ return [store sdl_objectForName:SDLNameKeepContextAvailable];
+}
+
- (void)setVolumeAvailable:(nullable NSNumber<SDLBool> *)volumeAvailable {
[store sdl_setObject:volumeAvailable forName:SDLNameVolumeAvailable];
}
diff --git a/SmartDeviceLink/SDLNames.h b/SmartDeviceLink/SDLNames.h
index 6df9c402e..514899a7c 100644
--- a/SmartDeviceLink/SDLNames.h
+++ b/SmartDeviceLink/SDLNames.h
@@ -275,6 +275,7 @@ extern SDLName const SDLNameIsHighlighted;
extern SDLName const SDLNameIsMediaApplication;
extern SDLName const SDLNameIsSubscribed;
extern SDLName const SDLNameKeepContext;
+extern SDLName const SDLNameKeepContextAvailable;
extern SDLName const SDLNameKeyboardLayout;
extern SDLName const SDLNameKeyboardProperties;
extern SDLName const SDLNameKeypressMode;
diff --git a/SmartDeviceLink/SDLNames.m b/SmartDeviceLink/SDLNames.m
index 58527c3cd..62ad20ecf 100644
--- a/SmartDeviceLink/SDLNames.m
+++ b/SmartDeviceLink/SDLNames.m
@@ -272,6 +272,7 @@ SDLName const SDLNameIsHighlighted = @"isHighlighted";
SDLName const SDLNameIsMediaApplication = @"isMediaApplication";
SDLName const SDLNameIsSubscribed = @"isSubscribed";
SDLName const SDLNameKeepContext = @"keepContext";
+SDLName const SDLNameKeepContextAvailable = @"keepContextAvailable";
SDLName const SDLNameKeyboardLayout = @"keyboardLayout";
SDLName const SDLNameKeyboardProperties = @"keyboardProperties";
SDLName const SDLNameKeypressMode = @"keypressMode";
diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAudioControlCapabilitiesSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAudioControlCapabilitiesSpec.m
index 0e01a3680..f785e9bce 100644
--- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAudioControlCapabilitiesSpec.m
+++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAudioControlCapabilitiesSpec.m
@@ -20,11 +20,13 @@ describe(@"Getter/Setter Tests", ^ {
testStruct.moduleName = @"module";
testStruct.sourceAvailable = @(YES);
+ testStruct.keepContextAvailable = @YES;
testStruct.volumeAvailable = @(NO);
testStruct.equalizerAvailable = @(NO);
testStruct.equalizerMaxChannelId = @56;
expect(testStruct.moduleName).to(equal(@"module"));
+ expect(testStruct.keepContextAvailable).to(equal(@YES));
expect(testStruct.sourceAvailable).to(equal(@(YES)));
expect(testStruct.volumeAvailable).to(equal(@(NO)));
expect(testStruct.equalizerAvailable).to(equal(@(NO)));
@@ -36,16 +38,18 @@ describe(@"Getter/Setter Tests", ^ {
expect(testStruct.moduleName).to(equal(@"module"));
expect(testStruct.sourceAvailable).to(beNil());
+ expect(testStruct.keepContextAvailable).to(beNil());
expect(testStruct.volumeAvailable).to(beNil());
expect(testStruct.equalizerAvailable).to(beNil());
expect(testStruct.equalizerMaxChannelId).to(beNil());
});
it(@"Should set and get correctly", ^ {
- SDLAudioControlCapabilities* testStruct = [[SDLAudioControlCapabilities alloc] initWithModuleName:@"module" sourceAvailable:@NO volueAvailable:@YES equalizerAvailable:@NO equalizerMaxChannelID:@34];
+ SDLAudioControlCapabilities* testStruct = [[SDLAudioControlCapabilities alloc] initWithModuleName:@"module" sourceAvailable:@NO keepContextAvailable:@NO volumeAvailable:@YES equalizerAvailable:@NO equalizerMaxChannelID:@34];
expect(testStruct.moduleName).to(equal(@"module"));
expect(testStruct.sourceAvailable).to(equal(@(NO)));
+ expect(testStruct.keepContextAvailable).to(equal(@NO));
expect(testStruct.volumeAvailable).to(equal(@(YES)));
expect(testStruct.equalizerAvailable).to(equal(@(NO)));
expect(testStruct.equalizerMaxChannelId).to(equal(@34));
@@ -54,6 +58,7 @@ describe(@"Getter/Setter Tests", ^ {
it(@"Should get correctly when initialized", ^ {
NSMutableDictionary* dict = [@{SDLNameModuleName:@"module",
SDLNameSourceAvailable:@(NO),
+ SDLNameKeepContextAvailable: @YES,
SDLNameVolumeAvailable:@(YES),
SDLNameEqualizerAvailable:@(NO),
SDLNameEqualizerMaxChannelId:@12
@@ -62,6 +67,7 @@ describe(@"Getter/Setter Tests", ^ {
expect(testStruct.moduleName).to(equal(@"module"));
expect(testStruct.sourceAvailable).to(equal(@(NO)));
+ expect(testStruct.keepContextAvailable).to(equal(@YES));
expect(testStruct.volumeAvailable).to(equal(@(YES)));
expect(testStruct.equalizerAvailable).to(equal(@(NO)));
expect(testStruct.equalizerMaxChannelId).to(equal(@12));
@@ -73,6 +79,7 @@ describe(@"Getter/Setter Tests", ^ {
expect(testStruct.moduleName).to(beNil());
expect(testStruct.sourceAvailable).to(beNil());
+ expect(testStruct.keepContextAvailable).to(beNil());
expect(testStruct.volumeAvailable).to(beNil());
expect(testStruct.equalizerAvailable).to(beNil());
expect(testStruct.equalizerMaxChannelId).to(beNil());