diff options
author | Joey Grover <joeygrover@gmail.com> | 2018-10-03 15:26:21 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-03 15:26:21 -0400 |
commit | 13e04232a32ba311e0d3a7847b7f1f841f6f10ec (patch) | |
tree | 4a048dd2d01cd62aa05626698a1ed800fafe1daa | |
parent | f434b4e5331cacac98acd6573bce701110fcb229 (diff) | |
parent | 9d8c1d81c7c7cf11095f642703939e93150fb5df (diff) | |
download | sdl_android-13e04232a32ba311e0d3a7847b7f1f841f6f10ec.tar.gz |
Merge pull request #887 from smartdevicelink/feature/add_keepContextAvailable
Add keepContextAvailable parameter
5 files changed, 37 insertions, 7 deletions
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/Test.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/Test.java index b135e3d5d..fccd8fd2e 100644 --- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/Test.java +++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/Test.java @@ -770,6 +770,7 @@ public class Test { GENERAL_AUDIOCONTROLCAPABILITIES.setEqualizerAvailable(GENERAL_BOOLEAN); GENERAL_AUDIOCONTROLCAPABILITIES.setVolumeAvailable(GENERAL_BOOLEAN); GENERAL_AUDIOCONTROLCAPABILITIES.setSourceAvailable(GENERAL_BOOLEAN); + GENERAL_AUDIOCONTROLCAPABILITIES.setKeepContextAvailable(GENERAL_BOOLEAN); GENERAL_AUDIOCONTROLCAPABILITIES.setModuleName(GENERAL_STRING); GENERAL_AUDIOCONTROLCAPABILITIES_LIST.add(GENERAL_AUDIOCONTROLCAPABILITIES); diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/Validator.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/Validator.java index de47a5581..66112be33 100644 --- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/Validator.java +++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/Validator.java @@ -2374,6 +2374,9 @@ public class Validator{ if (item1.getSourceAvailable() != item2.getSourceAvailable()) { return false; } + if (item1.getKeepContextAvailable() != item2.getKeepContextAvailable()) { + return false; + } if (item1.getVolumeAvailable() != item2.getVolumeAvailable()) { return false; } diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioControlCapabilitiesTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioControlCapabilitiesTests.java index 866f43d3e..524a6bde2 100644 --- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioControlCapabilitiesTests.java +++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioControlCapabilitiesTests.java @@ -13,7 +13,7 @@ import java.util.Iterator; /** * This is a unit test class for the SmartDeviceLink library project class : - * {@link com.smartdevicelink.rpc.AudioControlCapabilities} + * {@link com.smartdevicelink.proxy.rpc.AudioControlCapabilities} */ public class AudioControlCapabilitiesTests extends TestCase { @@ -25,6 +25,7 @@ public class AudioControlCapabilitiesTests extends TestCase { msg.setModuleName(Test.GENERAL_STRING); msg.setSourceAvailable(Test.GENERAL_BOOLEAN); + msg.setKeepContextAvailable(Test.GENERAL_BOOLEAN); msg.setVolumeAvailable(Test.GENERAL_BOOLEAN); msg.setEqualizerAvailable(Test.GENERAL_BOOLEAN); msg.setVolumeAvailable(Test.GENERAL_BOOLEAN); @@ -39,6 +40,7 @@ public class AudioControlCapabilitiesTests extends TestCase { String moduleName = msg.getModuleName(); Boolean sourceAvailable = msg.getSourceAvailable(); + Boolean keepContextAvailable = msg.getKeepContextAvailable(); Boolean volumeAvailable = msg.getVolumeAvailable(); Boolean equalizerAvailable = msg.getEqualizerAvailable(); int equalizerMaxChannelId = msg.getEqualizerMaxChannelId(); @@ -46,6 +48,7 @@ public class AudioControlCapabilitiesTests extends TestCase { // Valid Tests assertEquals(Test.MATCH, Test.GENERAL_STRING, moduleName); assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, (boolean) sourceAvailable); + assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, (boolean) keepContextAvailable); assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, (boolean) volumeAvailable); assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, (boolean) equalizerAvailable); assertEquals(Test.MATCH, Test.GENERAL_INT, equalizerMaxChannelId); @@ -56,6 +59,7 @@ public class AudioControlCapabilitiesTests extends TestCase { assertNull(Test.NULL, msg.getModuleName()); assertNull(Test.NULL, msg.getSourceAvailable()); + assertNull(Test.NULL, msg.getKeepContextAvailable()); assertNull(Test.NULL, msg.getVolumeAvailable()); assertNull(Test.NULL, msg.getEqualizerAvailable()); assertNull(Test.NULL, msg.getEqualizerMaxChannelId()); @@ -68,6 +72,7 @@ public class AudioControlCapabilitiesTests extends TestCase { reference.put(AudioControlCapabilities.KEY_MODULE_NAME, Test.GENERAL_STRING); reference.put(AudioControlCapabilities.KEY_SOURCE_AVAILABLE, Test.GENERAL_BOOLEAN); + reference.put(AudioControlCapabilities.KEY_KEEP_CONTEXT_AVAILABLE, Test.GENERAL_BOOLEAN); reference.put(AudioControlCapabilities.KEY_VOLUME_AVAILABLE, Test.GENERAL_BOOLEAN); reference.put(AudioControlCapabilities.KEY_EQUALIZER_AVAILABLE, Test.GENERAL_BOOLEAN); reference.put(AudioControlCapabilities.KEY_EQUALIZER_MAX_CHANNEL_ID, Test.GENERAL_INT); diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AudioControlCapabilities.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AudioControlCapabilities.java index ab1738739..fcaa7bf4c 100644 --- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AudioControlCapabilities.java +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AudioControlCapabilities.java @@ -9,6 +9,7 @@ import java.util.Hashtable; public class AudioControlCapabilities extends RPCStruct { public static final String KEY_MODULE_NAME = "moduleName"; public static final String KEY_SOURCE_AVAILABLE = "sourceAvailable"; + public static final String KEY_KEEP_CONTEXT_AVAILABLE = "keepContextAvailable"; public static final String KEY_VOLUME_AVAILABLE = "volumeAvailable"; public static final String KEY_EQUALIZER_AVAILABLE = "equalizerAvailable"; public static final String KEY_EQUALIZER_MAX_CHANNEL_ID = "equalizerMaxChannelId"; @@ -57,6 +58,24 @@ public class AudioControlCapabilities extends RPCStruct { } /** + * Sets the keepContextAvailable portion of the AudioControlCapabilities class + * + * @param keepContextAvailable Availability of the keepContext parameter. + */ + public void setKeepContextAvailable(Boolean keepContextAvailable) { + setValue(KEY_KEEP_CONTEXT_AVAILABLE, keepContextAvailable); + } + + /** + * Gets the keepContextAvailable portion of the AudioControlCapabilities class + * + * @return Boolean - Availability of the keepContext parameter. + */ + public Boolean getKeepContextAvailable() { + return getBoolean(KEY_KEEP_CONTEXT_AVAILABLE); + } + + /** * Sets the sourceAvailable portion of the AudioControlCapabilities class * * @param sourceAvailable Availability of the control of audio source. diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AudioControlData.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AudioControlData.java index 9403fa9ab..b6ec0bfb1 100644 --- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AudioControlData.java +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AudioControlData.java @@ -53,9 +53,10 @@ public class AudioControlData extends RPCStruct { * Sets the keepContext portion of the AudioControlData class * * @param keepContext This parameter shall not be present in any getter responses or notifications. - * This parameter is optional in a setter request. The default value is false. - * If it is true, the system not only changes the audio source but also brings the default infotainment system UI associated with the audio source to foreground and set the application to background. - * If it is false, the system changes the audio source, but keeps the current application's context. + * This parameter is optional in a setter request. The default value is false if it is not included. + * If it is false, the system not only changes the audio source but also brings the default application or + * system UI associated with the audio source to foreground. + * If it is true, the system only changes the audio source, but keeps the current application in foreground. */ public void setKeepContext(Boolean keepContext) { setValue(KEY_KEEP_CONTEXT, keepContext); @@ -65,9 +66,10 @@ public class AudioControlData extends RPCStruct { * Gets the keepContext portion of the AudioControlData class * * @return Boolean - This parameter shall not be present in any getter responses or notifications. - * This parameter is optional in a setter request. The default value is false. - * If it is true, the system not only changes the audio source but also brings the default infotainment system UI associated with the audio source to foreground and set the application to background. - * If it is false, the system changes the audio source, but keeps the current application's context. + * This parameter is optional in a setter request. The default value is false if it is not included. + * If it is false, the system not only changes the audio source but also brings the default application or + * system UI associated with the audio source to foreground. + * If it is true, the system only changes the audio source, but keeps the current application in foreground. */ public Boolean getKeepContext() { return getBoolean(KEY_KEEP_CONTEXT); |