summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrettyWhite <geekman3454@protonmail.com>2018-08-31 10:12:12 -0400
committerBrettyWhite <geekman3454@protonmail.com>2018-08-31 10:12:12 -0400
commit6ded3f8b767dad572d225795c1eb71bcf35ab626 (patch)
tree346cc20fe15fb6cb66d20d5e3287bc1b6ff34619
parent10c8ae8848086f9280c62457766a0ec086d5e7cc (diff)
parentadebc3a081c1db62ad285a35703e1dc688a29259 (diff)
downloadsdl_android-6ded3f8b767dad572d225795c1eb71bcf35ab626.tar.gz
Merge branch 'develop' into feature/issue_782_Android_Managers
# Conflicts: # sdl_android/build.gradle # sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBase.java
-rw-r--r--.travis.yml1
-rw-r--r--sdl_android/build.gradle8
-rw-r--r--sdl_android/src/androidTest/assets/json/RegisterAppInterface.json3
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/api/VideoStreamingManagerTests.java4
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/Test.java89
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/Validator.java357
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/SystemCapabilityManagerTests.java10
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioControlCapabilitiesTests.java89
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioControlDataTests.java98
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ChoiceTests.java2
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClimateControlCapabilitiesTests.java22
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClimateControlDataTests.java22
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/EqualizerSettingsTests.java78
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMISettingsControlCapabilitiesTests.java80
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMISettingsControlDataTests.java78
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightCapabilitiesTests.java81
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightControlCapabilitiesTests.java86
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightControlDataTests.java79
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightStateTests.java94
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ModuleDataTests.java37
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RadioControlCapabilitiesTests.java7
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RadioControlDataTests.java16
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RemoteControlCapabilitiesTests.java40
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SisDataTests.java105
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/StationIDNumberTests.java73
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DisplayModeTests.java74
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DistanceUnitTests.java69
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LightNameTests.java261
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LightStatusTests.java86
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ModuleTypeTests.java40
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PredefinedLayoutTests.java144
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PrimaryAudioSourceTests.java68
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/StaticIconNameTests.java931
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnHMIStatusTests.java4
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/RegisterAppInterfaceTests.java13
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/MockPacketizer.java6
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/api/SdlManager.java4
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/api/VideoStreamingManager.java6
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/marshal/JsonRPCMarshaller.java9
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/RPCStruct.java81
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBase.java151
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/SystemCapabilityManager.java3
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/interfaces/ISdl.java6
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AudioControlCapabilities.java131
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AudioControlData.java113
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Choice.java52
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ClimateControlCapabilities.java84
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ClimateControlData.java77
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/EqualizerSettings.java97
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GPSData.java53
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/HMISettingsControlCapabilities.java107
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/HMISettingsControlData.java79
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/LightCapabilities.java113
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/LightControlCapabilities.java78
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/LightControlData.java58
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/LightState.java119
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ModuleData.java57
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnHMIStatus.java18
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RadioControlCapabilities.java21
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RadioControlData.java19
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterface.java89
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterfaceResponse.java34
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RemoteControlCapabilities.java58
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SdlMsgVersion.java10
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SisData.java123
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/StationIDNumber.java54
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/DisplayMode.java16
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/DistanceUnit.java15
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/LightName.java134
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/LightStatus.java19
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/ModuleType.java3
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/PredefinedLayout.java140
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/PrimaryAudioSource.java29
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/StaticIconName.java910
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/streaming/AbstractPacketizer.java22
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/streaming/StreamRPCPacketizer.java26
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/transport/SdlBroadcastReceiver.java7
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterService.java132
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/util/Version.java6
-rw-r--r--sdl_android/src/main/res/values/sdl.xml2
80 files changed, 6381 insertions, 239 deletions
diff --git a/.travis.yml b/.travis.yml
index f138933a0..57284b065 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -13,6 +13,7 @@ android:
- build-tools-27.0.3
# The SDK version used to compile your project
+ - android-27
- android-26
- android-22 #For emulator
# Specify at least one system image,
diff --git a/sdl_android/build.gradle b/sdl_android/build.gradle
index d8cdb8baf..a215ec62b 100644
--- a/sdl_android/build.gradle
+++ b/sdl_android/build.gradle
@@ -1,12 +1,12 @@
apply plugin: 'com.android.library'
android {
- compileSdkVersion 26
+ compileSdkVersion 27
defaultConfig {
minSdkVersion 8
targetSdkVersion 19
- versionCode 5
- versionName "4.6.1"
+ versionCode 7
+ versionName "4.6.3"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
resValue "string", "SDL_LIB_VERSION", '\"' + versionName + '\"'
}
@@ -55,4 +55,4 @@ buildscript {
}
}
-apply from: 'bintray.gradle' \ No newline at end of file
+apply from: 'bintray.gradle'
diff --git a/sdl_android/src/androidTest/assets/json/RegisterAppInterface.json b/sdl_android/src/androidTest/assets/json/RegisterAppInterface.json
index 3a6484a5f..1d13635a9 100644
--- a/sdl_android/src/androidTest/assets/json/RegisterAppInterface.json
+++ b/sdl_android/src/androidTest/assets/json/RegisterAppInterface.json
@@ -18,7 +18,8 @@
"SOCIAL",
"MEDIA"
],
- "appID":"t4weGRSWY",
+ "appID":"123e4567e8",
+ "fullAppID":"123e4567-e89b-12d3-a456-426655440000",
"languageDesired":"PT-BR",
"deviceInfo":{
"hardware":"My Hardware",
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/api/VideoStreamingManagerTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/api/VideoStreamingManagerTests.java
index f329d3609..1f7904fe1 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/api/VideoStreamingManagerTests.java
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/api/VideoStreamingManagerTests.java
@@ -122,7 +122,7 @@ public class VideoStreamingManagerTests extends AndroidTestCase {
public void testHMILevelNotFull(){
ISdl internalInterface = mock(ISdl.class);
- when(internalInterface.getProtocolVersion()).thenReturn(new Version("5.0.0"));
+ when(internalInterface.getWiProVersion()).thenReturn((byte)5);
when(internalInterface.isCapabilitySupported(SystemCapabilityType.VIDEO_STREAMING)).thenReturn(true);
final VideoStreamingManager videoStreamingManager = new VideoStreamingManager(internalInterface);
@@ -140,7 +140,7 @@ public class VideoStreamingManagerTests extends AndroidTestCase {
final Set<Object> listenerSet = new HashSet<>();
- when(internalInterface.getProtocolVersion()).thenReturn(new Version("5.0.0"));
+ when(internalInterface.getWiProVersion()).thenReturn((byte)5);
when(internalInterface.isCapabilitySupported(SystemCapabilityType.VIDEO_STREAMING)).thenReturn(true);
Answer<Void> onGetCapability = new Answer<Void>() {
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 c52f4d503..a3938982c 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/Test.java
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/Test.java
@@ -5,6 +5,8 @@ import android.util.Log;
import com.smartdevicelink.api.lockscreen.LockScreenConfig;
import com.smartdevicelink.proxy.TTSChunkFactory;
+import com.smartdevicelink.proxy.rpc.AudioControlCapabilities;
+import com.smartdevicelink.proxy.rpc.AudioControlData;
import com.smartdevicelink.proxy.rpc.AudioPassThruCapabilities;
import com.smartdevicelink.proxy.rpc.ButtonCapabilities;
import com.smartdevicelink.proxy.rpc.Choice;
@@ -14,13 +16,20 @@ import com.smartdevicelink.proxy.rpc.Coordinate;
import com.smartdevicelink.proxy.rpc.DIDResult;
import com.smartdevicelink.proxy.rpc.DeviceInfo;
import com.smartdevicelink.proxy.rpc.DisplayCapabilities;
+import com.smartdevicelink.proxy.rpc.EqualizerSettings;
import com.smartdevicelink.proxy.rpc.HMICapabilities;
import com.smartdevicelink.proxy.rpc.HMIPermissions;
+import com.smartdevicelink.proxy.rpc.HMISettingsControlCapabilities;
+import com.smartdevicelink.proxy.rpc.HMISettingsControlData;
import com.smartdevicelink.proxy.rpc.HapticRect;
import com.smartdevicelink.proxy.rpc.Image;
import com.smartdevicelink.proxy.rpc.ImageField;
import com.smartdevicelink.proxy.rpc.ImageResolution;
import com.smartdevicelink.proxy.rpc.KeyboardProperties;
+import com.smartdevicelink.proxy.rpc.LightCapabilities;
+import com.smartdevicelink.proxy.rpc.LightControlCapabilities;
+import com.smartdevicelink.proxy.rpc.LightControlData;
+import com.smartdevicelink.proxy.rpc.LightState;
import com.smartdevicelink.proxy.rpc.LocationDetails;
import com.smartdevicelink.proxy.rpc.MassageCushionFirmness;
import com.smartdevicelink.proxy.rpc.MassageModeData;
@@ -45,9 +54,11 @@ import com.smartdevicelink.proxy.rpc.SeatControlCapabilities;
import com.smartdevicelink.proxy.rpc.SeatControlData;
import com.smartdevicelink.proxy.rpc.SeatMemoryAction;
import com.smartdevicelink.proxy.rpc.SingleTireStatus;
+import com.smartdevicelink.proxy.rpc.SisData;
import com.smartdevicelink.proxy.rpc.SoftButton;
import com.smartdevicelink.proxy.rpc.SoftButtonCapabilities;
import com.smartdevicelink.proxy.rpc.StartTime;
+import com.smartdevicelink.proxy.rpc.StationIDNumber;
import com.smartdevicelink.proxy.rpc.SystemCapability;
import com.smartdevicelink.proxy.rpc.TTSChunk;
import com.smartdevicelink.proxy.rpc.Temperature;
@@ -79,7 +90,9 @@ import com.smartdevicelink.proxy.rpc.enums.ComponentVolumeStatus;
import com.smartdevicelink.proxy.rpc.enums.DefrostZone;
import com.smartdevicelink.proxy.rpc.enums.DeviceLevelStatus;
import com.smartdevicelink.proxy.rpc.enums.Dimension;
+import com.smartdevicelink.proxy.rpc.enums.DisplayMode;
import com.smartdevicelink.proxy.rpc.enums.DisplayType;
+import com.smartdevicelink.proxy.rpc.enums.DistanceUnit;
import com.smartdevicelink.proxy.rpc.enums.DriverDistractionState;
import com.smartdevicelink.proxy.rpc.enums.ECallConfirmationStatus;
import com.smartdevicelink.proxy.rpc.enums.EmergencyEventType;
@@ -99,6 +112,8 @@ import com.smartdevicelink.proxy.rpc.enums.KeyboardLayout;
import com.smartdevicelink.proxy.rpc.enums.KeypressMode;
import com.smartdevicelink.proxy.rpc.enums.Language;
import com.smartdevicelink.proxy.rpc.enums.LayoutMode;
+import com.smartdevicelink.proxy.rpc.enums.LightName;
+import com.smartdevicelink.proxy.rpc.enums.LightStatus;
import com.smartdevicelink.proxy.rpc.enums.LockScreenStatus;
import com.smartdevicelink.proxy.rpc.enums.MassageCushion;
import com.smartdevicelink.proxy.rpc.enums.MassageMode;
@@ -283,23 +298,39 @@ public class Test {
public static final DriverDistractionState GENERAL_DRIVERDISTRACTIONSTATE = DriverDistractionState.DD_ON;
public static final List<LocationDetails> GENERAL_LOCATIONDETAILS_LIST = Arrays.asList(new LocationDetails[] { Test.GENERAL_LOCATIONDETAILS, Test.GENERAL_LOCATIONDETAILS});
public static final AudioStreamingIndicator GENERAL_AUDIO_STREAMING_INDICATOR = AudioStreamingIndicator.PLAY;
-
+ public static final String GENERAL_APP_ID = "123e4567e8";
+ public static final String GENERAL_FULL_APP_ID = "123e4567-e89b-12d3-a456-426655440000";
public static final ModuleType GENERAL_MODULETYPE = ModuleType.CLIMATE;
public static final Temperature GENERAL_TEMPERATURE = new Temperature();
public static final TemperatureUnit GENERAL_TEMPERATUREUNIT = TemperatureUnit.CELSIUS;
public static final DefrostZone GENERAL_DEFROSTZONE = DefrostZone.ALL;
public static final VentilationMode GENERAL_VENTILATIONMODE = VentilationMode.BOTH;
+ public static final LightName GENERAL_LIGHTNAME = LightName.AMBIENT_LIGHTS;
+ public static final DisplayMode GENERAL_DISPLAYMODE = DisplayMode.AUTO;
+ public static final DistanceUnit GENERAL_DISTANCEUNIT = DistanceUnit.KILOMETERS;
+ public static final LightStatus GENERAL_LIGHTSTATUS = LightStatus.OFF;
public static final RadioBand GENERAL_RADIOBAND = RadioBand.AM;
public static final ClimateControlData GENERAL_CLIMATECONTROLDATA = new ClimateControlData();
public static final SeatControlData GENERAL_SEATCONTROLDATA = new SeatControlData();
public static final RdsData GENERAL_RDSDATA = new RdsData();
+ public static final StationIDNumber GENERAL_STATIONIDNUMBER = new StationIDNumber();
+ public static final SisData GENERAL_SISDATA = new SisData();
public static final RadioState GENERAL_RADIOSTATE = RadioState.ACQUIRED;
public static final RadioControlData GENERAL_RADIOCONTROLDATA = new RadioControlData();
public static final ModuleData GENERAL_MODULEDATA = new ModuleData();
public static final ClimateControlCapabilities GENERAL_CLIMATECONTROLCAPABILITIES = new ClimateControlCapabilities();
public static final RadioControlCapabilities GENERAL_RADIOCONTROLCAPABILITIES = new RadioControlCapabilities();
public static final SeatControlCapabilities GENERAL_SEATCONTROLCAPABILITIES = new SeatControlCapabilities();
+ public static final EqualizerSettings GENERAL_EQUALIZERSETTINGS = new EqualizerSettings();
+ public static final LightCapabilities GENERAL_LIGHTCAPABILITIES = new LightCapabilities();
+ public static final LightState GENERAL_LIGHTSTATE = new LightState();
+ public static final AudioControlCapabilities GENERAL_AUDIOCONTROLCAPABILITIES = new AudioControlCapabilities();
+ public static final HMISettingsControlCapabilities GENERAL_HMISETTINGSCONTROLCAPABILITIES = new HMISettingsControlCapabilities();
+ public static final LightControlCapabilities GENERAL_LIGHTCONTROLCAPABILITIES = new LightControlCapabilities();
+ public static final AudioControlData GENERAL_AUDIOCONTROLDATA = new AudioControlData();
+ public static final LightControlData GENERAL_LIGHTCONTROLDATA = new LightControlData();
+ public static final HMISettingsControlData GENERAL_HMISETTINGSCONTROLDATA = new HMISettingsControlData();
public static final HMICapabilities GENERAL_HMICAPABILITIES = new HMICapabilities();
@@ -346,6 +377,10 @@ public class Test {
public static final Vector<String> GENERAL_VECTOR_STRING = new Vector<>(Arrays.asList(new String[] { "a", "b"}));
public static final Vector<TTSChunk> GENERAL_VECTOR_TTS_CHUNKS = new Vector<>(Arrays.asList(TTSChunkFactory.createChunk(SpeechCapabilities.TEXT, "Welcome to the jungle")));
public static final List<SeatControlCapabilities> GENERAL_SEATCONTROLCAPABILITIES_LIST = new ArrayList<SeatControlCapabilities>(1);
+ public static final List<EqualizerSettings> GENERAL_EQUALIZERSETTINGS_LIST = new ArrayList<EqualizerSettings>(1);
+ public static final List<LightCapabilities> GENERAL_LIGHTCAPABILITIES_LIST = new ArrayList<LightCapabilities>(1);
+ public static final List<LightState> GENERAL_LIGHTSTATE_LIST = new ArrayList<LightState>(1);
+ public static final List<AudioControlCapabilities> GENERAL_AUDIOCONTROLCAPABILITIES_LIST = new ArrayList<AudioControlCapabilities>(1);
public static final JSONArray JSON_TURNS = new JSONArray();
public static final JSONArray JSON_CHOICES = new JSONArray();
@@ -436,6 +471,27 @@ public class Test {
GENERAL_SEATCONTROLDATA.setCoolingEnabled(GENERAL_BOOLEAN);
GENERAL_SEATCONTROLDATA.setId(GENERAL_SUPPORTEDSEAT);
+ GENERAL_AUDIOCONTROLDATA.setSource(GENERAL_PRIMARYAUDIOSOURCE);
+ GENERAL_AUDIOCONTROLDATA.setVolume(GENERAL_INT);
+ GENERAL_AUDIOCONTROLDATA.setKeepContext(GENERAL_BOOLEAN);
+ GENERAL_AUDIOCONTROLDATA.setEqualizerSettings(GENERAL_EQUALIZERSETTINGS_LIST);
+
+ GENERAL_HMISETTINGSCONTROLDATA.setDistanceUnit(GENERAL_DISTANCEUNIT);
+ GENERAL_HMISETTINGSCONTROLDATA.setTemperatureUnit(GENERAL_TEMPERATUREUNIT);
+ GENERAL_HMISETTINGSCONTROLDATA.setDisplayMode(GENERAL_DISPLAYMODE);
+
+ GENERAL_LIGHTCONTROLDATA.setLightState(GENERAL_LIGHTSTATE_LIST);
+
+ GENERAL_STATIONIDNUMBER.setCountryCode(GENERAL_INT);
+ GENERAL_STATIONIDNUMBER.setFccFacilityId(GENERAL_INT);
+
+ GENERAL_SISDATA.setStationMessage(GENERAL_STRING);
+ GENERAL_SISDATA.setStationLocation(VehicleDataHelper.GPS);
+
+ GENERAL_SISDATA.setStationLongName(GENERAL_STRING);
+ GENERAL_SISDATA.setStationIDNumber(GENERAL_STATIONIDNUMBER);
+ GENERAL_SISDATA.setStationShortName(GENERAL_STRING);
+
GENERAL_RDSDATA.setProgramService(GENERAL_STRING);
GENERAL_RDSDATA.setRadioText(GENERAL_STRING);
GENERAL_RDSDATA.setClockText(GENERAL_STRING);
@@ -710,6 +766,37 @@ public class Test {
GENERAL_SEATCONTROLCAPABILITIES.setModuleName(GENERAL_STRING);
GENERAL_SEATCONTROLCAPABILITIES_LIST.add(GENERAL_SEATCONTROLCAPABILITIES);
+ GENERAL_AUDIOCONTROLCAPABILITIES.setEqualizerMaxChannelId(GENERAL_INT);
+ GENERAL_AUDIOCONTROLCAPABILITIES.setEqualizerAvailable(GENERAL_BOOLEAN);
+ GENERAL_AUDIOCONTROLCAPABILITIES.setVolumeAvailable(GENERAL_BOOLEAN);
+ GENERAL_AUDIOCONTROLCAPABILITIES.setSourceAvailable(GENERAL_BOOLEAN);
+ GENERAL_AUDIOCONTROLCAPABILITIES.setModuleName(GENERAL_STRING);
+ GENERAL_AUDIOCONTROLCAPABILITIES_LIST.add(GENERAL_AUDIOCONTROLCAPABILITIES);
+
+ GENERAL_HMISETTINGSCONTROLCAPABILITIES.setDisplayModeUnitAvailable(GENERAL_BOOLEAN);
+ GENERAL_HMISETTINGSCONTROLCAPABILITIES.setDistanceUnitAvailable(GENERAL_BOOLEAN);
+ GENERAL_HMISETTINGSCONTROLCAPABILITIES.setTemperatureUnitAvailable(GENERAL_BOOLEAN);
+ GENERAL_HMISETTINGSCONTROLCAPABILITIES.setModuleName(GENERAL_STRING);
+
+ GENERAL_LIGHTCONTROLCAPABILITIES.setSupportedLights(GENERAL_LIGHTCAPABILITIES_LIST);
+ GENERAL_LIGHTCONTROLCAPABILITIES.setModuleName(GENERAL_STRING);
+
+ GENERAL_EQUALIZERSETTINGS.setChannelSetting(GENERAL_INT);
+ GENERAL_EQUALIZERSETTINGS.setChannelName(GENERAL_STRING);
+ GENERAL_EQUALIZERSETTINGS.setChannelId(GENERAL_INT);
+ GENERAL_EQUALIZERSETTINGS_LIST.add(GENERAL_EQUALIZERSETTINGS);
+
+ GENERAL_LIGHTCAPABILITIES.setName(GENERAL_LIGHTNAME);
+ GENERAL_LIGHTCAPABILITIES.setDensityAvailable(GENERAL_BOOLEAN);
+ GENERAL_LIGHTCAPABILITIES.setRGBColorSpaceAvailable(GENERAL_BOOLEAN);
+ GENERAL_LIGHTCAPABILITIES_LIST.add(GENERAL_LIGHTCAPABILITIES);
+
+ GENERAL_LIGHTSTATE.setId(GENERAL_LIGHTNAME);
+ GENERAL_LIGHTSTATE.setDensity(GENERAL_FLOAT);
+ GENERAL_LIGHTSTATE.setStatus(GENERAL_LIGHTSTATUS);
+ GENERAL_LIGHTSTATE.setColor(GENERAL_RGBCOLOR);
+ GENERAL_LIGHTSTATE_LIST.add(GENERAL_LIGHTSTATE);
+
GENERAL_REMOTECONTROLCAPABILITIES.setButtonCapabilities(GENERAL_BUTTONCAPABILITIES_LIST);
GENERAL_REMOTECONTROLCAPABILITIES.setClimateControlCapabilities(GENERAL_CLIMATECONTROLCAPABILITIES_LIST);
GENERAL_REMOTECONTROLCAPABILITIES.setRadioControlCapabilities(GENERAL_RADIOCONTROLCAPABILITIES_LIST);
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 3786f0ca6..7c9c665ca 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/Validator.java
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/Validator.java
@@ -5,6 +5,8 @@ import com.smartdevicelink.protocol.enums.FrameDataControlFrameType;
import com.smartdevicelink.protocol.enums.FrameType;
import com.smartdevicelink.protocol.enums.SessionType;
import com.smartdevicelink.proxy.rpc.AirbagStatus;
+import com.smartdevicelink.proxy.rpc.AudioControlCapabilities;
+import com.smartdevicelink.proxy.rpc.AudioControlData;
import com.smartdevicelink.proxy.rpc.AudioPassThruCapabilities;
import com.smartdevicelink.proxy.rpc.BeltStatus;
import com.smartdevicelink.proxy.rpc.BodyInformation;
@@ -20,16 +22,23 @@ import com.smartdevicelink.proxy.rpc.DeviceStatus;
import com.smartdevicelink.proxy.rpc.DisplayCapabilities;
import com.smartdevicelink.proxy.rpc.ECallInfo;
import com.smartdevicelink.proxy.rpc.EmergencyEvent;
+import com.smartdevicelink.proxy.rpc.EqualizerSettings;
import com.smartdevicelink.proxy.rpc.FuelRange;
import com.smartdevicelink.proxy.rpc.GPSData;
import com.smartdevicelink.proxy.rpc.HMICapabilities;
import com.smartdevicelink.proxy.rpc.HMIPermissions;
+import com.smartdevicelink.proxy.rpc.HMISettingsControlCapabilities;
+import com.smartdevicelink.proxy.rpc.HMISettingsControlData;
import com.smartdevicelink.proxy.rpc.HeadLampStatus;
import com.smartdevicelink.proxy.rpc.Headers;
import com.smartdevicelink.proxy.rpc.Image;
import com.smartdevicelink.proxy.rpc.ImageField;
import com.smartdevicelink.proxy.rpc.ImageResolution;
import com.smartdevicelink.proxy.rpc.KeyboardProperties;
+import com.smartdevicelink.proxy.rpc.LightCapabilities;
+import com.smartdevicelink.proxy.rpc.LightControlCapabilities;
+import com.smartdevicelink.proxy.rpc.LightControlData;
+import com.smartdevicelink.proxy.rpc.LightState;
import com.smartdevicelink.proxy.rpc.MassageCushionFirmness;
import com.smartdevicelink.proxy.rpc.MassageModeData;
import com.smartdevicelink.proxy.rpc.MenuParams;
@@ -53,9 +62,11 @@ import com.smartdevicelink.proxy.rpc.SeatControlCapabilities;
import com.smartdevicelink.proxy.rpc.SeatControlData;
import com.smartdevicelink.proxy.rpc.SeatMemoryAction;
import com.smartdevicelink.proxy.rpc.SingleTireStatus;
+import com.smartdevicelink.proxy.rpc.SisData;
import com.smartdevicelink.proxy.rpc.SoftButton;
import com.smartdevicelink.proxy.rpc.SoftButtonCapabilities;
import com.smartdevicelink.proxy.rpc.StartTime;
+import com.smartdevicelink.proxy.rpc.StationIDNumber;
import com.smartdevicelink.proxy.rpc.TTSChunk;
import com.smartdevicelink.proxy.rpc.Temperature;
import com.smartdevicelink.proxy.rpc.TemplateColorScheme;
@@ -637,6 +648,52 @@ public class Validator{
return true;
}
+ public static boolean validateHMISettingsControlCapabilities(HMISettingsControlCapabilities hmiSettingsControlCapabilities1, HMISettingsControlCapabilities hmiSettingsControlCapabilities2){
+ if(hmiSettingsControlCapabilities1 == null){
+ return ( hmiSettingsControlCapabilities2 == null );
+ }
+ if(hmiSettingsControlCapabilities2 == null){
+ return ( hmiSettingsControlCapabilities1 == null );
+ }
+
+ if(hmiSettingsControlCapabilities1.getModuleName() != hmiSettingsControlCapabilities2.getModuleName()){
+ return false;
+ }
+
+ if(hmiSettingsControlCapabilities1.getDisplayModeUnitAvailable() != hmiSettingsControlCapabilities2.getDisplayModeUnitAvailable()){
+ return false;
+ }
+
+ if(hmiSettingsControlCapabilities1.getDistanceUnitAvailable() != hmiSettingsControlCapabilities2.getDistanceUnitAvailable()){
+ return false;
+ }
+
+ if(hmiSettingsControlCapabilities1.getTemperatureUnitAvailable() != hmiSettingsControlCapabilities2.getTemperatureUnitAvailable()){
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateLightControlCapabilities(LightControlCapabilities lightControlCapabilities1, LightControlCapabilities lightControlCapabilities2){
+ if(lightControlCapabilities1 == null){
+ return ( lightControlCapabilities2 == null );
+ }
+ if(lightControlCapabilities2 == null){
+ return ( lightControlCapabilities1 == null );
+ }
+
+ if(lightControlCapabilities1.getModuleName() != lightControlCapabilities2.getModuleName()){
+ return false;
+ }
+
+ if(!( validateLightCapabilitiesList(lightControlCapabilities1.getSupportedLights(), lightControlCapabilities2.getSupportedLights()) )){
+ return false;
+ }
+
+ return true;
+ }
+
public static boolean validateClimateControlData(ClimateControlData climateControlData1, ClimateControlData climateControlData2){
if(climateControlData1 == null){
return ( climateControlData2 == null );
@@ -769,6 +826,72 @@ public class Validator{
return true;
}
+ public static boolean validateAudioControlData(AudioControlData audioControlData1, AudioControlData audioControlData2) {
+ if (audioControlData1 == null) {
+ return (audioControlData2 == null);
+ }
+ if (audioControlData2 == null) {
+ return (audioControlData1 == null);
+ }
+
+ if (audioControlData1.getKeepContext() != audioControlData2.getKeepContext()) {
+ return false;
+ }
+
+ if (audioControlData1.getSource() != audioControlData2.getSource()) {
+ return false;
+ }
+
+ if (audioControlData1.getVolume() != audioControlData2.getVolume()) {
+ return false;
+ }
+
+ if (!(validateEqualizerSettingsList(audioControlData1.getEqualizerSettings(), audioControlData2.getEqualizerSettings()))) {
+ return false;
+ }
+
+
+ return true;
+ }
+
+ public static boolean validateHMISettingsControlData(HMISettingsControlData hmiSettingsControlData1, HMISettingsControlData hmiSettingsControlData2) {
+ if (hmiSettingsControlData1 == null) {
+ return (hmiSettingsControlData2 == null);
+ }
+ if (hmiSettingsControlData2 == null) {
+ return (hmiSettingsControlData1 == null);
+ }
+
+ if (hmiSettingsControlData1.getDisplayMode() != hmiSettingsControlData2.getDisplayMode()) {
+ return false;
+ }
+
+ if (hmiSettingsControlData1.getDistanceUnit() != hmiSettingsControlData2.getDistanceUnit()) {
+ return false;
+ }
+
+ if (hmiSettingsControlData1.getTemperatureUnit() != hmiSettingsControlData2.getTemperatureUnit()) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateLightControlData(LightControlData lightControlData1, LightControlData lightControlData2) {
+ if (lightControlData1 == null) {
+ return (lightControlData2 == null);
+ }
+ if (lightControlData2 == null) {
+ return (lightControlData1 == null);
+ }
+
+ if (!(validateLightStateList(lightControlData1.getLightState(), lightControlData2.getLightState()))) {
+ return false;
+ }
+
+ return true;
+ }
+
public static boolean validateModuleData(ModuleData moduleData1, ModuleData moduleData2){
if(moduleData1 == null){
return ( moduleData2 == null );
@@ -795,6 +918,56 @@ public class Validator{
return true;
}
+ public static boolean validateSisData(SisData sisData1, SisData sisData2) {
+ if (sisData1 == null) {
+ return (sisData2 == null);
+ }
+ if (sisData2 == null) {
+ return (sisData1 == null);
+ }
+
+ if (sisData1.getStationShortName() != sisData2.getStationShortName()) {
+ return false;
+ }
+
+ if (!(validateStationIDNumber(sisData1.getStationIDNumber(), sisData2.getStationIDNumber()))) {
+ return false;
+ }
+
+ if (sisData1.getStationLongName() != sisData2.getStationLongName()) {
+ return false;
+ }
+
+ if (!(validateGpsData(sisData1.getStationLocation(), sisData2.getStationLocation()))) {
+ return false;
+ }
+
+ if (sisData1.getStationMessage() != sisData2.getStationMessage()) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateStationIDNumber(StationIDNumber stationIDNumber1, StationIDNumber stationIDNumber2){
+ if(stationIDNumber1 == null){
+ return ( stationIDNumber2 == null );
+ }
+ if(stationIDNumber2 == null){
+ return ( stationIDNumber1 == null );
+ }
+
+ if(stationIDNumber1.getCountryCode() != stationIDNumber2.getCountryCode()){
+ return false;
+ }
+
+ if(stationIDNumber1.getFccFacilityId() != stationIDNumber2.getFccFacilityId()){
+ return false;
+ }
+
+ return true;
+ }
+
public static boolean validateRemoteControlCapabilities(RemoteControlCapabilities remoteControlCapabilities1, RemoteControlCapabilities remoteControlCapabilities2){
if(remoteControlCapabilities1 == null){
return ( remoteControlCapabilities2 == null );
@@ -2145,6 +2318,190 @@ public class Validator{
return true;
}
+ public static boolean validateAudioControlCapabilities(AudioControlCapabilities item1, AudioControlCapabilities item2) {
+ if (item1 == null) {
+ return (item2 == null);
+ }
+ if (item2 == null) {
+ return (item1 == null);
+ }
+
+ if (item1.getModuleName() != item2.getModuleName()) {
+ return false;
+ }
+ if (item1.getSourceAvailable() != item2.getSourceAvailable()) {
+ return false;
+ }
+ if (item1.getVolumeAvailable() != item2.getVolumeAvailable()) {
+ return false;
+ }
+ if (item1.getEqualizerAvailable() != item2.getEqualizerAvailable()) {
+ return false;
+ }
+ if (item1.getEqualizerMaxChannelId() != item2.getEqualizerMaxChannelId()) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateEqualizerSettingsList(List<EqualizerSettings> item1, List<EqualizerSettings> item2) {
+ if (item1 == null) {
+ return (item2 == null);
+ }
+ if (item2 == null) {
+ return (item1 == null);
+ }
+
+ if (item1.size() != item2.size()) {
+ return false;
+ }
+
+ for (int i = 0; i < item1.size(); i++) {
+ if (!validateEqualizerSettings(item1.get(i), item2.get(i))) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public static boolean validateEqualizerSettings(EqualizerSettings item1, EqualizerSettings item2) {
+ if (item1 == null) {
+ return (item2 == null);
+ }
+ if (item2 == null) {
+ return (item1 == null);
+ }
+
+ if (item1.getChannelId() != item2.getChannelId()) {
+ return false;
+ }
+
+ if (item1.getChannelName() != item2.getChannelName()) {
+ return false;
+ }
+
+ if (item1.getChannelSetting() != item2.getChannelSetting()) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateLightStateList(List<LightState> item1, List<LightState> item2) {
+ if (item1 == null) {
+ return (item2 == null);
+ }
+ if (item2 == null) {
+ return (item1 == null);
+ }
+
+ if (item1.size() != item2.size()) {
+ return false;
+ }
+
+ for (int i = 0; i < item1.size(); i++) {
+ if (!validateLightState(item1.get(i), item2.get(i))) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public static boolean validateLightState(LightState item1, LightState item2) {
+ if (item1 == null) {
+ return (item2 == null);
+ }
+ if (item2 == null) {
+ return (item1 == null);
+ }
+
+ if (item1.getId() != item2.getId()) {
+ return false;
+ }
+
+ if (item1.getStatus() != item2.getStatus()) {
+ return false;
+ }
+
+ if (item1.getDensity() != item2.getDensity()) {
+ return false;
+ }
+
+ if (!(validateRGBColor(item1.getColor(), item2.getColor()))) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateLightCapabilitiesList(List<LightCapabilities> item1, List<LightCapabilities> item2) {
+ if (item1 == null) {
+ return (item2 == null);
+ }
+ if (item2 == null) {
+ return (item1 == null);
+ }
+
+ if (item1.size() != item2.size()) {
+ return false;
+ }
+
+ for (int i = 0; i < item1.size(); i++) {
+ if (!validateLightCapabilities(item1.get(i), item2.get(i))) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public static boolean validateLightCapabilities(LightCapabilities item1, LightCapabilities item2) {
+ if (item1 == null) {
+ return (item2 == null);
+ }
+ if (item2 == null) {
+ return (item1 == null);
+ }
+
+ if (item1.getName() != item2.getName()) {
+ return false;
+ }
+
+ if (item1.getDensityAvailable() != item2.getDensityAvailable()) {
+ return false;
+ }
+
+ if (item1.getRGBColorSpaceAvailable() != item2.getRGBColorSpaceAvailable()) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean validateAudioControlCapabilitiesList(List<AudioControlCapabilities> item1, List<AudioControlCapabilities> item2) {
+ if (item1 == null) {
+ return (item2 == null);
+ }
+ if (item2 == null) {
+ return (item1 == null);
+ }
+
+ if (item1.size() != item2.size()) {
+ return false;
+ }
+
+ for (int i = 0; i < item1.size(); i++) {
+ if (!validateAudioControlCapabilities(item1.get(i), item2.get(i))) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
public static boolean validateDefrostZones (List<DefrostZone> item1, List<DefrostZone> item2) {
if (item1 == null) {
return ( item2 == null );
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/SystemCapabilityManagerTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/SystemCapabilityManagerTests.java
index 9d5f3a74c..d3768c53b 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/SystemCapabilityManagerTests.java
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/SystemCapabilityManagerTests.java
@@ -139,6 +139,12 @@ public class SystemCapabilityManagerTests extends AndroidTestCase {
}
+ public void testFalsePositive(){
+ SystemCapabilityManager systemCapabilityManager = createSampleManager();
+ systemCapabilityManager.setCapability(SystemCapabilityType.AUDIO_PASSTHROUGH, null);
+ assertFalse(systemCapabilityManager.isCapabilitySupported(SystemCapabilityType.AUDIO_PASSTHROUGH));
+ }
+
private class InternalSDLInterface implements ISdl{
@Override
public void start(){}
@@ -196,8 +202,8 @@ public class SystemCapabilityManagerTests extends AndroidTestCase {
}
@Override
- public Version getProtocolVersion() {
- return null;
+ public byte getWiProVersion() {
+ return 0;
}
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
new file mode 100644
index 000000000..866f43d3e
--- /dev/null
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioControlCapabilitiesTests.java
@@ -0,0 +1,89 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.AudioControlCapabilities;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+
+import junit.framework.TestCase;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Iterator;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.AudioControlCapabilities}
+ */
+public class AudioControlCapabilitiesTests extends TestCase {
+
+ private AudioControlCapabilities msg;
+
+ @Override
+ public void setUp() {
+ msg = new AudioControlCapabilities();
+
+ msg.setModuleName(Test.GENERAL_STRING);
+ msg.setSourceAvailable(Test.GENERAL_BOOLEAN);
+ msg.setVolumeAvailable(Test.GENERAL_BOOLEAN);
+ msg.setEqualizerAvailable(Test.GENERAL_BOOLEAN);
+ msg.setVolumeAvailable(Test.GENERAL_BOOLEAN);
+ msg.setEqualizerMaxChannelId(Test.GENERAL_INT);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues() {
+ // Test Values
+
+ String moduleName = msg.getModuleName();
+ Boolean sourceAvailable = msg.getSourceAvailable();
+ Boolean volumeAvailable = msg.getVolumeAvailable();
+ Boolean equalizerAvailable = msg.getEqualizerAvailable();
+ int equalizerMaxChannelId = msg.getEqualizerMaxChannelId();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, moduleName);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, (boolean) sourceAvailable);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, (boolean) volumeAvailable);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, (boolean) equalizerAvailable);
+ assertEquals(Test.MATCH, Test.GENERAL_INT, equalizerMaxChannelId);
+
+ // Invalid/Null Tests
+ AudioControlCapabilities msg = new AudioControlCapabilities();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getModuleName());
+ assertNull(Test.NULL, msg.getSourceAvailable());
+ assertNull(Test.NULL, msg.getVolumeAvailable());
+ assertNull(Test.NULL, msg.getEqualizerAvailable());
+ assertNull(Test.NULL, msg.getEqualizerMaxChannelId());
+ }
+
+ public void testJson() {
+ JSONObject reference = new JSONObject();
+
+ try {
+
+ reference.put(AudioControlCapabilities.KEY_MODULE_NAME, Test.GENERAL_STRING);
+ reference.put(AudioControlCapabilities.KEY_SOURCE_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);
+
+ JSONObject underTest = msg.serializeJSON();
+ assertEquals(Test.MATCH, reference.length(), underTest.length());
+
+ Iterator<?> iterator = reference.keys();
+ while (iterator.hasNext()) {
+ String key = (String) iterator.next();
+
+ assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key));
+
+ }
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioControlDataTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioControlDataTests.java
new file mode 100644
index 000000000..4dba080ac
--- /dev/null
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/AudioControlDataTests.java
@@ -0,0 +1,98 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.proxy.rpc.AudioControlData;
+import com.smartdevicelink.proxy.rpc.EqualizerSettings;
+import com.smartdevicelink.proxy.rpc.enums.PrimaryAudioSource;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+
+import junit.framework.TestCase;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.AudioControlData}
+ */
+public class AudioControlDataTests extends TestCase {
+
+ private AudioControlData msg;
+
+ @Override
+ public void setUp() {
+ msg = new AudioControlData();
+
+ msg.setSource(Test.GENERAL_PRIMARYAUDIOSOURCE);
+ msg.setKeepContext(Test.GENERAL_BOOLEAN);
+ msg.setVolume(Test.GENERAL_INT);
+ msg.setEqualizerSettings(Test.GENERAL_EQUALIZERSETTINGS_LIST);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues() {
+ // Test Values
+ PrimaryAudioSource source = msg.getSource();
+ Boolean keepContext = msg.getKeepContext();
+ int volume = msg.getVolume();
+ List<EqualizerSettings> equalizerSettings = msg.getEqualizerSettings();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_PRIMARYAUDIOSOURCE, source);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, (boolean) keepContext);
+ assertEquals(Test.MATCH, Test.GENERAL_INT, volume);
+ assertEquals(Test.MATCH, Test.GENERAL_EQUALIZERSETTINGS_LIST.size(), equalizerSettings.size());
+
+ assertTrue(Test.TRUE, Validator.validateEqualizerSettingsList(Test.GENERAL_EQUALIZERSETTINGS_LIST, equalizerSettings));
+
+ // Invalid/Null Tests
+ AudioControlData msg = new AudioControlData();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getSource());
+ assertNull(Test.NULL, msg.getVolume());
+ assertNull(Test.NULL, msg.getKeepContext());
+ assertNull(Test.NULL, msg.getEqualizerSettings());
+ }
+
+ public void testJson() {
+ JSONObject reference = new JSONObject();
+
+ try {
+ reference.put(AudioControlData.KEY_SOURCE, Test.GENERAL_PRIMARYAUDIOSOURCE);
+ reference.put(AudioControlData.KEY_KEEP_CONTEXT, Test.GENERAL_BOOLEAN);
+ reference.put(AudioControlData.KEY_VOLUME, Test.GENERAL_INT);
+ reference.put(AudioControlData.KEY_EQUALIZER_SETTINGS, Test.GENERAL_EQUALIZERSETTINGS_LIST);
+
+ JSONObject underTest = msg.serializeJSON();
+ assertEquals(Test.MATCH, reference.length(), underTest.length());
+
+ Iterator<?> iterator = reference.keys();
+ while (iterator.hasNext()) {
+ String key = (String) iterator.next();
+
+ if (key.equals(AudioControlData.KEY_EQUALIZER_SETTINGS)) {
+ List<EqualizerSettings> esReference = (List<EqualizerSettings>) JsonUtils.readObjectFromJsonObject(reference, key);
+ JSONArray esArray = JsonUtils.readJsonArrayFromJsonObject(underTest, key);
+ int i = 0;
+ for (EqualizerSettings es : esReference) {
+ assertTrue(Validator.validateEqualizerSettings(es, new EqualizerSettings(JsonRPCMarshaller.deserializeJSONObject(esArray.getJSONObject(i++)))));
+ }
+ } else {
+ assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key));
+ }
+
+ }
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ChoiceTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ChoiceTests.java
index e53ea8c2a..0df50f405 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ChoiceTests.java
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ChoiceTests.java
@@ -18,7 +18,7 @@ import com.smartdevicelink.test.Validator;
/**
* This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.Choice}
+ * {@link com.smartdevicelink.proxy.rpc.Choice}
*/
public class ChoiceTests extends TestCase{
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClimateControlCapabilitiesTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClimateControlCapabilitiesTests.java
index 33f9d2631..c391eb4eb 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClimateControlCapabilitiesTests.java
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClimateControlCapabilitiesTests.java
@@ -17,7 +17,7 @@ import java.util.Iterator;
import java.util.List;
/**
- * This is a unit test class for the SmartDeviceLink library project class :
+ * This is a unit test class for the SmartDeviceLink library project class :
* {@link com.smartdevicelink.rpc.ClimateControlCapabilities}
*/
public class ClimateControlCapabilitiesTests extends TestCase{
@@ -40,6 +40,10 @@ public class ClimateControlCapabilitiesTests extends TestCase{
msg.setDefrostZone(Test.GENERAL_DEFROSTZONE_LIST);
msg.setVentilationModeAvailable(Test.GENERAL_BOOLEAN);
msg.setVentilationMode(Test.GENERAL_VENTILATIONMODE_LIST);
+ msg.setHeatedSteeringWheelAvailable(Test.GENERAL_BOOLEAN);
+ msg.setHeatedWindshieldAvailable(Test.GENERAL_BOOLEAN);
+ msg.setHeatedRearWindowAvailable(Test.GENERAL_BOOLEAN);
+ msg.setHeatedMirrorsAvailable(Test.GENERAL_BOOLEAN);
}
/**
@@ -59,6 +63,10 @@ public class ClimateControlCapabilitiesTests extends TestCase{
List<DefrostZone> defrostZone = msg.getDefrostZone();
boolean ventilationModeAvailable = msg.getVentilationModeAvailable();
List<VentilationMode> ventilationMode = msg.getVentilationMode();
+ boolean heatedSteeringWheelAvailable = msg.getHeatedSteeringWheelAvailable();
+ boolean heatedWindshieldAvailable = msg.getHeatedWindshieldAvailable();
+ boolean heatedRearWindowAvailable = msg.getHeatedRearWindowAvailable();
+ boolean heatedMirrorsAvailable = msg.getHeatedMirrorsAvailable();
// Valid Tests
assertEquals(Test.MATCH, Test.GENERAL_STRING, moduleName);
@@ -82,6 +90,10 @@ public class ClimateControlCapabilitiesTests extends TestCase{
assertEquals(Test.MATCH, Test.GENERAL_VENTILATIONMODE_LIST.get(i), ventilationMode.get(i));
}
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, heatedSteeringWheelAvailable);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, heatedWindshieldAvailable);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, heatedRearWindowAvailable);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, heatedMirrorsAvailable);
// Invalid/Null Tests
ClimateControlCapabilities msg = new ClimateControlCapabilities();
assertNotNull(Test.NOT_NULL, msg);
@@ -97,6 +109,10 @@ public class ClimateControlCapabilitiesTests extends TestCase{
assertNull(Test.NULL, msg.getDefrostZone());
assertNull(Test.NULL, msg.getVentilationModeAvailable());
assertNull(Test.NULL, msg.getVentilationMode());
+ assertNull(Test.NULL, msg.getHeatedSteeringWheelAvailable());
+ assertNull(Test.NULL, msg.getHeatedWindshieldAvailable());
+ assertNull(Test.NULL, msg.getHeatedRearWindowAvailable());
+ assertNull(Test.NULL, msg.getHeatedMirrorsAvailable());
}
public void testJson(){
@@ -115,6 +131,10 @@ public class ClimateControlCapabilitiesTests extends TestCase{
reference.put(ClimateControlCapabilities.KEY_VENTILATION_MODE_AVAILABLE, Test.GENERAL_BOOLEAN);
reference.put(ClimateControlCapabilities.KEY_DEFROST_ZONE, JsonUtils.createJsonArray(Test.GENERAL_DEFROSTZONE_LIST));
reference.put(ClimateControlCapabilities.KEY_VENTILATION_MODE, JsonUtils.createJsonArray(Test.GENERAL_VENTILATIONMODE_LIST));
+ reference.put(ClimateControlCapabilities.KEY_HEATED_STEERING_WHEEL_AVAILABLE, Test.GENERAL_BOOLEAN);
+ reference.put(ClimateControlCapabilities.KEY_HEATED_WIND_SHIELD_AVAILABLE, Test.GENERAL_BOOLEAN);
+ reference.put(ClimateControlCapabilities.KEY_HEATED_REAR_WINDOW_AVAILABLE, Test.GENERAL_BOOLEAN);
+ reference.put(ClimateControlCapabilities.KEY_HEATED_MIRRORS_AVAILABLE, Test.GENERAL_BOOLEAN);
JSONObject underTest = msg.serializeJSON();
assertEquals(Test.MATCH, reference.length(), underTest.length());
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClimateControlDataTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClimateControlDataTests.java
index 5b0eefa9f..99d5c3285 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClimateControlDataTests.java
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ClimateControlDataTests.java
@@ -18,7 +18,7 @@ import java.util.Hashtable;
import java.util.Iterator;
/**
- * This is a unit test class for the SmartDeviceLink library project class :
+ * This is a unit test class for the SmartDeviceLink library project class :
* {@link com.smartdevicelink.rpc.ClimateControlData}
*/
public class ClimateControlDataTests extends TestCase{
@@ -39,6 +39,10 @@ public class ClimateControlDataTests extends TestCase{
msg.setDualModeEnable(Test.GENERAL_BOOLEAN);
msg.setAcMaxEnable(Test.GENERAL_BOOLEAN);
msg.setVentilationMode(Test.GENERAL_VENTILATIONMODE);
+ msg.setHeatedSteeringWheelEnable(Test.GENERAL_BOOLEAN);
+ msg.setHeatedWindshieldEnable(Test.GENERAL_BOOLEAN);
+ msg.setHeatedRearWindowEnable(Test.GENERAL_BOOLEAN);
+ msg.setHeatedMirrorsEnable(Test.GENERAL_BOOLEAN);
}
/**
@@ -56,6 +60,10 @@ public class ClimateControlDataTests extends TestCase{
boolean dualModeEnable = msg.getDualModeEnable();
boolean acMaxEnable = msg.getAcMaxEnable();
VentilationMode ventilationMode = msg.getVentilationMode();
+ boolean heatedSteeringWheelEnable = msg.getHeatedSteeringWheelEnable();
+ boolean heatedWindshieldEnable = msg.getHeatedWindshieldEnable();
+ boolean heatedRearWindowEnable = msg.getHeatedRearWindowEnable();
+ boolean heatedMirrorsEnable = msg.getHeatedMirrorsEnable();
// Valid Tests
assertEquals(Test.MATCH, Test.GENERAL_INT, fanSpeed);
@@ -68,6 +76,10 @@ public class ClimateControlDataTests extends TestCase{
assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, dualModeEnable);
assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, acMaxEnable);
assertEquals(Test.MATCH, Test.GENERAL_VENTILATIONMODE, ventilationMode);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, heatedSteeringWheelEnable);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, heatedWindshieldEnable);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, heatedRearWindowEnable);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, heatedMirrorsEnable);
// Invalid/Null Tests
ClimateControlData msg = new ClimateControlData();
@@ -83,6 +95,10 @@ public class ClimateControlDataTests extends TestCase{
assertNull(Test.NULL, msg.getDualModeEnable());
assertNull(Test.NULL, msg.getAcMaxEnable());
assertNull(Test.NULL, msg.getVentilationMode());
+ assertNull(Test.NULL, msg.getHeatedSteeringWheelEnable());
+ assertNull(Test.NULL, msg.getHeatedWindshieldEnable());
+ assertNull(Test.NULL, msg.getHeatedRearWindowEnable());
+ assertNull(Test.NULL, msg.getHeatedMirrorsEnable());
}
public void testJson(){
@@ -99,6 +115,10 @@ public class ClimateControlDataTests extends TestCase{
reference.put(ClimateControlData.KEY_AC_MAX_ENABLE, Test.GENERAL_BOOLEAN);
reference.put(ClimateControlData.KEY_DEFROST_ZONE, Test.GENERAL_DEFROSTZONE);
reference.put(ClimateControlData.KEY_VENTILATION_MODE, Test.GENERAL_VENTILATIONMODE);
+ reference.put(ClimateControlData.KEY_HEATED_STEERING_WHEEL_ENABLE, Test.GENERAL_BOOLEAN);
+ reference.put(ClimateControlData.KEY_HEATED_WIND_SHIELD_ENABLE, Test.GENERAL_BOOLEAN);
+ reference.put(ClimateControlData.KEY_HEATED_REAR_WINDOW_ENABLE, Test.GENERAL_BOOLEAN);
+ reference.put(ClimateControlData.KEY_HEATED_MIRRORS_ENABLE, Test.GENERAL_BOOLEAN);
JSONObject underTest = msg.serializeJSON();
assertEquals(Test.MATCH, reference.length(), underTest.length());
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/EqualizerSettingsTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/EqualizerSettingsTests.java
new file mode 100644
index 000000000..a803b1ded
--- /dev/null
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/EqualizerSettingsTests.java
@@ -0,0 +1,78 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.EqualizerSettings;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+
+import junit.framework.TestCase;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Iterator;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.EqualizerSettings}
+ */
+public class EqualizerSettingsTests extends TestCase {
+
+ private EqualizerSettings msg;
+
+ @Override
+ public void setUp() {
+ msg = new EqualizerSettings();
+
+ msg.setChannelId(Test.GENERAL_INT);
+ msg.setChannelName(Test.GENERAL_STRING);
+ msg.setChannelSetting(Test.GENERAL_INT);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues() {
+ // Test Values
+
+ int channelId = msg.getChannelId();
+ String channelName = msg.getChannelName();
+ int channelSetting = msg.getChannelSetting();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_INT, channelId);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, channelName);
+ assertEquals(Test.MATCH, Test.GENERAL_INT, channelSetting);
+
+ // Invalid/Null Tests
+ EqualizerSettings msg = new EqualizerSettings();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getChannelId());
+ assertNull(Test.NULL, msg.getChannelName());
+ assertNull(Test.NULL, msg.getChannelSetting());
+ }
+
+ public void testJson() {
+ JSONObject reference = new JSONObject();
+
+ try {
+
+ reference.put(EqualizerSettings.KEY_CHANNEL_ID, Test.GENERAL_INT);
+ reference.put(EqualizerSettings.KEY_CHANNEL_NAME, Test.GENERAL_STRING);
+ reference.put(EqualizerSettings.KEY_CHANNEL_SETTING, Test.GENERAL_INT);
+
+ JSONObject underTest = msg.serializeJSON();
+ assertEquals(Test.MATCH, reference.length(), underTest.length());
+
+ Iterator<?> iterator = reference.keys();
+ while (iterator.hasNext()) {
+ String key = (String) iterator.next();
+
+ assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key));
+
+ }
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMISettingsControlCapabilitiesTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMISettingsControlCapabilitiesTests.java
new file mode 100644
index 000000000..620868b40
--- /dev/null
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMISettingsControlCapabilitiesTests.java
@@ -0,0 +1,80 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.HMISettingsControlCapabilities;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+
+import junit.framework.TestCase;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Iterator;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.HMISettingsControlCapabilities}
+ */
+public class HMISettingsControlCapabilitiesTests extends TestCase {
+
+ private HMISettingsControlCapabilities msg;
+
+ @Override
+ public void setUp() {
+ msg = new HMISettingsControlCapabilities();
+
+ msg.setModuleName(Test.GENERAL_STRING);
+ msg.setDistanceUnitAvailable(Test.GENERAL_BOOLEAN);
+ msg.setTemperatureUnitAvailable(Test.GENERAL_BOOLEAN);
+ msg.setDisplayModeUnitAvailable(Test.GENERAL_BOOLEAN);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues() {
+ // Test Values
+ String moduleName = msg.getModuleName();
+ Boolean distanceUnitAvailable = msg.getDistanceUnitAvailable();
+ Boolean temperatureUnitAvailable = msg.getTemperatureUnitAvailable();
+ Boolean displayModeUnitAvailable = msg.getDisplayModeUnitAvailable();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, moduleName);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, (boolean) distanceUnitAvailable);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, (boolean) temperatureUnitAvailable);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, (boolean) displayModeUnitAvailable);
+
+ // Invalid/Null Tests
+ HMISettingsControlCapabilities msg = new HMISettingsControlCapabilities();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getModuleName());
+ assertNull(Test.NULL, msg.getDistanceUnitAvailable());
+ assertNull(Test.NULL, msg.getTemperatureUnitAvailable());
+ assertNull(Test.NULL, msg.getDisplayModeUnitAvailable());
+ }
+
+ public void testJson() {
+ JSONObject reference = new JSONObject();
+
+ try {
+ reference.put(HMISettingsControlCapabilities.KEY_MODULE_NAME, Test.GENERAL_STRING);
+ reference.put(HMISettingsControlCapabilities.KEY_DISTANCE_UNIT_AVAILABLE, Test.GENERAL_BOOLEAN);
+ reference.put(HMISettingsControlCapabilities.KEY_TEMPERATURE_UNIT_AVAILABLE, Test.GENERAL_BOOLEAN);
+ reference.put(HMISettingsControlCapabilities.KEY_DISPLAY_MODE_UNIT_AVAILABLE, Test.GENERAL_BOOLEAN);
+
+ JSONObject underTest = msg.serializeJSON();
+ assertEquals(Test.MATCH, reference.length(), underTest.length());
+
+ Iterator<?> iterator = reference.keys();
+ while (iterator.hasNext()) {
+ String key = (String) iterator.next();
+
+ assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key));
+ }
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMISettingsControlDataTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMISettingsControlDataTests.java
new file mode 100644
index 000000000..85205f617
--- /dev/null
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/HMISettingsControlDataTests.java
@@ -0,0 +1,78 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.HMISettingsControlData;
+import com.smartdevicelink.proxy.rpc.enums.DisplayMode;
+import com.smartdevicelink.proxy.rpc.enums.DistanceUnit;
+import com.smartdevicelink.proxy.rpc.enums.TemperatureUnit;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+
+import junit.framework.TestCase;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Iterator;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.HMISettingsControlData}
+ */
+public class HMISettingsControlDataTests extends TestCase {
+
+ private HMISettingsControlData msg;
+
+ @Override
+ public void setUp() {
+ msg = new HMISettingsControlData();
+
+ msg.setDisplayMode(Test.GENERAL_DISPLAYMODE);
+ msg.setTemperatureUnit(Test.GENERAL_TEMPERATUREUNIT);
+ msg.setDistanceUnit(Test.GENERAL_DISTANCEUNIT);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues() {
+ // Test Values
+ DisplayMode displayMode = msg.getDisplayMode();
+ TemperatureUnit temperatureUnit = msg.getTemperatureUnit();
+ DistanceUnit distanceUnit = msg.getDistanceUnit();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_DISPLAYMODE, displayMode);
+ assertEquals(Test.MATCH, Test.GENERAL_TEMPERATUREUNIT, temperatureUnit);
+ assertEquals(Test.MATCH, Test.GENERAL_DISTANCEUNIT, distanceUnit);
+
+ // Invalid/Null Tests
+ HMISettingsControlData msg = new HMISettingsControlData();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getDisplayMode());
+ assertNull(Test.NULL, msg.getTemperatureUnit());
+ assertNull(Test.NULL, msg.getDistanceUnit());
+ }
+
+ public void testJson() {
+ JSONObject reference = new JSONObject();
+
+ try {
+ reference.put(HMISettingsControlData.KEY_DISPLAY_MODE, Test.GENERAL_DISPLAYMODE);
+ reference.put(HMISettingsControlData.KEY_TEMPERATURE_UNIT, Test.GENERAL_TEMPERATUREUNIT);
+ reference.put(HMISettingsControlData.KEY_DISTANCE_UNIT, Test.GENERAL_DISTANCEUNIT);
+
+ JSONObject underTest = msg.serializeJSON();
+ assertEquals(Test.MATCH, reference.length(), underTest.length());
+
+ Iterator<?> iterator = reference.keys();
+ while (iterator.hasNext()) {
+ String key = (String) iterator.next();
+
+ assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key));
+ }
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightCapabilitiesTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightCapabilitiesTests.java
new file mode 100644
index 000000000..6122f4305
--- /dev/null
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightCapabilitiesTests.java
@@ -0,0 +1,81 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.LightCapabilities;
+import com.smartdevicelink.proxy.rpc.enums.LightName;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+
+import junit.framework.TestCase;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Iterator;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.LightCapabilities}
+ */
+public class LightCapabilitiesTests extends TestCase {
+
+ private LightCapabilities msg;
+
+ @Override
+ public void setUp() {
+ msg = new LightCapabilities();
+
+ msg.setName(Test.GENERAL_LIGHTNAME);
+ msg.setDensityAvailable(Test.GENERAL_BOOLEAN);
+ msg.setRGBColorSpaceAvailable(Test.GENERAL_BOOLEAN);
+ msg.setStatusAvailable(Test.GENERAL_BOOLEAN);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues() {
+ // Test Values
+ LightName name = msg.getName();
+ Boolean densityAvailable = msg.getDensityAvailable();
+ Boolean rgbColorSpaceAvailable = msg.getRGBColorSpaceAvailable();
+ Boolean statusAvailable = msg.getStatusAvailable();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_LIGHTNAME, name);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, (boolean) densityAvailable);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, (boolean) rgbColorSpaceAvailable);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, (boolean) statusAvailable);
+
+ // Invalid/Null Tests
+ LightCapabilities msg = new LightCapabilities();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getName());
+ assertNull(Test.NULL, msg.getDensityAvailable());
+ assertNull(Test.NULL, msg.getRGBColorSpaceAvailable());
+ assertNull(Test.NULL, msg.getStatusAvailable());
+ }
+
+ public void testJson() {
+ JSONObject reference = new JSONObject();
+
+ try {
+ reference.put(LightCapabilities.KEY_NAME, Test.GENERAL_LIGHTNAME);
+ reference.put(LightCapabilities.KEY_DENSITY_AVAILABLE, Test.GENERAL_BOOLEAN);
+ reference.put(LightCapabilities.KEY_RGB_COLOR_SPACE_AVAILABLE, Test.GENERAL_BOOLEAN);
+ reference.put(LightCapabilities.KEY_STATUS_AVAILABLE, Test.GENERAL_BOOLEAN);
+
+ JSONObject underTest = msg.serializeJSON();
+ assertEquals(Test.MATCH, reference.length(), underTest.length());
+
+ Iterator<?> iterator = reference.keys();
+ while (iterator.hasNext()) {
+ String key = (String) iterator.next();
+
+ assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key));
+ }
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightControlCapabilitiesTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightControlCapabilitiesTests.java
new file mode 100644
index 000000000..4ebd7f467
--- /dev/null
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightControlCapabilitiesTests.java
@@ -0,0 +1,86 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.proxy.rpc.LightCapabilities;
+import com.smartdevicelink.proxy.rpc.LightControlCapabilities;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+
+import junit.framework.TestCase;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.LightControlCapabilities}
+ */
+public class LightControlCapabilitiesTests extends TestCase {
+
+ private LightControlCapabilities msg;
+
+ @Override
+ public void setUp() {
+ msg = new LightControlCapabilities();
+
+ msg.setModuleName(Test.GENERAL_STRING);
+ msg.setSupportedLights(Test.GENERAL_LIGHTCAPABILITIES_LIST);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues() {
+ // Test Values
+ String moduleName = msg.getModuleName();
+ List<LightCapabilities> supportedLights = msg.getSupportedLights();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, moduleName);
+ assertEquals(Test.MATCH, Test.GENERAL_LIGHTCAPABILITIES_LIST.size(), supportedLights.size());
+
+ assertTrue(Test.TRUE, Validator.validateLightCapabilitiesList(Test.GENERAL_LIGHTCAPABILITIES_LIST, supportedLights));
+
+ // Invalid/Null Tests
+ LightControlCapabilities msg = new LightControlCapabilities();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getModuleName());
+ assertNull(Test.NULL, msg.getSupportedLights());
+ }
+
+ public void testJson() {
+ JSONObject reference = new JSONObject();
+
+ try {
+ reference.put(LightControlCapabilities.KEY_MODULE_NAME, Test.GENERAL_STRING);
+ reference.put(LightControlCapabilities.KEY_SUPPORTED_LIGHTS, Test.GENERAL_LIGHTCAPABILITIES_LIST);
+
+ JSONObject underTest = msg.serializeJSON();
+ assertEquals(Test.MATCH, reference.length(), underTest.length());
+
+ Iterator<?> iterator = reference.keys();
+ while (iterator.hasNext()) {
+ String key = (String) iterator.next();
+
+ if (key.equals(LightControlCapabilities.KEY_SUPPORTED_LIGHTS)) {
+ List<LightCapabilities> lcReference = (List<LightCapabilities>) JsonUtils.readObjectFromJsonObject(reference, key);
+ JSONArray lsArray = JsonUtils.readJsonArrayFromJsonObject(underTest, key);
+ int i = 0;
+ for (LightCapabilities lc : lcReference) {
+ assertTrue(Validator.validateLightCapabilities(lc, new LightCapabilities(JsonRPCMarshaller.deserializeJSONObject(lsArray.getJSONObject(i++)))));
+ }
+ } else {
+ assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key));
+ }
+ }
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightControlDataTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightControlDataTests.java
new file mode 100644
index 000000000..c891e0769
--- /dev/null
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightControlDataTests.java
@@ -0,0 +1,79 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.proxy.rpc.LightControlData;
+import com.smartdevicelink.proxy.rpc.LightState;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+
+import junit.framework.TestCase;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.LightControlData}
+ */
+public class LightControlDataTests extends TestCase {
+
+ private LightControlData msg;
+
+ @Override
+ public void setUp() {
+ msg = new LightControlData();
+
+ msg.setLightState(Test.GENERAL_LIGHTSTATE_LIST);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues() {
+ // Test Values
+ List<LightState> lightState = msg.getLightState();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_LIGHTSTATE_LIST.size(), lightState.size());
+
+ assertTrue(Test.TRUE, Validator.validateLightStateList(Test.GENERAL_LIGHTSTATE_LIST, lightState));
+
+ // Invalid/Null Tests
+ LightControlData msg = new LightControlData();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getLightState());
+ }
+
+ public void testJson() {
+ JSONObject reference = new JSONObject();
+
+ try {
+ reference.put(LightControlData.KEY_LIGHT_STATE, Test.GENERAL_LIGHTSTATE_LIST);
+
+ JSONObject underTest = msg.serializeJSON();
+ assertEquals(Test.MATCH, reference.length(), underTest.length());
+
+ Iterator<?> iterator = reference.keys();
+ while (iterator.hasNext()) {
+ String key = (String) iterator.next();
+
+ if (key.equals(LightControlData.KEY_LIGHT_STATE)) {
+ List<LightState> lsReference = (List<LightState>) JsonUtils.readObjectFromJsonObject(reference, key);
+ JSONArray lsArray = JsonUtils.readJsonArrayFromJsonObject(underTest, key);
+ int i = 0;
+ for (LightState ls : lsReference) {
+ assertTrue(Validator.validateLightState(ls, new LightState(JsonRPCMarshaller.deserializeJSONObject(lsArray.getJSONObject(i++)))));
+ }
+ }
+ }
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightStateTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightStateTests.java
new file mode 100644
index 000000000..196769e00
--- /dev/null
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/LightStateTests.java
@@ -0,0 +1,94 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.proxy.rpc.LightState;
+import com.smartdevicelink.proxy.rpc.RGBColor;
+import com.smartdevicelink.proxy.rpc.enums.LightName;
+import com.smartdevicelink.proxy.rpc.enums.LightStatus;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+
+import junit.framework.TestCase;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+import java.util.Iterator;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.LightState}
+ */
+public class LightStateTests extends TestCase {
+
+ private LightState msg;
+
+ @Override
+ public void setUp() {
+ msg = new LightState();
+
+ msg.setId(Test.GENERAL_LIGHTNAME);
+ msg.setStatus(Test.GENERAL_LIGHTSTATUS);
+ msg.setDensity(Test.GENERAL_FLOAT);
+ msg.setColor(Test.GENERAL_RGBCOLOR);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues() {
+ // Test Values
+ LightName id = msg.getId();
+ LightStatus status = msg.getStatus();
+ Float density = msg.getDensity();
+ RGBColor color = msg.getColor();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_LIGHTNAME, id);
+ assertEquals(Test.MATCH, Test.GENERAL_LIGHTSTATUS, status);
+ assertEquals(Test.MATCH, Test.GENERAL_FLOAT, (float) density);
+ assertEquals(Test.MATCH, Test.GENERAL_RGBCOLOR, color);
+
+ // Invalid/Null Tests
+ LightState msg = new LightState();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getId());
+ assertNull(Test.NULL, msg.getStatus());
+ assertNull(Test.NULL, msg.getDensity());
+ assertNull(Test.NULL, msg.getColor());
+ }
+
+ public void testJson() {
+ JSONObject reference = new JSONObject();
+
+ try {
+ reference.put(LightState.KEY_ID, Test.GENERAL_LIGHTNAME);
+ reference.put(LightState.KEY_STATUS, Test.GENERAL_LIGHTSTATUS);
+ reference.put(LightState.KEY_DENSITY, Test.GENERAL_FLOAT);
+ reference.put(LightState.KEY_COLOR, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_RGBCOLOR.getStore()));
+
+ JSONObject underTest = msg.serializeJSON();
+ assertEquals(Test.MATCH, reference.length(), underTest.length());
+
+ Iterator<?> iterator = reference.keys();
+ while (iterator.hasNext()) {
+ String key = (String) iterator.next();
+
+ if (key.equals(LightState.KEY_COLOR)) {
+ JSONObject objectEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(reference, key);
+ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key);
+ Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals);
+ Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals);
+ assertTrue(Test.TRUE, Validator.validateRGBColor(new RGBColor(hashReference), new RGBColor(hashTest)));
+ } else {
+ assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key));
+ }
+ }
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ModuleDataTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ModuleDataTests.java
index 067216169..b553587ad 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ModuleDataTests.java
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/ModuleDataTests.java
@@ -1,7 +1,10 @@
package com.smartdevicelink.test.rpc.datatypes;
import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.proxy.rpc.AudioControlData;
import com.smartdevicelink.proxy.rpc.ClimateControlData;
+import com.smartdevicelink.proxy.rpc.HMISettingsControlData;
+import com.smartdevicelink.proxy.rpc.LightControlData;
import com.smartdevicelink.proxy.rpc.ModuleData;
import com.smartdevicelink.proxy.rpc.RadioControlData;
import com.smartdevicelink.proxy.rpc.SeatControlData;
@@ -29,11 +32,13 @@ public class ModuleDataTests extends TestCase {
@Override
public void setUp() {
msg = new ModuleData();
-
msg.setModuleType(Test.GENERAL_MODULETYPE);
msg.setRadioControlData(Test.GENERAL_RADIOCONTROLDATA);
msg.setClimateControlData(Test.GENERAL_CLIMATECONTROLDATA);
msg.setSeatControlData(Test.GENERAL_SEATCONTROLDATA);
+ msg.setAudioControlData(Test.GENERAL_AUDIOCONTROLDATA);
+ msg.setHmiSettingsControlData(Test.GENERAL_HMISETTINGSCONTROLDATA);
+ msg.setLightControlData(Test.GENERAL_LIGHTCONTROLDATA);
}
/**
@@ -45,12 +50,18 @@ public class ModuleDataTests extends TestCase {
RadioControlData radioControlData = msg.getRadioControlData();
ClimateControlData climateControlData = msg.getClimateControlData();
SeatControlData seatControlData = msg.getSeatControlData();
+ AudioControlData audioControlData = msg.getAudioControlData();
+ HMISettingsControlData hmiSettingsControlData = msg.getHmiSettingsControlData();
+ LightControlData lightControlData = msg.getLightControlData();
// Valid Tests
assertEquals(Test.MATCH, Test.GENERAL_MODULETYPE, moduleType);
assertTrue(Test.TRUE, Validator.validateRadioControlData(Test.GENERAL_RADIOCONTROLDATA, radioControlData));
assertTrue(Test.TRUE, Validator.validateClimateControlData(Test.GENERAL_CLIMATECONTROLDATA, climateControlData));
assertTrue(Test.TRUE, Validator.validateSeatControlData(Test.GENERAL_SEATCONTROLDATA, seatControlData));
+ assertTrue(Test.TRUE, Validator.validateAudioControlData(Test.GENERAL_AUDIOCONTROLDATA, audioControlData));
+ assertTrue(Test.TRUE, Validator.validateHMISettingsControlData(Test.GENERAL_HMISETTINGSCONTROLDATA, hmiSettingsControlData));
+ assertTrue(Test.TRUE, Validator.validateLightControlData(Test.GENERAL_LIGHTCONTROLDATA, lightControlData));
// Invalid/Null Tests
ModuleData msg = new ModuleData();
@@ -60,6 +71,9 @@ public class ModuleDataTests extends TestCase {
assertNull(Test.NULL, msg.getRadioControlData());
assertNull(Test.NULL, msg.getClimateControlData());
assertNull(Test.NULL, msg.getSeatControlData());
+ assertNull(Test.NULL, msg.getAudioControlData());
+ assertNull(Test.NULL, msg.getHmiSettingsControlData());
+ assertNull(Test.NULL, msg.getLightControlData());
}
public void testJson() {
@@ -70,6 +84,9 @@ public class ModuleDataTests extends TestCase {
reference.put(ModuleData.KEY_RADIO_CONTROL_DATA, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_RADIOCONTROLDATA.getStore()));
reference.put(ModuleData.KEY_CLIMATE_CONTROL_DATA, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_CLIMATECONTROLDATA.getStore()));
reference.put(ModuleData.KEY_SEAT_CONTROL_DATA, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_SEATCONTROLDATA.getStore()));
+ reference.put(ModuleData.KEY_AUDIO_CONTROL_DATA, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_AUDIOCONTROLDATA.getStore()));
+ reference.put(ModuleData.KEY_HMI_SETTINGS_CONTROL_DATA, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_HMISETTINGSCONTROLDATA.getStore()));
+ reference.put(ModuleData.KEY_LIGHT_CONTROL_DATA, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_LIGHTCONTROLDATA.getStore()));
JSONObject underTest = msg.serializeJSON();
assertEquals(Test.MATCH, reference.length(), underTest.length());
@@ -96,6 +113,24 @@ public class ModuleDataTests extends TestCase {
Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals);
Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals);
assertTrue(Test.TRUE, Validator.validateSeatControlData(new SeatControlData(hashReference), new SeatControlData(hashTest)));
+ } else if (key.equals(ModuleData.KEY_AUDIO_CONTROL_DATA)) {
+ JSONObject objectEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(reference, key);
+ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key);
+ Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals);
+ Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals);
+ assertTrue(Test.TRUE, Validator.validateAudioControlData(new AudioControlData(hashReference), new AudioControlData(hashTest)));
+ } else if (key.equals(ModuleData.KEY_HMI_SETTINGS_CONTROL_DATA)) {
+ JSONObject objectEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(reference, key);
+ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key);
+ Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals);
+ Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals);
+ assertTrue(Test.TRUE, Validator.validateHMISettingsControlData(new HMISettingsControlData(hashReference), new HMISettingsControlData(hashTest)));
+ } else if (key.equals(ModuleData.KEY_LIGHT_CONTROL_DATA)) {
+ JSONObject objectEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(reference, key);
+ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key);
+ Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals);
+ Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals);
+ assertTrue(Test.TRUE, Validator.validateLightControlData(new LightControlData(hashReference), new LightControlData(hashTest)));
} else {
assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key));
}
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RadioControlCapabilitiesTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RadioControlCapabilitiesTests.java
index 28c1d2c5b..08e1364bc 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RadioControlCapabilitiesTests.java
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RadioControlCapabilitiesTests.java
@@ -12,7 +12,7 @@ import org.json.JSONObject;
import java.util.Iterator;
/**
- * This is a unit test class for the SmartDeviceLink library project class :
+ * This is a unit test class for the SmartDeviceLink library project class :
* {@link com.smartdevicelink.rpc.RadioControlCapabilities}
*/
public class RadioControlCapabilitiesTests extends TestCase{
@@ -33,6 +33,7 @@ public class RadioControlCapabilitiesTests extends TestCase{
msg.setStateAvailable(Test.GENERAL_BOOLEAN);
msg.setSignalStrengthAvailable(Test.GENERAL_BOOLEAN);
msg.setSignalChangeThresholdAvailable(Test.GENERAL_BOOLEAN);
+ msg.setSisDataAvailable(Test.GENERAL_BOOLEAN);
}
/**
@@ -50,6 +51,7 @@ public class RadioControlCapabilitiesTests extends TestCase{
boolean stateAvailable = msg.getStateAvailable();
boolean signalStrengthAvailable = msg.getSignalStrengthAvailable();
boolean signalChangeThresholdAvailable = msg.getSignalChangeThresholdAvailable();
+ boolean sisDataAvailable = msg.getSisDataAvailable();
// Valid Tests
@@ -63,6 +65,7 @@ public class RadioControlCapabilitiesTests extends TestCase{
assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, stateAvailable);
assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, signalStrengthAvailable);
assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, signalChangeThresholdAvailable);
+ assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, sisDataAvailable);
// Invalid/Null Tests
RadioControlCapabilities msg = new RadioControlCapabilities();
@@ -78,6 +81,7 @@ public class RadioControlCapabilitiesTests extends TestCase{
assertNull(Test.NULL, msg.getStateAvailable());
assertNull(Test.NULL, msg.getSignalStrengthAvailable());
assertNull(Test.NULL, msg.getSignalChangeThresholdAvailable());
+ assertNull(Test.NULL, msg.getSisDataAvailable());
}
public void testJson(){
@@ -94,6 +98,7 @@ public class RadioControlCapabilitiesTests extends TestCase{
reference.put(RadioControlCapabilities.KEY_STATE_AVAILABLE, Test.GENERAL_BOOLEAN);
reference.put(RadioControlCapabilities.KEY_SIGNAL_STRENGTH_AVAILABLE, Test.GENERAL_BOOLEAN);
reference.put(RadioControlCapabilities.KEY_SIGNAL_CHANGE_THRESHOLD_AVAILABLE, Test.GENERAL_BOOLEAN);
+ reference.put(RadioControlCapabilities.KEY_SIS_DATA_AVAILABLE, Test.GENERAL_BOOLEAN);
JSONObject underTest = msg.serializeJSON();
assertEquals(Test.MATCH, reference.length(), underTest.length());
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RadioControlDataTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RadioControlDataTests.java
index b42145e8f..41f2829d0 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RadioControlDataTests.java
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RadioControlDataTests.java
@@ -3,6 +3,7 @@ package com.smartdevicelink.test.rpc.datatypes;
import com.smartdevicelink.marshal.JsonRPCMarshaller;
import com.smartdevicelink.proxy.rpc.RadioControlData;
import com.smartdevicelink.proxy.rpc.RdsData;
+import com.smartdevicelink.proxy.rpc.SisData;
import com.smartdevicelink.proxy.rpc.enums.RadioBand;
import com.smartdevicelink.proxy.rpc.enums.RadioState;
import com.smartdevicelink.test.JsonUtils;
@@ -18,7 +19,7 @@ import java.util.Hashtable;
import java.util.Iterator;
/**
- * This is a unit test class for the SmartDeviceLink library project class :
+ * This is a unit test class for the SmartDeviceLink library project class :
* {@link com.smartdevicelink.rpc.RadioControlData}
*/
public class RadioControlDataTests extends TestCase{
@@ -39,6 +40,7 @@ public class RadioControlDataTests extends TestCase{
msg.setSignalChangeThreshold(Test.GENERAL_INT);
msg.setRadioEnable(Test.GENERAL_BOOLEAN);
msg.setState(Test.GENERAL_RADIOSTATE);
+ msg.setSisData(Test.GENERAL_SISDATA);
}
/**
@@ -56,6 +58,7 @@ public class RadioControlDataTests extends TestCase{
int signalChangeThreshold = msg.getSignalChangeThreshold();
boolean radioEnable = msg.getRadioEnable();
RadioState state = msg.getState();
+ SisData sisData = msg.getSisData();
// Valid Tests
assertEquals(Test.MATCH, Test.GENERAL_INT, frequencyInteger);
@@ -68,6 +71,7 @@ public class RadioControlDataTests extends TestCase{
assertEquals(Test.MATCH, Test.GENERAL_INT, signalChangeThreshold);
assertEquals(Test.MATCH, Test.GENERAL_BOOLEAN, radioEnable);
assertEquals(Test.MATCH, Test.GENERAL_RADIOSTATE, state);
+ assertTrue(Test.TRUE, Validator.validateSisData(Test.GENERAL_SISDATA, sisData));
// Invalid/Null Tests
RadioControlData msg = new RadioControlData();
@@ -83,6 +87,7 @@ public class RadioControlDataTests extends TestCase{
assertNull(Test.NULL, msg.getSignalChangeThreshold());
assertNull(Test.NULL, msg.getRadioEnable());
assertNull(Test.NULL, msg.getState());
+ assertNull(Test.NULL, msg.getSisData());
}
public void testJson(){
@@ -99,6 +104,7 @@ public class RadioControlDataTests extends TestCase{
reference.put(RadioControlData.KEY_SIGNAL_CHANGE_THRESHOLD, Test.GENERAL_INT);
reference.put(RadioControlData.KEY_RADIO_ENABLE, Test.GENERAL_BOOLEAN);
reference.put(RadioControlData.KEY_STATE, Test.GENERAL_RADIOSTATE);
+ reference.put(RadioControlData.KEY_SIS_DATA, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_SISDATA.getStore()));
JSONObject underTest = msg.serializeJSON();
assertEquals(Test.MATCH, reference.length(), underTest.length());
@@ -112,7 +118,13 @@ public class RadioControlDataTests extends TestCase{
JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key);
Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals);
Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals);
- assertTrue(Test.TRUE, Validator.validateRadioControlData( new RadioControlData(hashReference), new RadioControlData(hashTest)));
+ assertTrue(Test.TRUE, Validator.validateRdsData(new RdsData(hashReference), new RdsData(hashTest)));
+ } else if (key.equals(RadioControlData.KEY_SIS_DATA)) {
+ JSONObject objectEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(reference, key);
+ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key);
+ Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals);
+ Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals);
+ assertTrue(Test.TRUE, Validator.validateSisData(new SisData(hashReference), new SisData(hashTest)));
} else{
assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key));
}
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RemoteControlCapabilitiesTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RemoteControlCapabilitiesTests.java
index 6e29f01a3..e6a2d2b9a 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RemoteControlCapabilitiesTests.java
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RemoteControlCapabilitiesTests.java
@@ -1,8 +1,11 @@
package com.smartdevicelink.test.rpc.datatypes;
import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.proxy.rpc.AudioControlCapabilities;
import com.smartdevicelink.proxy.rpc.ButtonCapabilities;
import com.smartdevicelink.proxy.rpc.ClimateControlCapabilities;
+import com.smartdevicelink.proxy.rpc.HMISettingsControlCapabilities;
+import com.smartdevicelink.proxy.rpc.LightControlCapabilities;
import com.smartdevicelink.proxy.rpc.RadioControlCapabilities;
import com.smartdevicelink.proxy.rpc.RemoteControlCapabilities;
import com.smartdevicelink.proxy.rpc.SeatControlCapabilities;
@@ -32,11 +35,13 @@ public class RemoteControlCapabilitiesTests extends TestCase {
@Override
public void setUp() {
msg = new RemoteControlCapabilities();
-
msg.setButtonCapabilities(Test.GENERAL_BUTTONCAPABILITIES_LIST);
msg.setRadioControlCapabilities(Test.GENERAL_RADIOCONTROLCAPABILITIES_LIST);
msg.setClimateControlCapabilities(Test.GENERAL_CLIMATECONTROLCAPABILITIES_LIST);
msg.setSeatControlCapabilities(Test.GENERAL_SEATCONTROLCAPABILITIES_LIST);
+ msg.setAudioControlCapabilities(Test.GENERAL_AUDIOCONTROLCAPABILITIES_LIST);
+ msg.setHmiSettingsControlCapabilities(Test.GENERAL_HMISETTINGSCONTROLCAPABILITIES);
+ msg.setLightControlCapabilities(Test.GENERAL_LIGHTCONTROLCAPABILITIES);
}
/**
@@ -48,6 +53,9 @@ public class RemoteControlCapabilitiesTests extends TestCase {
List<RadioControlCapabilities> radioControlCapabilities = msg.getRadioControlCapabilities();
List<ClimateControlCapabilities> climateControlCapabilities = msg.getClimateControlCapabilities();
List<SeatControlCapabilities> seatControlCapabilities = msg.getSeatControlCapabilities();
+ List<AudioControlCapabilities> audioControlCapabilities = msg.getAudioControlCapabilities();
+ HMISettingsControlCapabilities hmiSettingsControlCapabilities = msg.getHmiSettingsControlCapabilities();
+ LightControlCapabilities lightControlCapabilities = msg.getLightControlCapabilities();
// Valid Tests
assertEquals(Test.MATCH, Test.GENERAL_BUTTONCAPABILITIES_LIST.size(), buttonCapabilities.size());
@@ -58,8 +66,10 @@ public class RemoteControlCapabilitiesTests extends TestCase {
assertTrue(Test.TRUE, Validator.validateButtonCapabilities(Test.GENERAL_BUTTONCAPABILITIES_LIST, buttonCapabilities));
assertTrue(Test.TRUE, Validator.validateRadioControlCapabilities(Test.GENERAL_RADIOCONTROLCAPABILITIES_LIST, radioControlCapabilities));
assertTrue(Test.TRUE, Validator.validateClimateControlCapabilities(Test.GENERAL_CLIMATECONTROLCAPABILITIES_LIST, climateControlCapabilities));
-
assertTrue(Test.TRUE, Validator.validateSeatControlCapabilitiesList(Test.GENERAL_SEATCONTROLCAPABILITIES_LIST, seatControlCapabilities));
+ assertTrue(Test.TRUE, Validator.validateAudioControlCapabilitiesList(Test.GENERAL_AUDIOCONTROLCAPABILITIES_LIST, audioControlCapabilities));
+ assertTrue(Test.TRUE, Validator.validateHMISettingsControlCapabilities(Test.GENERAL_HMISETTINGSCONTROLCAPABILITIES, hmiSettingsControlCapabilities));
+ assertTrue(Test.TRUE, Validator.validateLightControlCapabilities(Test.GENERAL_LIGHTCONTROLCAPABILITIES, lightControlCapabilities));
// Invalid/Null Tests
RemoteControlCapabilities msg = new RemoteControlCapabilities();
@@ -69,7 +79,9 @@ public class RemoteControlCapabilitiesTests extends TestCase {
assertNull(Test.NULL, msg.getRadioControlCapabilities());
assertNull(Test.NULL, msg.getClimateControlCapabilities());
assertNull(Test.NULL, msg.getSeatControlCapabilities());
-
+ assertNull(Test.NULL, msg.getAudioControlCapabilities());
+ assertNull(Test.NULL, msg.getHmiSettingsControlCapabilities());
+ assertNull(Test.NULL, msg.getLightControlCapabilities());
}
public void testJson() {
@@ -80,6 +92,9 @@ public class RemoteControlCapabilitiesTests extends TestCase {
reference.put(RemoteControlCapabilities.KEY_RADIO_CONTROL_CAPABILITIES, Test.JSON_RADIOCONTROLCAPABILITIES);
reference.put(RemoteControlCapabilities.KEY_CLIMATE_CONTROL_CAPABILITIES, Test.JSON_CLIMATECONTROLCAPABILITIES);
reference.put(RemoteControlCapabilities.KEY_SEAT_CONTROL_CAPABILITIES, Test.GENERAL_SEATCONTROLCAPABILITIES_LIST);
+ reference.put(RemoteControlCapabilities.KEY_AUDIO_CONTROL_CAPABILITIES, Test.GENERAL_AUDIOCONTROLCAPABILITIES_LIST);
+ reference.put(RemoteControlCapabilities.KEY_HMI_SETTINGS_CONTROL_CAPABILITIES, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_HMISETTINGSCONTROLCAPABILITIES.getStore()));
+ reference.put(RemoteControlCapabilities.KEY_LIGHT_CONTROL_CAPABILITIES, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_LIGHTCONTROLCAPABILITIES.getStore()));
JSONObject underTest = msg.serializeJSON();
assertEquals(Test.MATCH, reference.length(), underTest.length());
@@ -137,6 +152,25 @@ public class RemoteControlCapabilitiesTests extends TestCase {
for (SeatControlCapabilities scc : sccReference) {
assertTrue(Validator.validateSeatControlCapabilities(scc, new SeatControlCapabilities(JsonRPCMarshaller.deserializeJSONObject(sccArray.getJSONObject(i++)))));
}
+ } else if (key.equals(RemoteControlCapabilities.KEY_AUDIO_CONTROL_CAPABILITIES)) {
+ List<AudioControlCapabilities> accReference = (List<AudioControlCapabilities>) JsonUtils.readObjectFromJsonObject(reference, key);
+ JSONArray accArray = JsonUtils.readJsonArrayFromJsonObject(underTest, key);
+ int i = 0;
+ for (AudioControlCapabilities acc : accReference) {
+ assertTrue(Validator.validateAudioControlCapabilities(acc, new AudioControlCapabilities(JsonRPCMarshaller.deserializeJSONObject(accArray.getJSONObject(i++)))));
+ }
+ } else if (key.equals(RemoteControlCapabilities.KEY_HMI_SETTINGS_CONTROL_CAPABILITIES)) {
+ JSONObject objectEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(reference, key);
+ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key);
+ Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals);
+ Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals);
+ assertTrue(Test.TRUE, Validator.validateHMISettingsControlCapabilities(new HMISettingsControlCapabilities(hashReference), new HMISettingsControlCapabilities(hashTest)));
+ } else if (key.equals(RemoteControlCapabilities.KEY_LIGHT_CONTROL_CAPABILITIES)) {
+ JSONObject objectEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(reference, key);
+ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key);
+ Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals);
+ Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals);
+ assertTrue(Test.TRUE, Validator.validateLightControlCapabilities(new LightControlCapabilities(hashReference), new LightControlCapabilities(hashTest)));
}
}
} catch (JSONException e) {
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SisDataTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SisDataTests.java
new file mode 100644
index 000000000..51e38f8d1
--- /dev/null
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SisDataTests.java
@@ -0,0 +1,105 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.proxy.rpc.GPSData;
+import com.smartdevicelink.proxy.rpc.SisData;
+import com.smartdevicelink.proxy.rpc.StationIDNumber;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.test.Validator;
+import com.smartdevicelink.test.VehicleDataHelper;
+
+import junit.framework.TestCase;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Hashtable;
+import java.util.Iterator;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.SisData}
+ */
+public class SisDataTests extends TestCase {
+
+ private SisData msg;
+
+ @Override
+ public void setUp() {
+ msg = new SisData();
+
+ msg.setStationShortName(Test.GENERAL_STRING);
+ msg.setStationIDNumber(Test.GENERAL_STATIONIDNUMBER);
+ msg.setStationLongName(Test.GENERAL_STRING);
+ msg.setStationLocation(VehicleDataHelper.GPS);
+ msg.setStationMessage(Test.GENERAL_STRING);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues() {
+ // Test Values
+ String stationShortName = msg.getStationShortName();
+ StationIDNumber stationIDNumber = msg.getStationIDNumber();
+ String stationLongName = msg.getStationLongName();
+ GPSData stationLocation = msg.getStationLocation();
+ String stationMessage = msg.getStationMessage();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, stationShortName);
+ assertEquals(Test.MATCH, Test.GENERAL_STATIONIDNUMBER, stationIDNumber);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, stationLongName);
+ assertEquals(Test.MATCH, VehicleDataHelper.GPS, stationLocation);
+ assertEquals(Test.MATCH, Test.GENERAL_STRING, stationMessage);
+
+ // Invalid/Null Tests
+ SisData msg = new SisData();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getStationShortName());
+ assertNull(Test.NULL, msg.getStationIDNumber());
+ assertNull(Test.NULL, msg.getStationLongName());
+ assertNull(Test.NULL, msg.getStationLocation());
+ assertNull(Test.NULL, msg.getStationMessage());
+ }
+
+ public void testJson() {
+ JSONObject reference = new JSONObject();
+
+ try {
+ reference.put(SisData.KEY_STATION_SHORT_NAME, Test.GENERAL_STRING);
+ reference.put(SisData.KEY_STATION_ID_NUMBER, JsonRPCMarshaller.serializeHashtable(Test.GENERAL_STATIONIDNUMBER.getStore()));
+ reference.put(SisData.KEY_STATION_LONG_NAME, Test.GENERAL_STRING);
+ reference.put(SisData.KEY_STATION_LOCATION, JsonRPCMarshaller.serializeHashtable(VehicleDataHelper.GPS.getStore()));
+ reference.put(SisData.KEY_STATION_MESSAGE, Test.GENERAL_STRING);
+
+ JSONObject underTest = msg.serializeJSON();
+ assertEquals(Test.MATCH, reference.length(), underTest.length());
+
+ Iterator<?> iterator = reference.keys();
+ while (iterator.hasNext()) {
+ String key = (String) iterator.next();
+
+ if (key.equals(SisData.KEY_STATION_ID_NUMBER)) {
+ JSONObject objectEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(reference, key);
+ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key);
+ Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals);
+ Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals);
+ assertTrue(Test.TRUE, Validator.validateStationIDNumber(new StationIDNumber(hashReference), new StationIDNumber(hashTest)));
+ } else if (key.equals(SisData.KEY_STATION_LOCATION)) {
+ JSONObject objectEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(reference, key);
+ JSONObject testEquals = (JSONObject) JsonUtils.readObjectFromJsonObject(underTest, key);
+ Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(objectEquals);
+ Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(testEquals);
+ assertTrue(Test.TRUE, Validator.validateGpsData(new GPSData(hashReference), new GPSData(hashTest)));
+ } else {
+ assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key));
+ }
+ }
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/StationIDNumberTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/StationIDNumberTests.java
new file mode 100644
index 000000000..e7e61f8fd
--- /dev/null
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/StationIDNumberTests.java
@@ -0,0 +1,73 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.StationIDNumber;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.Test;
+
+import junit.framework.TestCase;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Iterator;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.StationIDNumber}
+ */
+public class StationIDNumberTests extends TestCase {
+
+ private StationIDNumber msg;
+
+ @Override
+ public void setUp() {
+ msg = new StationIDNumber();
+
+ msg.setCountryCode(Test.GENERAL_INT);
+ msg.setFccFacilityId(Test.GENERAL_INT);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues() {
+ // Test Values
+
+ int countryCode = msg.getCountryCode();
+ int fccFacilityId = msg.getFccFacilityId();
+
+ // Valid Tests
+ assertEquals(Test.MATCH, Test.GENERAL_INT, countryCode);
+ assertEquals(Test.MATCH, Test.GENERAL_INT, fccFacilityId);
+
+ // Invalid/Null Tests
+ StationIDNumber msg = new StationIDNumber();
+ assertNotNull(Test.NOT_NULL, msg);
+
+ assertNull(Test.NULL, msg.getCountryCode());
+ assertNull(Test.NULL, msg.getFccFacilityId());
+ }
+
+ public void testJson() {
+ JSONObject reference = new JSONObject();
+
+ try {
+
+ reference.put(StationIDNumber.KEY_COUNTRY_CODE, Test.GENERAL_INT);
+ reference.put(StationIDNumber.KEY_FCC_FACILITY_ID, Test.GENERAL_INT);
+
+ JSONObject underTest = msg.serializeJSON();
+ assertEquals(Test.MATCH, reference.length(), underTest.length());
+
+ Iterator<?> iterator = reference.keys();
+ while (iterator.hasNext()) {
+ String key = (String) iterator.next();
+
+ assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key));
+
+ }
+ } catch (JSONException e) {
+ fail(Test.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DisplayModeTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DisplayModeTests.java
new file mode 100644
index 000000000..94387ef9a
--- /dev/null
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DisplayModeTests.java
@@ -0,0 +1,74 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.DisplayMode;
+
+import junit.framework.TestCase;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.enums.DisplayMode}
+ */
+public class DisplayModeTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums() {
+ String example = "DAY";
+ DisplayMode enumDay = DisplayMode.valueForString(example);
+ example = "NIGHT";
+ DisplayMode enumNight = DisplayMode.valueForString(example);
+ example = "AUTO";
+ DisplayMode enumAuto = DisplayMode.valueForString(example);
+
+ assertNotNull("DAY returned null", enumDay);
+ assertNotNull("NIGHT returned null", enumNight);
+ assertNotNull("AUTO returned null", enumAuto);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum() {
+ String example = "dAY";
+ try {
+ DisplayMode temp = DisplayMode.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ } catch (IllegalArgumentException exception) {
+ fail("Invalid enum throws IllegalArgumentException.");
+ }
+ }
+
+ /**
+ * Verifies that a null assignment is invalid.
+ */
+ public void testNullEnum() {
+ String example = null;
+ try {
+ DisplayMode temp = DisplayMode.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ } catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of DisplayMode.
+ */
+ public void testListEnum() {
+ List<DisplayMode> enumValueList = Arrays.asList(DisplayMode.values());
+
+ List<DisplayMode> enumTestList = new ArrayList<DisplayMode>();
+ enumTestList.add(DisplayMode.DAY);
+ enumTestList.add(DisplayMode.NIGHT);
+ enumTestList.add(DisplayMode.AUTO);
+
+ assertTrue("Enum value list does not match enum class list",
+ enumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList));
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DistanceUnitTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DistanceUnitTests.java
new file mode 100644
index 000000000..c421d6029
--- /dev/null
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/DistanceUnitTests.java
@@ -0,0 +1,69 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.DistanceUnit;
+
+import junit.framework.TestCase;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.enums.DistanceUnit}
+ */
+public class DistanceUnitTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums() {
+ String example = "MILES";
+ DistanceUnit enumMiles = DistanceUnit.valueForString(example);
+ example = "KILOMETERS";
+ DistanceUnit enumKilometers = DistanceUnit.valueForString(example);
+
+ assertNotNull("MILES returned null", enumMiles);
+ assertNotNull("KILOMETERS returned null", enumKilometers);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum() {
+ String example = "mILES";
+ try {
+ DistanceUnit temp = DistanceUnit.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ } catch (IllegalArgumentException exception) {
+ fail("Invalid enum throws IllegalArgumentException.");
+ }
+ }
+
+ /**
+ * Verifies that a null assignment is invalid.
+ */
+ public void testNullEnum() {
+ String example = null;
+ try {
+ DistanceUnit temp = DistanceUnit.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ } catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of DistanceUnit.
+ */
+ public void testListEnum() {
+ List<DistanceUnit> enumValueList = Arrays.asList(DistanceUnit.values());
+ List<DistanceUnit> enumTestList = new ArrayList<DistanceUnit>();
+ enumTestList.add(DistanceUnit.MILES);
+ enumTestList.add(DistanceUnit.KILOMETERS);
+
+ assertTrue("Enum value list does not match enum class list",
+ enumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList));
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LightNameTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LightNameTests.java
new file mode 100644
index 000000000..10df1e762
--- /dev/null
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LightNameTests.java
@@ -0,0 +1,261 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.LightName;
+
+import junit.framework.TestCase;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.enums.LightName}
+ */
+public class LightNameTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums() {
+ String example = "FRONT_LEFT_HIGH_BEAM";
+ LightName enumFrontLeftHighBeam = LightName.valueForString(example);
+ example = "FRONT_RIGHT_HIGH_BEAM";
+ LightName enumFrontRightHighBeam = LightName.valueForString(example);
+ example = "FRONT_LEFT_LOW_BEAM";
+ LightName enumFrontLeftLowBeam = LightName.valueForString(example);
+ example = "FRONT_RIGHT_LOW_BEAM";
+ LightName enumFrontRightLowBeam = LightName.valueForString(example);
+ example = "FRONT_LEFT_PARKING_LIGHT";
+ LightName enumFrontLeftParkingLight = LightName.valueForString(example);
+ example = "FRONT_RIGHT_PARKING_LIGHT";
+ LightName enumFrontRightParkingLight = LightName.valueForString(example);
+ example = "FRONT_LEFT_FOG_LIGHT";
+ LightName enumFrontLeftFogLight = LightName.valueForString(example);
+ example = "FRONT_RIGHT_FOG_LIGHT";
+ LightName enumFrontRightFogLight = LightName.valueForString(example);
+ example = "FRONT_LEFT_DAYTIME_RUNNING_LIGHT";
+ LightName enumFrontLeftDaytimeRunningLight = LightName.valueForString(example);
+ example = "FRONT_RIGHT_DAYTIME_RUNNING_LIGHT";
+ LightName enumFrontRightDaytimeRunningLight = LightName.valueForString(example);
+ example = "FRONT_LEFT_TURN_LIGHT";
+ LightName enumFrontLeftTurnLight = LightName.valueForString(example);
+ example = "FRONT_RIGHT_TURN_LIGHT";
+ LightName enumFrontRightTurnLight = LightName.valueForString(example);
+ example = "REAR_LEFT_FOG_LIGHT";
+ LightName enumRearLeftFogLight = LightName.valueForString(example);
+ example = "REAR_RIGHT_FOG_LIGHT";
+ LightName enumRearRightFogLight = LightName.valueForString(example);
+ example = "REAR_LEFT_TAIL_LIGHT";
+ LightName enumRearLeftTailLight = LightName.valueForString(example);
+ example = "REAR_RIGHT_TAIL_LIGHT";
+ LightName enumRearRightTailLight = LightName.valueForString(example);
+ example = "REAR_LEFT_BRAKE_LIGHT";
+ LightName enumRearLeftBrakeLight = LightName.valueForString(example);
+ example = "REAR_RIGHT_BRAKE_LIGHT";
+ LightName enumRearRightBrakeLight = LightName.valueForString(example);
+ example = "REAR_LEFT_TURN_LIGHT";
+ LightName enumRearLeftTurnLight = LightName.valueForString(example);
+ example = "REAR_RIGHT_TURN_LIGHT";
+ LightName enumRearRightTurnLight = LightName.valueForString(example);
+ example = "REAR_REGISTRATION_PLATE_LIGHT";
+ LightName enumRearRegistrationPlateLight = LightName.valueForString(example);
+ example = "HIGH_BEAMS";
+ LightName enumHighBeams = LightName.valueForString(example);
+ example = "LOW_BEAMS";
+ LightName enumLowBeams = LightName.valueForString(example);
+ example = "FOG_LIGHTS";
+ LightName enumFogLights = LightName.valueForString(example);
+ example = "RUNNING_LIGHTS";
+ LightName enumRunningLights = LightName.valueForString(example);
+ example = "PARKING_LIGHTS";
+ LightName enumParkingLights = LightName.valueForString(example);
+ example = "BRAKE_LIGHTS";
+ LightName enumBrakeLights = LightName.valueForString(example);
+ example = "REAR_REVERSING_LIGHTS";
+ LightName enumRearReversingLights = LightName.valueForString(example);
+ example = "SIDE_MARKER_LIGHTS";
+ LightName enumSideMarkerLights = LightName.valueForString(example);
+ example = "LEFT_TURN_LIGHTS";
+ LightName enumLeftTurnLights = LightName.valueForString(example);
+ example = "RIGHT_TURN_LIGHTS";
+ LightName enumRightTurnLights = LightName.valueForString(example);
+ example = "HAZARD_LIGHTS";
+ LightName enumHazardLights = LightName.valueForString(example);
+
+ example = "REAR_CARGO_LIGHTS";
+ LightName enumRearCargoLights = LightName.valueForString(example);
+ example = "REAR_TRUCK_BED_LIGHTS";
+ LightName enumRearTruckBedLights = LightName.valueForString(example);
+ example = "REAR_TRAILER_LIGHTS";
+ LightName enumRearTrailerLights = LightName.valueForString(example);
+ example = "LEFT_SPOT_LIGHTS";
+ LightName enumLeftSpotLights = LightName.valueForString(example);
+ example = "RIGHT_SPOT_LIGHTS";
+ LightName enumRightSpotLights = LightName.valueForString(example);
+ example = "LEFT_PUDDLE_LIGHTS";
+ LightName enumLeftPuddleLights = LightName.valueForString(example);
+ example = "RIGHT_PUDDLE_LIGHTS";
+ LightName enumRightPuddleLights = LightName.valueForString(example);
+ example = "AMBIENT_LIGHTS";
+ LightName enumAmbientLights = LightName.valueForString(example);
+ example = "OVERHEAD_LIGHTS";
+ LightName enumOverheadLights = LightName.valueForString(example);
+ example = "READING_LIGHTS";
+ LightName enumReadingLights = LightName.valueForString(example);
+ example = "TRUNK_LIGHTS";
+ LightName enumTrunkLights = LightName.valueForString(example);
+ example = "EXTERIOR_FRONT_LIGHTS";
+ LightName enumExteriorFrontLights = LightName.valueForString(example);
+ example = "EXTERIOR_REAR_LIGHTS";
+ LightName enumExteriorRearLights = LightName.valueForString(example);
+ example = "EXTERIOR_LEFT_LIGHTS";
+ LightName enumExteriorLeftLights = LightName.valueForString(example);
+ example = "EXTERIOR_RIGHT_LIGHTS";
+ LightName enumExteriorRightLights = LightName.valueForString(example);
+ example = "EXTERIOR_ALL_LIGHTS";
+ LightName enumExteriorAllLights = LightName.valueForString(example);
+
+ assertNotNull("FRONT_LEFT_HIGH_BEAM returned null", enumFrontLeftHighBeam);
+ assertNotNull("FRONT_RIGHT_HIGH_BEAM returned null", enumFrontRightHighBeam);
+ assertNotNull("FRONT_LEFT_LOW_BEAM returned null", enumFrontLeftLowBeam);
+ assertNotNull("FRONT_RIGHT_LOW_BEAM returned null", enumFrontRightLowBeam);
+ assertNotNull("FRONT_LEFT_PARKING_LIGHT returned null", enumFrontLeftParkingLight);
+ assertNotNull("FRONT_RIGHT_PARKING_LIGHT returned null", enumFrontRightParkingLight);
+ assertNotNull("FRONT_LEFT_FOG_LIGHT returned null", enumFrontLeftFogLight);
+ assertNotNull("FRONT_RIGHT_FOG_LIGHT returned null", enumFrontRightFogLight);
+ assertNotNull("FRONT_LEFT_DAYTIME_RUNNING_LIGHT returned null", enumFrontLeftDaytimeRunningLight);
+ assertNotNull("FRONT_RIGHT_DAYTIME_RUNNING_LIGHT returned null", enumFrontRightDaytimeRunningLight);
+
+ assertNotNull("FRONT_LEFT_TURN_LIGHT returned null", enumFrontLeftTurnLight);
+ assertNotNull("FRONT_RIGHT_TURN_LIGHT returned null", enumFrontRightTurnLight);
+ assertNotNull("REAR_LEFT_FOG_LIGHT returned null", enumRearLeftFogLight);
+ assertNotNull("REAR_RIGHT_FOG_LIGHT returned null", enumRearRightFogLight);
+ assertNotNull("REAR_LEFT_TAIL_LIGHT returned null", enumRearLeftTailLight);
+ assertNotNull("REAR_RIGHT_TAIL_LIGHT returned null", enumRearRightTailLight);
+ assertNotNull("REAR_LEFT_BRAKE_LIGHT returned null", enumRearLeftBrakeLight);
+ assertNotNull("REAR_RIGHT_BRAKE_LIGHT returned null", enumRearRightBrakeLight);
+ assertNotNull("REAR_LEFT_TURN_LIGHT returned null", enumRearLeftTurnLight);
+ assertNotNull("REAR_RIGHT_TURN_LIGHT returned null", enumRearRightTurnLight);
+ assertNotNull("REAR_REGISTRATION_PLATE_LIGHT returned null", enumRearRegistrationPlateLight);
+
+ assertNotNull("HIGH_BEAMS returned null", enumHighBeams);
+ assertNotNull("LOW_BEAMS returned null", enumLowBeams);
+ assertNotNull("FOG_LIGHTS returned null", enumFogLights);
+ assertNotNull("RUNNING_LIGHTS returned null", enumRunningLights);
+ assertNotNull("PARKING_LIGHTS returned null", enumParkingLights);
+ assertNotNull("BRAKE_LIGHTS returned null", enumBrakeLights);
+
+ assertNotNull("REAR_REVERSING_LIGHTS returned null", enumRearReversingLights);
+ assertNotNull("SIDE_MARKER_LIGHTS returned null", enumSideMarkerLights);
+ assertNotNull("LEFT_TURN_LIGHTS returned null", enumLeftTurnLights);
+ assertNotNull("RIGHT_TURN_LIGHTS returned null", enumRightTurnLights);
+ assertNotNull("HAZARD_LIGHTS returned null", enumHazardLights);
+ assertNotNull("REAR_CARGO_LIGHTS returned null", enumRearCargoLights);
+ assertNotNull("REAR_TRUCK_BED_LIGHTS returned null", enumRearTruckBedLights);
+ assertNotNull("REAR_TRAILER_LIGHTS returned null", enumRearTrailerLights);
+ assertNotNull("LEFT_SPOT_LIGHTS returned null", enumLeftSpotLights);
+ assertNotNull("RIGHT_SPOT_LIGHTS returned null", enumRightSpotLights);
+ assertNotNull("LEFT_PUDDLE_LIGHTS returned null", enumLeftPuddleLights);
+ assertNotNull("RIGHT_PUDDLE_LIGHTS returned null", enumRightPuddleLights);
+
+ assertNotNull("AMBIENT_LIGHTS returned null", enumAmbientLights);
+ assertNotNull("OVERHEAD_LIGHTS returned null", enumOverheadLights);
+ assertNotNull("READING_LIGHTS returned null", enumReadingLights);
+ assertNotNull("TRUNK_LIGHTS returned null", enumTrunkLights);
+
+ assertNotNull("EXTERIOR_FRONT_LIGHTS returned null", enumExteriorFrontLights);
+ assertNotNull("EXTERIOR_REAR_LIGHTS returned null", enumExteriorRearLights);
+ assertNotNull("EXTERIOR_LEFT_LIGHTS returned null", enumExteriorLeftLights);
+ assertNotNull("EXTERIOR_RIGHT_LIGHTS returned null", enumExteriorRightLights);
+
+ assertNotNull("EXTERIOR_ALL_LIGHTS returned null", enumExteriorAllLights);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum() {
+ String example = "fRONT_LEFT_HIGH_BEAM";
+ try {
+ LightName temp = LightName.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ } catch (IllegalArgumentException exception) {
+ fail("Invalid enum throws IllegalArgumentException.");
+ }
+ }
+
+ /**
+ * Verifies that a null assignment is invalid.
+ */
+ public void testNullEnum() {
+ String example = null;
+ try {
+ LightName temp = LightName.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ } catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of LightName.
+ */
+ public void testListEnum() {
+ List<LightName> enumValueList = Arrays.asList(LightName.values());
+
+ List<LightName> enumTestList = new ArrayList<LightName>();
+ enumTestList.add(LightName.FRONT_LEFT_HIGH_BEAM);
+ enumTestList.add(LightName.FRONT_RIGHT_HIGH_BEAM);
+ enumTestList.add(LightName.FRONT_LEFT_LOW_BEAM);
+ enumTestList.add(LightName.FRONT_RIGHT_LOW_BEAM);
+ enumTestList.add(LightName.FRONT_LEFT_PARKING_LIGHT);
+ enumTestList.add(LightName.FRONT_RIGHT_PARKING_LIGHT);
+ enumTestList.add(LightName.FRONT_LEFT_FOG_LIGHT);
+ enumTestList.add(LightName.FRONT_RIGHT_FOG_LIGHT);
+ enumTestList.add(LightName.FRONT_LEFT_DAYTIME_RUNNING_LIGHT);
+ enumTestList.add(LightName.FRONT_RIGHT_DAYTIME_RUNNING_LIGHT);
+ enumTestList.add(LightName.FRONT_LEFT_TURN_LIGHT);
+ enumTestList.add(LightName.FRONT_RIGHT_TURN_LIGHT);
+ enumTestList.add(LightName.REAR_LEFT_FOG_LIGHT);
+ enumTestList.add(LightName.REAR_RIGHT_FOG_LIGHT);
+ enumTestList.add(LightName.REAR_LEFT_TAIL_LIGHT);
+ enumTestList.add(LightName.REAR_RIGHT_TAIL_LIGHT);
+ enumTestList.add(LightName.REAR_LEFT_BRAKE_LIGHT);
+ enumTestList.add(LightName.REAR_RIGHT_BRAKE_LIGHT);
+ enumTestList.add(LightName.REAR_LEFT_TURN_LIGHT);
+ enumTestList.add(LightName.REAR_RIGHT_TURN_LIGHT);
+ enumTestList.add(LightName.REAR_REGISTRATION_PLATE_LIGHT);
+ enumTestList.add(LightName.HIGH_BEAMS);
+ enumTestList.add(LightName.LOW_BEAMS);
+ enumTestList.add(LightName.FOG_LIGHTS);
+ enumTestList.add(LightName.RUNNING_LIGHTS);
+ enumTestList.add(LightName.PARKING_LIGHTS);
+ enumTestList.add(LightName.BRAKE_LIGHTS);
+ enumTestList.add(LightName.REAR_REVERSING_LIGHTS);
+ enumTestList.add(LightName.SIDE_MARKER_LIGHTS);
+ enumTestList.add(LightName.LEFT_TURN_LIGHTS);
+ enumTestList.add(LightName.RIGHT_TURN_LIGHTS);
+ enumTestList.add(LightName.HAZARD_LIGHTS);
+ enumTestList.add(LightName.REAR_CARGO_LIGHTS);
+ enumTestList.add(LightName.REAR_TRUCK_BED_LIGHTS);
+ enumTestList.add(LightName.REAR_TRAILER_LIGHTS);
+ enumTestList.add(LightName.LEFT_SPOT_LIGHTS);
+ enumTestList.add(LightName.RIGHT_SPOT_LIGHTS);
+ enumTestList.add(LightName.LEFT_PUDDLE_LIGHTS);
+ enumTestList.add(LightName.RIGHT_PUDDLE_LIGHTS);
+ enumTestList.add(LightName.AMBIENT_LIGHTS);
+ enumTestList.add(LightName.OVERHEAD_LIGHTS);
+ enumTestList.add(LightName.READING_LIGHTS);
+ enumTestList.add(LightName.TRUNK_LIGHTS);
+ enumTestList.add(LightName.EXTERIOR_FRONT_LIGHTS);
+ enumTestList.add(LightName.EXTERIOR_REAR_LIGHTS);
+ enumTestList.add(LightName.EXTERIOR_LEFT_LIGHTS);
+ enumTestList.add(LightName.EXTERIOR_RIGHT_LIGHTS);
+ enumTestList.add(LightName.EXTERIOR_ALL_LIGHTS);
+
+ assertTrue("Enum value list does not match enum class list",
+ enumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList));
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LightStatusTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LightStatusTests.java
new file mode 100644
index 000000000..a97cd6eba
--- /dev/null
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/LightStatusTests.java
@@ -0,0 +1,86 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.LightStatus;
+
+import junit.framework.TestCase;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.rpc.enums.LightStatus}
+ */
+public class LightStatusTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums() {
+ String example = "ON";
+ LightStatus enumOn = LightStatus.valueForString(example);
+ example = "OFF";
+ LightStatus enumOff = LightStatus.valueForString(example);
+ example = "RAMP_UP";
+ LightStatus enumRampUp = LightStatus.valueForString(example);
+ example = "RAMP_DOWN";
+ LightStatus enumRampDown = LightStatus.valueForString(example);
+ example = "UNKNOWN";
+ LightStatus enumUnknown = LightStatus.valueForString(example);
+ example = "INVALID";
+ LightStatus enumInvalid = LightStatus.valueForString(example);
+
+ assertNotNull("ON returned null", enumOn);
+ assertNotNull("OFF returned null", enumOff);
+ assertNotNull("RAMP_UP returned null", enumRampUp);
+ assertNotNull("RAMP_DOWN returned null", enumRampDown);
+ assertNotNull("UNKNOWN returned null", enumUnknown);
+ assertNotNull("INVALID returned null", enumInvalid);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum() {
+ String example = "oN";
+ try {
+ LightStatus temp = LightStatus.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ } catch (IllegalArgumentException exception) {
+ fail("Invalid enum throws IllegalArgumentException.");
+ }
+ }
+
+ /**
+ * Verifies that a null assignment is invalid.
+ */
+ public void testNullEnum() {
+ String example = null;
+ try {
+ LightStatus temp = LightStatus.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ } catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of LightStatus.
+ */
+ public void testListEnum() {
+ List<LightStatus> enumValueList = Arrays.asList(LightStatus.values());
+
+ List<LightStatus> enumTestList = new ArrayList<LightStatus>();
+ enumTestList.add(LightStatus.ON);
+ enumTestList.add(LightStatus.OFF);
+ enumTestList.add(LightStatus.RAMP_UP);
+ enumTestList.add(LightStatus.RAMP_DOWN);
+ enumTestList.add(LightStatus.UNKNOWN);
+ enumTestList.add(LightStatus.INVALID);
+
+ assertTrue("Enum value list does not match enum class list",
+ enumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList));
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ModuleTypeTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ModuleTypeTests.java
index 9af8b4867..65432873e 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ModuleTypeTests.java
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ModuleTypeTests.java
@@ -9,7 +9,7 @@ import java.util.Arrays;
import java.util.List;
/**
- * This is a unit test class for the SmartDeviceLink library project class :
+ * This is a unit test class for the SmartDeviceLink library project class :
* {@link com.smartdevicelink.rpc.enums.ModuleType}
*/
public class ModuleTypeTests extends TestCase {
@@ -17,44 +17,51 @@ public class ModuleTypeTests extends TestCase {
/**
* Verifies that the enum values are not null upon valid assignment.
*/
- public void testValidEnums () {
+ public void testValidEnums() {
String example = "CLIMATE";
ModuleType enumClimate = ModuleType.valueForString(example);
example = "RADIO";
ModuleType enumRadio = ModuleType.valueForString(example);
example = "SEAT";
ModuleType enumSeat = ModuleType.valueForString(example);
+ example = "AUDIO";
+ ModuleType enumAudio = ModuleType.valueForString(example);
+ example = "LIGHT";
+ ModuleType enumLight = ModuleType.valueForString(example);
+ example = "HMI_SETTINGS";
+ ModuleType enumHmiSettings = ModuleType.valueForString(example);
assertNotNull("CLIMATE returned null", enumClimate);
assertNotNull("RADIO returned null", enumRadio);
assertNotNull("SEAT returned null", enumSeat);
+ assertNotNull("AUDIO returned null", enumAudio);
+ assertNotNull("LIGHT returned null", enumLight);
+ assertNotNull("HMI_SETTINGS returned null", enumHmiSettings);
}
/**
* Verifies that an invalid assignment is null.
*/
- public void testInvalidEnum () {
+ public void testInvalidEnum() {
String example = "cLIMATE";
try {
ModuleType temp = ModuleType.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (IllegalArgumentException exception) {
- fail("Invalid enum throws IllegalArgumentException.");
+ assertNull("Result of valueForString should be null.", temp);
+ } catch (IllegalArgumentException exception) {
+ fail("Invalid enum throws IllegalArgumentException.");
}
}
/**
* Verifies that a null assignment is invalid.
*/
- public void testNullEnum () {
+ public void testNullEnum() {
String example = null;
try {
ModuleType temp = ModuleType.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
+ assertNull("Result of valueForString should be null.", temp);
+ } catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
}
}
@@ -62,14 +69,17 @@ public class ModuleTypeTests extends TestCase {
* Verifies the possible enum values of ModuleType.
*/
public void testListEnum() {
- List<ModuleType> enumValueList = Arrays.asList(ModuleType.values());
+ List<ModuleType> enumValueList = Arrays.asList(ModuleType.values());
List<ModuleType> enumTestList = new ArrayList<ModuleType>();
enumTestList.add(ModuleType.CLIMATE);
enumTestList.add(ModuleType.RADIO);
enumTestList.add(ModuleType.SEAT);
+ enumTestList.add(ModuleType.AUDIO);
+ enumTestList.add(ModuleType.LIGHT);
+ enumTestList.add(ModuleType.HMI_SETTINGS);
- assertTrue("Enum value list does not match enum class list",
+ assertTrue("Enum value list does not match enum class list",
enumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList));
- }
+ }
} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PredefinedLayoutTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PredefinedLayoutTests.java
new file mode 100644
index 000000000..26b32d08b
--- /dev/null
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PredefinedLayoutTests.java
@@ -0,0 +1,144 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.PredefinedLayout;
+
+import junit.framework.TestCase;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.rpc.enums.PredefinedLayout}
+ */
+public class PredefinedLayoutTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "DEFAULT";
+ PredefinedLayout defaultenum = PredefinedLayout.valueForString(example);
+ example = "MEDIA";
+ PredefinedLayout media = PredefinedLayout.valueForString(example);
+ example = "NON-MEDIA";
+ PredefinedLayout nonmedia = PredefinedLayout.valueForString(example);
+ example = "ONSCREEN_PRESETS";
+ PredefinedLayout onscreen_presets = PredefinedLayout.valueForString(example);
+ example = "NAV_FULLSCREEN_MAP";
+ PredefinedLayout nav_fullscreen_map = PredefinedLayout.valueForString(example);
+ example = "NAV_LIST";
+ PredefinedLayout nav_list = PredefinedLayout.valueForString(example);
+ example = "NAV_KEYBOARD";
+ PredefinedLayout nav_keyboard = PredefinedLayout.valueForString(example);
+ example = "GRAPHIC_WITH_TEXT";
+ PredefinedLayout graphic_with_text = PredefinedLayout.valueForString(example);
+ example = "TEXT_WITH_GRAPHIC";
+ PredefinedLayout text_with_graphic = PredefinedLayout.valueForString(example);
+ example = "TILES_ONLY";
+ PredefinedLayout tiles_only = PredefinedLayout.valueForString(example);
+ example = "TEXTBUTTONS_ONLY";
+ PredefinedLayout textbuttons_only = PredefinedLayout.valueForString(example);
+ example = "GRAPHIC_WITH_TILES";
+ PredefinedLayout graphic_with_tiles = PredefinedLayout.valueForString(example);
+ example = "TILES_WITH_GRAPHIC";
+ PredefinedLayout tiles_with_graphic = PredefinedLayout.valueForString(example);
+ example = "GRAPHIC_WITH_TEXT_AND_SOFTBUTTONS";
+ PredefinedLayout graphic_with_text_and_softbuttons = PredefinedLayout.valueForString(example);
+ example = "TEXT_AND_SOFTBUTTONS_WITH_GRAPHIC";
+ PredefinedLayout text_and_softbuttons_with_graphics = PredefinedLayout.valueForString(example);
+ example = "GRAPHIC_WITH_TEXTBUTTONS";
+ PredefinedLayout graphic_with_textbuttons = PredefinedLayout.valueForString(example);
+ example = "TEXTBUTTONS_WITH_GRAPHIC";
+ PredefinedLayout textbuttons_with_graphic = PredefinedLayout.valueForString(example);
+ example = "LARGE_GRAPHIC_WITH_SOFTBUTTONS";
+ PredefinedLayout large_graphic_with_softbuttons = PredefinedLayout.valueForString(example);
+ example = "DOUBLE_GRAPHIC_WITH_SOFTBUTTONS";
+ PredefinedLayout double_graphic_with_softbuttons = PredefinedLayout.valueForString(example);
+ example = "LARGE_GRAPHIC_ONLY";
+ PredefinedLayout large_graphic_only = PredefinedLayout.valueForString(example);
+
+ assertNotNull("DEFAULT returned null", defaultenum);
+ assertNotNull("MEDIA returned null", media);
+ assertNotNull("NON-MEDIA returned null", nonmedia);
+ assertNotNull("ONSCREEN_PRESETS returned null", onscreen_presets);
+ assertNotNull("NAV_FULLSCREEN_MAP returned null", nav_fullscreen_map);
+ assertNotNull("NAV_LIST returned null", nav_list);
+ assertNotNull("NAV_KEYBOARD returned null", nav_keyboard);
+ assertNotNull("GRAPHIC_WITH_TEXT returned null", graphic_with_text);
+ assertNotNull("TEXT_WITH_GRAPHIC returned null", text_with_graphic);
+ assertNotNull("TILES_ONLY returned null", tiles_only);
+ assertNotNull("TEXTBUTTONS_ONLY returned null", textbuttons_only);
+ assertNotNull("GRAPHIC_WITH_TILES returned null", graphic_with_tiles);
+ assertNotNull("TILES_WITH_GRAPHIC returned null", tiles_with_graphic);
+ assertNotNull("GRAPHIC_WITH_TEXT_AND_SOFTBUTTONS returned null", graphic_with_text_and_softbuttons);
+ assertNotNull("TEXT_AND_SOFTBUTTONS_WITH_GRAPHIC returned null", text_and_softbuttons_with_graphics);
+ assertNotNull("GRAPHIC_WITH_TEXTBUTTONS returned null", graphic_with_textbuttons);
+ assertNotNull("TEXTBUTTONS_WITH_GRAPHIC returned null", textbuttons_with_graphic);
+ assertNotNull("LARGE_GRAPHIC_WITH_SOFTBUTTONS returned null", large_graphic_with_softbuttons);
+ assertNotNull("DOUBLE_GRAPHIC_WITH_SOFTBUTTONS returned null", double_graphic_with_softbuttons);
+ assertNotNull("LARGE_GRAPHIC_ONLY returned null", large_graphic_only);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "LARGE_GRApHIC_ONLY";
+ try {
+ PredefinedLayout temp = PredefinedLayout.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (IllegalArgumentException exception) {
+ fail("Invalid enum throws IllegalArgumentException.");
+ }
+ }
+
+ /**
+ * Verifies that a null assignment is invalid.
+ */
+ public void testNullEnum () {
+ String example = null;
+ try {
+ PredefinedLayout temp = PredefinedLayout.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of PredefinedLayout.
+ */
+ public void testListEnum() {
+ List<PredefinedLayout> enumValueList = Arrays.asList(PredefinedLayout.values());
+
+ List<PredefinedLayout> enumTestList = new ArrayList<>();
+
+ enumTestList.add(PredefinedLayout.DEFAULT);
+ enumTestList.add(PredefinedLayout.MEDIA);
+ enumTestList.add(PredefinedLayout.NON_MEDIA);
+ enumTestList.add(PredefinedLayout.ONSCREEN_PRESETS);
+ enumTestList.add(PredefinedLayout.NAV_FULLSCREEN_MAP);
+ enumTestList.add(PredefinedLayout.NAV_LIST);
+ enumTestList.add(PredefinedLayout.NAV_KEYBOARD);
+ enumTestList.add(PredefinedLayout.GRAPHIC_WITH_TEXT);
+ enumTestList.add(PredefinedLayout.TEXT_WITH_GRAPHIC);
+ enumTestList.add(PredefinedLayout.TILES_ONLY);
+ enumTestList.add(PredefinedLayout.TEXTBUTTONS_ONLY);
+ enumTestList.add(PredefinedLayout.GRAPHIC_WITH_TILES);
+ enumTestList.add(PredefinedLayout.TILES_WITH_GRAPHIC);
+ enumTestList.add(PredefinedLayout.GRAPHIC_WITH_TEXT_AND_SOFTBUTTONS);
+ enumTestList.add(PredefinedLayout.TEXT_AND_SOFTBUTTONS_WITH_GRAPHIC);
+ enumTestList.add(PredefinedLayout.GRAPHIC_WITH_TEXTBUTTONS);
+ enumTestList.add(PredefinedLayout.TEXTBUTTONS_WITH_GRAPHIC);
+ enumTestList.add(PredefinedLayout.LARGE_GRAPHIC_WITH_SOFTBUTTONS);
+ enumTestList.add(PredefinedLayout.DOUBLE_GRAPHIC_WITH_SOFTBUTTONS);
+ enumTestList.add(PredefinedLayout.LARGE_GRAPHIC_ONLY);
+
+ assertTrue("Enum value list does not match enum class list",
+ enumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList));
+ }
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PrimaryAudioSourceTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PrimaryAudioSourceTests.java
index 94c2e2b39..b3432985d 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PrimaryAudioSourceTests.java
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/PrimaryAudioSourceTests.java
@@ -1,16 +1,16 @@
package com.smartdevicelink.test.rpc.enums;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
+import com.smartdevicelink.proxy.rpc.enums.PrimaryAudioSource;
import junit.framework.TestCase;
-import com.smartdevicelink.proxy.rpc.enums.PrimaryAudioSource;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
/**
- * This is a unit test class for the SmartDeviceLink library project class :
+ * This is a unit test class for the SmartDeviceLink library project class :
* {@link com.smartdevicelink.rpc.enums.PrimaryAudioSource}
*/
public class PrimaryAudioSourceTests extends TestCase {
@@ -18,7 +18,7 @@ public class PrimaryAudioSourceTests extends TestCase {
/**
* Verifies that the enum values are not null upon valid assignment.
*/
- public void testValidEnums () {
+ public void testValidEnums() {
String example = "NO_SOURCE_SELECTED";
PrimaryAudioSource enumNoSourceSelected = PrimaryAudioSource.valueForString(example);
example = "USB";
@@ -33,7 +33,17 @@ public class PrimaryAudioSourceTests extends TestCase {
PrimaryAudioSource enumIpod = PrimaryAudioSource.valueForString(example);
example = "MOBILE_APP";
PrimaryAudioSource enumMobileApp = PrimaryAudioSource.valueForString(example);
-
+ example = "CD";
+ PrimaryAudioSource enumCd = PrimaryAudioSource.valueForString(example);
+ example = "AM";
+ PrimaryAudioSource enumAm = PrimaryAudioSource.valueForString(example);
+ example = "FM";
+ PrimaryAudioSource enumFm = PrimaryAudioSource.valueForString(example);
+ example = "XM";
+ PrimaryAudioSource enumXm = PrimaryAudioSource.valueForString(example);
+ example = "DAB";
+ PrimaryAudioSource enumDab = PrimaryAudioSource.valueForString(example);
+
assertNotNull("NO_SOURCE_SELECTED returned null", enumNoSourceSelected);
assertNotNull("USB returned null", enumUsb);
assertNotNull("USB2 returned null", enumUsb2);
@@ -41,42 +51,45 @@ public class PrimaryAudioSourceTests extends TestCase {
assertNotNull("LINE_IN returned null", enumLineIn);
assertNotNull("IPOD returned null", enumIpod);
assertNotNull("MOBILE_APP returned null", enumMobileApp);
+ assertNotNull("CD returned null", enumCd);
+ assertNotNull("AM returned null", enumAm);
+ assertNotNull("FM returned null", enumFm);
+ assertNotNull("XM returned null", enumXm);
+ assertNotNull("DAB returned null", enumDab);
}
/**
* Verifies that an invalid assignment is null.
*/
- public void testInvalidEnum () {
+ public void testInvalidEnum() {
String example = "no_SouRCe_SelEcteD";
try {
- PrimaryAudioSource temp = PrimaryAudioSource.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (IllegalArgumentException exception) {
- fail("Invalid enum throws IllegalArgumentException.");
+ PrimaryAudioSource temp = PrimaryAudioSource.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ } catch (IllegalArgumentException exception) {
+ fail("Invalid enum throws IllegalArgumentException.");
}
}
/**
* Verifies that a null assignment is invalid.
*/
- public void testNullEnum () {
+ public void testNullEnum() {
String example = null;
try {
- PrimaryAudioSource temp = PrimaryAudioSource.valueForString(example);
- assertNull("Result of valueForString should be null.", temp);
- }
- catch (NullPointerException exception) {
- fail("Null string throws NullPointerException.");
+ PrimaryAudioSource temp = PrimaryAudioSource.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ } catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
}
- }
-
+ }
+
/**
* Verifies the possible enum values of PrimaryAudioSource.
*/
public void testListEnum() {
- List<PrimaryAudioSource> enumValueList = Arrays.asList(PrimaryAudioSource.values());
+ List<PrimaryAudioSource> enumValueList = Arrays.asList(PrimaryAudioSource.values());
List<PrimaryAudioSource> enumTestList = new ArrayList<PrimaryAudioSource>();
enumTestList.add(PrimaryAudioSource.NO_SOURCE_SELECTED);
@@ -84,10 +97,15 @@ public class PrimaryAudioSourceTests extends TestCase {
enumTestList.add(PrimaryAudioSource.USB2);
enumTestList.add(PrimaryAudioSource.BLUETOOTH_STEREO_BTST);
enumTestList.add(PrimaryAudioSource.LINE_IN);
- enumTestList.add(PrimaryAudioSource.IPOD);
+ enumTestList.add(PrimaryAudioSource.IPOD);
enumTestList.add(PrimaryAudioSource.MOBILE_APP);
+ enumTestList.add(PrimaryAudioSource.CD);
+ enumTestList.add(PrimaryAudioSource.AM);
+ enumTestList.add(PrimaryAudioSource.FM);
+ enumTestList.add(PrimaryAudioSource.XM);
+ enumTestList.add(PrimaryAudioSource.DAB);
- assertTrue("Enum value list does not match enum class list",
+ assertTrue("Enum value list does not match enum class list",
enumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList));
- }
+ }
} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/StaticIconNameTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/StaticIconNameTests.java
new file mode 100644
index 000000000..b85905039
--- /dev/null
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/StaticIconNameTests.java
@@ -0,0 +1,931 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.StaticIconName;
+
+import junit.framework.TestCase;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library project class :
+ * {@link com.smartdevicelink.proxy.rpc.enums.StaticIconName}
+ */
+public class StaticIconNameTests extends TestCase {
+
+ public void testValidEnums(){
+ String example = "0x29";
+ StaticIconName ACCEPT_CALL = StaticIconName.valueForString(example);
+ assertNotNull("ACCEPT_CALL returned null", ACCEPT_CALL);
+
+ example = "0x1B";
+ StaticIconName ADD_WAYPOINT = StaticIconName.valueForString(example);
+ assertNotNull("ADD_WAYPOINT returned null", ADD_WAYPOINT);
+
+ example = "0x21";
+ StaticIconName ALBUM = StaticIconName.valueForString(example);
+ assertNotNull("ALBUM returned null", ALBUM);
+
+ example = "0x3d";
+ StaticIconName AMBIENT_LIGHTING = StaticIconName.valueForString(example);
+ assertNotNull("AMBIENT_LIGHTING returned null", AMBIENT_LIGHTING);
+
+ example = "0x40";
+ StaticIconName ARROW_NORTH = StaticIconName.valueForString(example);
+ assertNotNull("ARROW_NORTH returned null", ARROW_NORTH);
+
+ example = "0x12";
+ StaticIconName AUDIO_MUTE = StaticIconName.valueForString(example);
+ assertNotNull("AUDIO_MUTE returned null", AUDIO_MUTE);
+
+ example = "0x83";
+ StaticIconName AUDIOBOOK_EPISODE = StaticIconName.valueForString(example);
+ assertNotNull("AUDIOBOOK_EPISODE returned null", AUDIOBOOK_EPISODE);
+
+ example = "0x82";
+ StaticIconName AUDIOBOOK_NARRATOR = StaticIconName.valueForString(example);
+ assertNotNull("AUDIOBOOK_NARRATOR returned null", AUDIOBOOK_NARRATOR);
+
+ example = "0x45";
+ StaticIconName AUXILLARY_AUDIO = StaticIconName.valueForString(example);
+ assertNotNull("AUXILLARY_AUDIO returned null", AUXILLARY_AUDIO);
+
+ example = "0x86";
+ StaticIconName BACK = StaticIconName.valueForString(example);
+ assertNotNull("BACK returned null", BACK);
+
+ example = "0xF7";
+ StaticIconName BATTERY_CAPACITY_0_OF_5 = StaticIconName.valueForString(example);
+ assertNotNull("BATTERY_CAPACITY_0_OF_5 returned null", BATTERY_CAPACITY_0_OF_5);
+
+ example = "0xF8";
+ StaticIconName BATTERY_CAPACITY_1_OF_5 = StaticIconName.valueForString(example);
+ assertNotNull("BATTERY_CAPACITY_1_OF_5 returned null", BATTERY_CAPACITY_1_OF_5);
+
+ example = "0xF9";
+ StaticIconName BATTERY_CAPACITY_2_OF_5 = StaticIconName.valueForString(example);
+ assertNotNull("BATTERY_CAPACITY_2_OF_5 returned null", BATTERY_CAPACITY_2_OF_5);
+
+ example = "0xFA";
+ StaticIconName BATTERY_CAPACITY_3_OF_5 = StaticIconName.valueForString(example);
+ assertNotNull("BATTERY_CAPACITY_3_OF_5 returned null", BATTERY_CAPACITY_3_OF_5);
+
+ example = "0xf6";
+ StaticIconName BATTERY_CAPACITY_4_OF_5 = StaticIconName.valueForString(example);
+ assertNotNull("BATTERY_CAPACITY_4_OF_5 returned null", BATTERY_CAPACITY_4_OF_5);
+
+ example = "0xFB";
+ StaticIconName BATTERY_CAPACITY_5_OF_5 = StaticIconName.valueForString(example);
+ assertNotNull("BATTERY_CAPACITY_5_OF_5 returned null", BATTERY_CAPACITY_5_OF_5);
+
+ example = "0x09";
+ StaticIconName BLUETOOTH_AUDIO_SOURCE = StaticIconName.valueForString(example);
+ assertNotNull("BLUETOOTH_AUDIO_SOURCE returned null", BLUETOOTH_AUDIO_SOURCE);
+
+ example = "0xcc";
+ StaticIconName BLUETOOTH1 = StaticIconName.valueForString(example);
+ assertNotNull("BLUETOOTH1 returned null", BLUETOOTH1);
+
+ example = "0xCD";
+ StaticIconName BLUETOOTH2 = StaticIconName.valueForString(example);
+ assertNotNull("BLUETOOTH2 returned null", BLUETOOTH2);
+
+ example = "0x77";
+ StaticIconName BROWSE = StaticIconName.valueForString(example);
+ assertNotNull("BROWSE returned null", BROWSE);
+
+ example = "0x66";
+ StaticIconName CELL_PHONE_IN_ROAMING_MODE = StaticIconName.valueForString(example);
+ assertNotNull("CELL_PHONE_IN_ROAMING_MODE returned null", CELL_PHONE_IN_ROAMING_MODE);
+
+ example = "0x67";
+ StaticIconName CELL_SERVICE_SIGNAL_STRENGTH_0_OF_5_BARS = StaticIconName.valueForString(example);
+ assertNotNull("CELL_SERVICE_SIGNAL_STRENGTH_0_OF_5_BARS returned null", CELL_SERVICE_SIGNAL_STRENGTH_0_OF_5_BARS);
+
+ example = "0x68";
+ StaticIconName CELL_SERVICE_SIGNAL_STRENGTH_1_OF_5_BARS = StaticIconName.valueForString(example);
+ assertNotNull("CELL_SERVICE_SIGNAL_STRENGTH_1_OF_5_BARS returned null", CELL_SERVICE_SIGNAL_STRENGTH_1_OF_5_BARS);
+
+ example = "0x69";
+ StaticIconName CELL_SERVICE_SIGNAL_STRENGTH_2_OF_5_BARS = StaticIconName.valueForString(example);
+ assertNotNull("CELL_SERVICE_SIGNAL_STRENGTH_2_OF_5_BARS returned null", CELL_SERVICE_SIGNAL_STRENGTH_2_OF_5_BARS);
+
+ example = "0x6A";
+ StaticIconName CELL_SERVICE_SIGNAL_STRENGTH_3_OF_5_BARS = StaticIconName.valueForString(example);
+ assertNotNull("CELL_SERVICE_SIGNAL_STRENGTH_3_OF_5_BARS returned null", CELL_SERVICE_SIGNAL_STRENGTH_3_OF_5_BARS);
+
+ example = "0x6B";
+ StaticIconName CELL_SERVICE_SIGNAL_STRENGTH_4_OF_5_BARS = StaticIconName.valueForString(example);
+ assertNotNull("CELL_SERVICE_SIGNAL_STRENGTH_4_OF_5_BARS returned null", CELL_SERVICE_SIGNAL_STRENGTH_4_OF_5_BARS);
+
+ example = "0xd3";
+ StaticIconName CELL_SERVICE_SIGNAL_STRENGTH_5_OF_5_BARS = StaticIconName.valueForString(example);
+ assertNotNull("CELL_SERVICE_SIGNAL_STRENGTH_5_OF_5_BARS returned null", CELL_SERVICE_SIGNAL_STRENGTH_5_OF_5_BARS);
+
+ example = "0xc3";
+ StaticIconName CHANGE_LANE_LEFT = StaticIconName.valueForString(example);
+ assertNotNull("CHANGE_LANE_LEFT returned null", CHANGE_LANE_LEFT);
+
+ example = "0xc1";
+ StaticIconName CHANGE_LANE_RIGHT = StaticIconName.valueForString(example);
+ assertNotNull("CHANGE_LANE_RIGHT returned null", CHANGE_LANE_RIGHT);
+
+ example = "0x27";
+ StaticIconName CHECK_BOX_CHECKED = StaticIconName.valueForString(example);
+ assertNotNull("CHECK_BOX_CHECKED returned null", CHECK_BOX_CHECKED);
+
+ example = "0x28";
+ StaticIconName CHECK_BOX_UNCHECKED = StaticIconName.valueForString(example);
+ assertNotNull("CHECK_BOX_UNCHECKED returned null", CHECK_BOX_UNCHECKED);
+
+ example = "0xd1";
+ StaticIconName CLIMATE = StaticIconName.valueForString(example);
+ assertNotNull("CLIMATE returned null", CLIMATE);
+
+ example = "0xfc";
+ StaticIconName CLOCK = StaticIconName.valueForString(example);
+ assertNotNull("CLOCK returned null", CLOCK);
+
+ example = "0x1A";
+ StaticIconName COMPOSE = StaticIconName.valueForString(example);
+ assertNotNull("COMPOSE returned null", COMPOSE);
+
+ example = "0x5C";
+ StaticIconName CONTACT = StaticIconName.valueForString(example);
+ assertNotNull("CONTACT returned null", CONTACT);
+
+ example = "0x42";
+ StaticIconName CONTINUE = StaticIconName.valueForString(example);
+ assertNotNull("CONTINUE returned null", CONTINUE);
+
+ example = "0x7F";
+ StaticIconName DASH = StaticIconName.valueForString(example);
+ assertNotNull("DASH returned null", DASH);
+
+ example = "0x87";
+ StaticIconName DATE = StaticIconName.valueForString(example);
+ assertNotNull("DATE returned null", DATE);
+
+ example = "0x0F";
+ StaticIconName DELETE = StaticIconName.valueForString(example);
+ assertNotNull("DELETE returned null", DELETE);
+
+ example = "0x94";
+ StaticIconName DESTINATION = StaticIconName.valueForString(example);
+ assertNotNull("DESTINATION returned null", DESTINATION);
+
+ example = "0x4D";
+ StaticIconName DESTINATION_FERRY_AHEAD = StaticIconName.valueForString(example);
+ assertNotNull("DESTINATION_FERRY_AHEAD returned null", DESTINATION_FERRY_AHEAD);
+
+ example = "0x2B";
+ StaticIconName EBOOKMARK = StaticIconName.valueForString(example);
+ assertNotNull("EBOOKMARK returned null", EBOOKMARK);
+
+ example = "0x2C";
+ StaticIconName END_CALL = StaticIconName.valueForString(example);
+ assertNotNull("END_CALL returned null", END_CALL);
+
+ example = "0xD6";
+ StaticIconName FAIL = StaticIconName.valueForString(example);
+ assertNotNull("FAIL returned null", FAIL);
+
+ example = "0x08";
+ StaticIconName FAST_FORWARD_30_SECS = StaticIconName.valueForString(example);
+ assertNotNull("FAST_FORWARD_30_SECS returned null", FAST_FORWARD_30_SECS);
+
+ example = "0x0E";
+ StaticIconName FAVORITE_HEART = StaticIconName.valueForString(example);
+ assertNotNull("FAVORITE_HEART returned null", FAVORITE_HEART);
+
+ example = "0x95";
+ StaticIconName FAVORITE_STAR = StaticIconName.valueForString(example);
+ assertNotNull("FAVORITE_STAR returned null", FAVORITE_STAR);
+
+ example = "0x80";
+ StaticIconName FAX_NUMBER = StaticIconName.valueForString(example);
+ assertNotNull("FAX_NUMBER returned null", FAX_NUMBER);
+
+ example = "0x50";
+ StaticIconName FILENAME = StaticIconName.valueForString(example);
+ assertNotNull("FILENAME returned null", FILENAME);
+
+ example = "0x79";
+ StaticIconName FILTER = StaticIconName.valueForString(example);
+ assertNotNull("FILTER returned null", FILTER);
+
+ example = "0x1C";
+ StaticIconName FOLDER = StaticIconName.valueForString(example);
+ assertNotNull("FOLDER returned null", FOLDER);
+
+ example = "0xe9";
+ StaticIconName FUEL_PRICES = StaticIconName.valueForString(example);
+ assertNotNull("FUEL_PRICES returned null", FUEL_PRICES);
+
+ example = "0x0c";
+ StaticIconName FULL_MAP = StaticIconName.valueForString(example);
+ assertNotNull("FULL_MAP returned null", FULL_MAP);
+
+ example = "0x53";
+ StaticIconName GENERIC_PHONE_NUMBER = StaticIconName.valueForString(example);
+ assertNotNull("GENERIC_PHONE_NUMBER returned null", GENERIC_PHONE_NUMBER);
+
+ example = "0x4E";
+ StaticIconName GENRE = StaticIconName.valueForString(example);
+ assertNotNull("GENRE returned null", GENRE);
+
+ example = "0xea";
+ StaticIconName GLOBAL_KEYBOARD = StaticIconName.valueForString(example);
+ assertNotNull("GLOBAL_KEYBOARD returned null", GLOBAL_KEYBOARD);
+
+ example = "0xf4";
+ StaticIconName HIGHWAY_EXIT_INFORMATION = StaticIconName.valueForString(example);
+ assertNotNull("HIGHWAY_EXIT_INFORMATION returned null", HIGHWAY_EXIT_INFORMATION);
+
+ example = "0x55";
+ StaticIconName HOME_PHONE_NUMBER = StaticIconName.valueForString(example);
+ assertNotNull("HOME_PHONE_NUMBER returned null", HOME_PHONE_NUMBER);
+
+ example = "0x78";
+ StaticIconName HYPERLINK = StaticIconName.valueForString(example);
+ assertNotNull("HYPERLINK returned null", HYPERLINK);
+
+ example = "0x51";
+ StaticIconName ID3_TAG_UNKNOWN = StaticIconName.valueForString(example);
+ assertNotNull("ID3_TAG_UNKNOWN returned null", ID3_TAG_UNKNOWN);
+
+ example = "0x57";
+ StaticIconName INCOMING_CALLS = StaticIconName.valueForString(example);
+ assertNotNull("INCOMING_CALLS returned null", INCOMING_CALLS);
+
+ example = "0x5d";
+ StaticIconName INFORMATION = StaticIconName.valueForString(example);
+ assertNotNull("INFORMATION returned null", INFORMATION);
+
+ example = "0x0D";
+ StaticIconName IPOD_MEDIA_SOURCE = StaticIconName.valueForString(example);
+ assertNotNull("IPOD_MEDIA_SOURCE returned null", IPOD_MEDIA_SOURCE);
+
+ example = "0x02";
+ StaticIconName JOIN_CALLS = StaticIconName.valueForString(example);
+ assertNotNull("JOIN_CALLS returned null", JOIN_CALLS);
+
+ example = "0x46";
+ StaticIconName KEEP_LEFT = StaticIconName.valueForString(example);
+ assertNotNull("KEEP_LEFT returned null", KEEP_LEFT);
+
+ example = "0x48";
+ StaticIconName KEEP_RIGHT = StaticIconName.valueForString(example);
+ assertNotNull("KEEP_RIGHT returned null", KEEP_RIGHT);
+
+ example = "0x7D";
+ StaticIconName KEY = StaticIconName.valueForString(example);
+ assertNotNull("KEY returned null", KEY);
+
+ example = "0x9f";
+ StaticIconName LEFT = StaticIconName.valueForString(example);
+ assertNotNull("LEFT returned null", LEFT);
+
+ example = "0x4B";
+ StaticIconName LEFT_ARROW = StaticIconName.valueForString(example);
+ assertNotNull("LEFT_ARROW returned null", LEFT_ARROW);
+
+ example = "0xaf";
+ StaticIconName LEFT_EXIT = StaticIconName.valueForString(example);
+ assertNotNull("LEFT_EXIT returned null", LEFT_EXIT);
+
+ example = "0x06";
+ StaticIconName LINE_IN_AUDIO_SOURCE = StaticIconName.valueForString(example);
+ assertNotNull("LINE_IN_AUDIO_SOURCE returned null", LINE_IN_AUDIO_SOURCE);
+
+ example = "0x22";
+ StaticIconName LOCKED = StaticIconName.valueForString(example);
+ assertNotNull("LOCKED returned null", LOCKED);
+
+ example = "0x17";
+ StaticIconName MEDIA_CONTROL_LEFT_ARROW = StaticIconName.valueForString(example);
+ assertNotNull("MEDIA_CONTROL_LEFT_ARROW returned null", MEDIA_CONTROL_LEFT_ARROW);
+
+ example = "0x20";
+ StaticIconName MEDIA_CONTROL_RECORDING = StaticIconName.valueForString(example);
+ assertNotNull("MEDIA_CONTROL_RECORDING returned null", MEDIA_CONTROL_RECORDING);
+
+ example = "0x15";
+ StaticIconName MEDIA_CONTROL_RIGHT_ARROW = StaticIconName.valueForString(example);
+ assertNotNull("MEDIA_CONTROL_RIGHT_ARROW returned null", MEDIA_CONTROL_RIGHT_ARROW);
+
+ example = "0x16";
+ StaticIconName MEDIA_CONTROL_STOP = StaticIconName.valueForString(example);
+ assertNotNull("MEDIA_CONTROL_STOP returned null", MEDIA_CONTROL_STOP);
+
+ example = "0xe8";
+ StaticIconName MICROPHONE = StaticIconName.valueForString(example);
+ assertNotNull("MICROPHONE returned null", MICROPHONE);
+
+ example = "0x58";
+ StaticIconName MISSED_CALLS = StaticIconName.valueForString(example);
+ assertNotNull("MISSED_CALLS returned null", MISSED_CALLS);
+
+ example = "0x54";
+ StaticIconName MOBILE_PHONE_NUMBER = StaticIconName.valueForString(example);
+ assertNotNull("MOBILE_PHONE_NUMBER returned null", MOBILE_PHONE_NUMBER);
+
+ example = "0xE5";
+ StaticIconName MOVE_DOWN = StaticIconName.valueForString(example);
+ assertNotNull("MOVE_DOWN returned null", MOVE_DOWN);
+
+ example = "0xe4";
+ StaticIconName MOVE_UP = StaticIconName.valueForString(example);
+ assertNotNull("MOVE_UP returned null", MOVE_UP);
+
+ example = "0x24";
+ StaticIconName MP3_TAG_ARTIST = StaticIconName.valueForString(example);
+ assertNotNull("MP3_TAG_ARTIST returned null", MP3_TAG_ARTIST);
+
+ example = "0x8e";
+ StaticIconName NAVIGATION = StaticIconName.valueForString(example);
+ assertNotNull("NAVIGATION returned null", NAVIGATION);
+
+ example = "0x0a";
+ StaticIconName NAVIGATION_CURRENT_DIRECTION = StaticIconName.valueForString(example);
+ assertNotNull("NAVIGATION_CURRENT_DIRECTION returned null", NAVIGATION_CURRENT_DIRECTION);
+
+ example = "0x14";
+ StaticIconName NEGATIVE_RATING_THUMBS_DOWN = StaticIconName.valueForString(example);
+ assertNotNull("NEGATIVE_RATING_THUMBS_DOWN returned null", NEGATIVE_RATING_THUMBS_DOWN);
+
+ example = "0x5E";
+ StaticIconName NEW = StaticIconName.valueForString(example);
+ assertNotNull("NEW returned null", NEW);
+
+ example = "0x56";
+ StaticIconName OFFICE_PHONE_NUMBER = StaticIconName.valueForString(example);
+ assertNotNull("OFFICE_PHONE_NUMBER returned null", OFFICE_PHONE_NUMBER);
+
+ example = "0x5F";
+ StaticIconName OPENED = StaticIconName.valueForString(example);
+ assertNotNull("OPENED returned null", OPENED);
+
+ example = "0x96";
+ StaticIconName ORIGIN = StaticIconName.valueForString(example);
+ assertNotNull("ORIGIN returned null", ORIGIN);
+
+ example = "0x59";
+ StaticIconName OUTGOING_CALLS = StaticIconName.valueForString(example);
+ assertNotNull("OUTGOING_CALLS returned null", OUTGOING_CALLS);
+
+ example = "0x1D";
+ StaticIconName PHONE_CALL_1 = StaticIconName.valueForString(example);
+ assertNotNull("PHONE_CALL_1 returned null", PHONE_CALL_1);
+
+ example = "0x1E";
+ StaticIconName PHONE_CALL_2 = StaticIconName.valueForString(example);
+ assertNotNull("PHONE_CALL_2 returned null", PHONE_CALL_2);
+
+ example = "0x03";
+ StaticIconName PHONE_DEVICE = StaticIconName.valueForString(example);
+ assertNotNull("PHONE_DEVICE returned null", PHONE_DEVICE);
+
+ example = "0x81";
+ StaticIconName PHONEBOOK = StaticIconName.valueForString(example);
+ assertNotNull("PHONEBOOK returned null", PHONEBOOK);
+
+ example = "0x88";
+ StaticIconName PHOTO = StaticIconName.valueForString(example);
+ assertNotNull("PHOTO returned null", PHOTO);
+
+ example = "0xD0";
+ StaticIconName PLAY = StaticIconName.valueForString(example);
+ assertNotNull("PLAY returned null", PLAY);
+
+ example = "0x4F";
+ StaticIconName PLAYLIST = StaticIconName.valueForString(example);
+ assertNotNull("PLAYLIST returned null", PLAYLIST);
+
+ example = "0x76";
+ StaticIconName POPUP = StaticIconName.valueForString(example);
+ assertNotNull("POPUP returned null", POPUP);
+
+ example = "0x13";
+ StaticIconName POSITIVE_RATING_THUMBS_UP = StaticIconName.valueForString(example);
+ assertNotNull("POSITIVE_RATING_THUMBS_UP returned null", POSITIVE_RATING_THUMBS_UP);
+
+ example = "0x5b";
+ StaticIconName POWER = StaticIconName.valueForString(example);
+ assertNotNull("POWER returned null", POWER);
+
+ example = "0x1F";
+ StaticIconName PRIMARY_PHONE = StaticIconName.valueForString(example);
+ assertNotNull("PRIMARY_PHONE returned null", PRIMARY_PHONE);
+
+ example = "0x25";
+ StaticIconName RADIO_BUTTON_CHECKED = StaticIconName.valueForString(example);
+ assertNotNull("RADIO_BUTTON_CHECKED returned null", RADIO_BUTTON_CHECKED);
+
+ example = "0x26";
+ StaticIconName RADIO_BUTTON_UNCHECKED = StaticIconName.valueForString(example);
+ assertNotNull("RADIO_BUTTON_UNCHECKED returned null", RADIO_BUTTON_UNCHECKED);
+
+ example = "0xe7";
+ StaticIconName RECENT_CALLS = StaticIconName.valueForString(example);
+ assertNotNull("RECENT_CALLS returned null", RECENT_CALLS);
+
+ example = "0xf2";
+ StaticIconName RECENT_DESTINATIONS = StaticIconName.valueForString(example);
+ assertNotNull("RECENT_DESTINATIONS returned null", RECENT_DESTINATIONS);
+
+ example = "0x19";
+ StaticIconName REDO = StaticIconName.valueForString(example);
+ assertNotNull("REDO returned null", REDO);
+
+ example = "0x97";
+ StaticIconName REFRESH = StaticIconName.valueForString(example);
+ assertNotNull("REFRESH returned null", REFRESH);
+
+ example = "0x7E";
+ StaticIconName REMOTE_DIAGNOSTICS_CHECK_ENGINE = StaticIconName.valueForString(example);
+ assertNotNull("REMOTE_DIAGNOSTICS_CHECK_ENGINE returned null", REMOTE_DIAGNOSTICS_CHECK_ENGINE);
+
+ example = "0xac";
+ StaticIconName RENDERED_911_ASSIST = StaticIconName.valueForString(example);
+ assertNotNull("RENDERED_911_ASSIST returned null", RENDERED_911_ASSIST);
+
+ example = "0xe6";
+ StaticIconName REPEAT = StaticIconName.valueForString(example);
+ assertNotNull("REPEAT returned null", REPEAT);
+
+ example = "0x73";
+ StaticIconName REPEAT_PLAY = StaticIconName.valueForString(example);
+ assertNotNull("REPEAT_PLAY returned null", REPEAT_PLAY);
+
+ example = "0x04";
+ StaticIconName REPLY = StaticIconName.valueForString(example);
+ assertNotNull("REPLY returned null", REPLY);
+
+ example = "0x07";
+ StaticIconName REWIND_30_SECS = StaticIconName.valueForString(example);
+ assertNotNull("REWIND_30_SECS returned null", REWIND_30_SECS);
+
+ example = "0xa3";
+ StaticIconName RIGHT = StaticIconName.valueForString(example);
+ assertNotNull("RIGHT returned null", RIGHT);
+
+ example = "0xb1";
+ StaticIconName RIGHT_EXIT = StaticIconName.valueForString(example);
+ assertNotNull("RIGHT_EXIT returned null", RIGHT_EXIT);
+
+ example = "0x5A";
+ StaticIconName RINGTONES = StaticIconName.valueForString(example);
+ assertNotNull("RINGTONES returned null", RINGTONES);
+
+ example = "0xee";
+ StaticIconName ROUNDABOUT_LEFT_HAND_1 = StaticIconName.valueForString(example);
+ assertNotNull("ROUNDABOUT_LEFT_HAND_1 returned null", ROUNDABOUT_LEFT_HAND_1);
+
+ example = "0x8c";
+ StaticIconName ROUNDABOUT_LEFT_HAND_2 = StaticIconName.valueForString(example);
+ assertNotNull("ROUNDABOUT_LEFT_HAND_2 returned null", ROUNDABOUT_LEFT_HAND_2);
+
+ example = "0x84";
+ StaticIconName ROUNDABOUT_LEFT_HAND_3 = StaticIconName.valueForString(example);
+ assertNotNull("ROUNDABOUT_LEFT_HAND_3 returned null", ROUNDABOUT_LEFT_HAND_3);
+
+ example = "0x72";
+ StaticIconName ROUNDABOUT_LEFT_HAND_4 = StaticIconName.valueForString(example);
+ assertNotNull("ROUNDABOUT_LEFT_HAND_4 returned null", ROUNDABOUT_LEFT_HAND_4);
+
+ example = "0x6e";
+ StaticIconName ROUNDABOUT_LEFT_HAND_5 = StaticIconName.valueForString(example);
+ assertNotNull("ROUNDABOUT_LEFT_HAND_5 returned null", ROUNDABOUT_LEFT_HAND_5);
+
+ example = "0x64";
+ StaticIconName ROUNDABOUT_LEFT_HAND_6 = StaticIconName.valueForString(example);
+ assertNotNull("ROUNDABOUT_LEFT_HAND_6 returned null", ROUNDABOUT_LEFT_HAND_6);
+
+ example = "0x60";
+ StaticIconName ROUNDABOUT_LEFT_HAND_7 = StaticIconName.valueForString(example);
+ assertNotNull("ROUNDABOUT_LEFT_HAND_7 returned null", ROUNDABOUT_LEFT_HAND_7);
+
+ example = "0x62";
+ StaticIconName ROUNDABOUT_RIGHT_HAND_1 = StaticIconName.valueForString(example);
+ assertNotNull("ROUNDABOUT_RIGHT_HAND_1 returned null", ROUNDABOUT_RIGHT_HAND_1);
+
+ example = "0x6c";
+ StaticIconName ROUNDABOUT_RIGHT_HAND_2 = StaticIconName.valueForString(example);
+ assertNotNull("ROUNDABOUT_RIGHT_HAND_2 returned null", ROUNDABOUT_RIGHT_HAND_2);
+
+ example = "0x70";
+ StaticIconName ROUNDABOUT_RIGHT_HAND_3 = StaticIconName.valueForString(example);
+ assertNotNull("ROUNDABOUT_RIGHT_HAND_3 returned null", ROUNDABOUT_RIGHT_HAND_3);
+
+ example = "0x7a";
+ StaticIconName ROUNDABOUT_RIGHT_HAND_4 = StaticIconName.valueForString(example);
+ assertNotNull("ROUNDABOUT_RIGHT_HAND_4 returned null", ROUNDABOUT_RIGHT_HAND_4);
+
+ example = "0x8a";
+ StaticIconName ROUNDABOUT_RIGHT_HAND_5 = StaticIconName.valueForString(example);
+ assertNotNull("ROUNDABOUT_RIGHT_HAND_5 returned null", ROUNDABOUT_RIGHT_HAND_5);
+
+ example = "0xec";
+ StaticIconName ROUNDABOUT_RIGHT_HAND_6 = StaticIconName.valueForString(example);
+ assertNotNull("ROUNDABOUT_RIGHT_HAND_6 returned null", ROUNDABOUT_RIGHT_HAND_6);
+
+ example = "0xf0";
+ StaticIconName ROUNDABOUT_RIGHT_HAND_7 = StaticIconName.valueForString(example);
+ assertNotNull("ROUNDABOUT_RIGHT_HAND_7 returned null", ROUNDABOUT_RIGHT_HAND_7);
+
+ example = "0x89";
+ StaticIconName RSS = StaticIconName.valueForString(example);
+ assertNotNull("RSS returned null", RSS);
+
+ example = "0x49";
+ StaticIconName SETTINGS = StaticIconName.valueForString(example);
+ assertNotNull("SETTINGS returned null", SETTINGS);
+
+ example = "0xa5";
+ StaticIconName SHARP_LEFT = StaticIconName.valueForString(example);
+ assertNotNull("SHARP_LEFT returned null", SHARP_LEFT);
+
+ example = "0xe1";
+ StaticIconName SHOW = StaticIconName.valueForString(example);
+ assertNotNull("SHOW returned null", SHOW);
+
+ example = "0x74";
+ StaticIconName SHUFFLE_PLAY = StaticIconName.valueForString(example);
+ assertNotNull("SHUFFLE_PLAY returned null", SHUFFLE_PLAY);
+
+ example = "0xab";
+ StaticIconName SKI_PLACES = StaticIconName.valueForString(example);
+ assertNotNull("SKI_PLACES returned null", SKI_PLACES);
+
+ example = "0x9d";
+ StaticIconName SLIGHT_LEFT = StaticIconName.valueForString(example);
+ assertNotNull("SLIGHT_LEFT returned null", SLIGHT_LEFT);
+
+ example = "0xa1";
+ StaticIconName SLIGHT_RIGHT = StaticIconName.valueForString(example);
+ assertNotNull("SLIGHT_RIGHT returned null", SLIGHT_RIGHT);
+
+ example = "0x05";
+ StaticIconName SMARTPHONE = StaticIconName.valueForString(example);
+ assertNotNull("SMARTPHONE returned null", SMARTPHONE);
+
+ example = "0x7B";
+ StaticIconName SORT_LIST = StaticIconName.valueForString(example);
+ assertNotNull("SORT_LIST returned null", SORT_LIST);
+
+ example = "0xE0";
+ StaticIconName SPEED_DIAL_NUMBERS_NUMBER_0 = StaticIconName.valueForString(example);
+ assertNotNull("SPEED_DIAL_NUMBERS_NUMBER_0 returned null", SPEED_DIAL_NUMBERS_NUMBER_0);
+
+ example = "0xD7";
+ StaticIconName SPEED_DIAL_NUMBERS_NUMBER_1 = StaticIconName.valueForString(example);
+ assertNotNull("SPEED_DIAL_NUMBERS_NUMBER_1 returned null", SPEED_DIAL_NUMBERS_NUMBER_1);
+
+ example = "0xD8";
+ StaticIconName SPEED_DIAL_NUMBERS_NUMBER_2 = StaticIconName.valueForString(example);
+ assertNotNull("SPEED_DIAL_NUMBERS_NUMBER_2 returned null", SPEED_DIAL_NUMBERS_NUMBER_2);
+
+ example = "0xD9";
+ StaticIconName SPEED_DIAL_NUMBERS_NUMBER_3 = StaticIconName.valueForString(example);
+ assertNotNull("SPEED_DIAL_NUMBERS_NUMBER_3 returned null", SPEED_DIAL_NUMBERS_NUMBER_3);
+
+ example = "0xDA";
+ StaticIconName SPEED_DIAL_NUMBERS_NUMBER_4 = StaticIconName.valueForString(example);
+ assertNotNull("SPEED_DIAL_NUMBERS_NUMBER_4 returned null", SPEED_DIAL_NUMBERS_NUMBER_4);
+
+ example = "0xDB";
+ StaticIconName SPEED_DIAL_NUMBERS_NUMBER_5 = StaticIconName.valueForString(example);
+ assertNotNull("SPEED_DIAL_NUMBERS_NUMBER_5 returned null", SPEED_DIAL_NUMBERS_NUMBER_5);
+
+ example = "0xDC";
+ StaticIconName SPEED_DIAL_NUMBERS_NUMBER_6 = StaticIconName.valueForString(example);
+ assertNotNull("SPEED_DIAL_NUMBERS_NUMBER_6 returned null", SPEED_DIAL_NUMBERS_NUMBER_6);
+
+ example = "0xDD";
+ StaticIconName SPEED_DIAL_NUMBERS_NUMBER_7 = StaticIconName.valueForString(example);
+ assertNotNull("SPEED_DIAL_NUMBERS_NUMBER_7 returned null", SPEED_DIAL_NUMBERS_NUMBER_7);
+
+ example = "0xDE";
+ StaticIconName SPEED_DIAL_NUMBERS_NUMBER_8 = StaticIconName.valueForString(example);
+ assertNotNull("SPEED_DIAL_NUMBERS_NUMBER_8 returned null", SPEED_DIAL_NUMBERS_NUMBER_8);
+
+ example = "0xDF";
+ StaticIconName SPEED_DIAL_NUMBERS_NUMBER_9 = StaticIconName.valueForString(example);
+ assertNotNull("SPEED_DIAL_NUMBERS_NUMBER_9 returned null", SPEED_DIAL_NUMBERS_NUMBER_9);
+
+ example = "0xD5";
+ StaticIconName SUCCESS = StaticIconName.valueForString(example);
+ assertNotNull("SUCCESS returned null", SUCCESS);
+
+ example = "0x4C";
+ StaticIconName TRACK_TITLE = StaticIconName.valueForString(example);
+ assertNotNull("TRACK_TITLE returned null", TRACK_TITLE);
+
+ example = "0x2A";
+ StaticIconName TRAFFIC_REPORT = StaticIconName.valueForString(example);
+ assertNotNull("TRAFFIC_REPORT returned null", TRAFFIC_REPORT);
+
+ example = "0x10";
+ StaticIconName TURN_LIST = StaticIconName.valueForString(example);
+ assertNotNull("TURN_LIST returned null", TURN_LIST);
+
+ example = "0xad";
+ StaticIconName UTURN_LEFT_TRAFFIC = StaticIconName.valueForString(example);
+ assertNotNull("UTURN_LEFT_TRAFFIC returned null", UTURN_LEFT_TRAFFIC);
+
+ example = "0xa9";
+ StaticIconName UTURN_RIGHT_TRAFFIC = StaticIconName.valueForString(example);
+ assertNotNull("UTURN_RIGHT_TRAFFIC returned null", UTURN_RIGHT_TRAFFIC);
+
+ example = "0x18";
+ StaticIconName UNDO = StaticIconName.valueForString(example);
+ assertNotNull("UNDO returned null", UNDO);
+
+ example = "0x23";
+ StaticIconName UNLOCKED = StaticIconName.valueForString(example);
+ assertNotNull("UNLOCKED returned null", UNLOCKED);
+
+ example = "0x0B";
+ StaticIconName USB_MEDIA_AUDIO_SOURCE = StaticIconName.valueForString(example);
+ assertNotNull("USB_MEDIA_AUDIO_SOURCE returned null", USB_MEDIA_AUDIO_SOURCE);
+
+ example = "0xC7";
+ StaticIconName VOICE_CONTROL_SCROLLBAR_LIST_ITEM_NO_1 = StaticIconName.valueForString(example);
+ assertNotNull("VOICE_CONTROL_SCROLLBAR_LIST_ITEM_NO_1 returned null", VOICE_CONTROL_SCROLLBAR_LIST_ITEM_NO_1);
+
+ example = "0xC8";
+ StaticIconName VOICE_CONTROL_SCROLLBAR_LIST_ITEM_NO_2 = StaticIconName.valueForString(example);
+ assertNotNull("VOICE_CONTROL_SCROLLBAR_LIST_ITEM_NO_2 returned null", VOICE_CONTROL_SCROLLBAR_LIST_ITEM_NO_2);
+
+ example = "0xC9";
+ StaticIconName VOICE_CONTROL_SCROLLBAR_LIST_ITEM_NO_3 = StaticIconName.valueForString(example);
+ assertNotNull("VOICE_CONTROL_SCROLLBAR_LIST_ITEM_NO_3 returned null", VOICE_CONTROL_SCROLLBAR_LIST_ITEM_NO_3);
+
+ example = "0xCA";
+ StaticIconName VOICE_CONTROL_SCROLLBAR_LIST_ITEM_NO_4 = StaticIconName.valueForString(example);
+ assertNotNull("VOICE_CONTROL_SCROLLBAR_LIST_ITEM_NO_4 returned null", VOICE_CONTROL_SCROLLBAR_LIST_ITEM_NO_4);
+
+ example = "0x90";
+ StaticIconName VOICE_RECOGNITION_FAILED = StaticIconName.valueForString(example);
+ assertNotNull("VOICE_RECOGNITION_FAILED returned null", VOICE_RECOGNITION_FAILED);
+
+ example = "0x92";
+ StaticIconName VOICE_RECOGNITION_PAUSE = StaticIconName.valueForString(example);
+ assertNotNull("VOICE_RECOGNITION_PAUSE returned null", VOICE_RECOGNITION_PAUSE);
+
+ example = "0x8F";
+ StaticIconName VOICE_RECOGNITION_SUCCESSFUL = StaticIconName.valueForString(example);
+ assertNotNull("VOICE_RECOGNITION_SUCCESSFUL returned null", VOICE_RECOGNITION_SUCCESSFUL);
+
+ example = "0x11";
+ StaticIconName VOICE_RECOGNITION_SYSTEM_ACTIVE = StaticIconName.valueForString(example);
+ assertNotNull("VOICE_RECOGNITION_SYSTEM_ACTIVE returned null", VOICE_RECOGNITION_SYSTEM_ACTIVE);
+
+ example = "0x91";
+ StaticIconName VOICE_RECOGNITION_SYSTEM_LISTENING = StaticIconName.valueForString(example);
+ assertNotNull("VOICE_RECOGNITION_SYSTEM_LISTENING returned null", VOICE_RECOGNITION_SYSTEM_LISTENING);
+
+ example = "0x93";
+ StaticIconName VOICE_RECOGNITION_TRY_AGAIN = StaticIconName.valueForString(example);
+ assertNotNull("VOICE_RECOGNITION_TRY_AGAIN returned null", VOICE_RECOGNITION_TRY_AGAIN);
+
+ example = "0xfe";
+ StaticIconName WARNING = StaticIconName.valueForString(example);
+ assertNotNull("WARNING returned null", WARNING);
+
+ example = "0xeb";
+ StaticIconName WEATHER = StaticIconName.valueForString(example);
+ assertNotNull("WEATHER returned null", WEATHER);
+
+ example = "0x43";
+ StaticIconName WIFI_FULL = StaticIconName.valueForString(example);
+ assertNotNull("WIFI_FULL returned null", WIFI_FULL);
+
+ example = "0x98";
+ StaticIconName ZOOM_IN = StaticIconName.valueForString(example);
+ assertNotNull("ZOOM_IN returned null", ZOOM_IN);
+
+ example = "0x9a";
+ StaticIconName ZOOM_OUT = StaticIconName.valueForString(example);
+ assertNotNull("ZOOM_OUT returned null", ZOOM_OUT);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "SoMeThInG";
+ try {
+ StaticIconName SOMETHING = StaticIconName.valueForString(example);
+ assertNull("Result of valueForString should be null.", SOMETHING);
+ }
+ catch (IllegalArgumentException exception) {
+ fail("Invalid enum throws IllegalArgumentException.");
+ }
+ }
+
+ /**
+ * Verifies that a null assignment is invalid.
+ */
+ public void testNullEnum () {
+ String example = null;
+ try {
+ StaticIconName temp = StaticIconName.valueForString(example);
+ assertNull("Result of valueForString should be null.", temp);
+ }
+ catch (NullPointerException exception) {
+ fail("Null string throws NullPointerException.");
+ }
+ }
+
+ /**
+ * Verifies the possible enum values of StaticIconNames.
+ */
+ public void testListEnum() {
+
+ List<StaticIconName> enumValueList = Arrays.asList(StaticIconName.values());
+
+ List<StaticIconName> enumTestList = new ArrayList<>();
+ enumTestList.add(StaticIconName.ACCEPT_CALL);
+ enumTestList.add(StaticIconName.ADD_WAYPOINT);
+ enumTestList.add(StaticIconName.ALBUM);
+ enumTestList.add(StaticIconName.AMBIENT_LIGHTING);
+ enumTestList.add(StaticIconName.ARROW_NORTH);
+ enumTestList.add(StaticIconName.AUDIO_MUTE);
+ enumTestList.add(StaticIconName.AUDIOBOOK_EPISODE);
+ enumTestList.add(StaticIconName.AUDIOBOOK_NARRATOR);
+ enumTestList.add(StaticIconName.AUXILLARY_AUDIO);
+ enumTestList.add(StaticIconName.BACK);
+ enumTestList.add(StaticIconName.BATTERY_CAPACITY_0_OF_5);
+ enumTestList.add(StaticIconName.BATTERY_CAPACITY_1_OF_5);
+ enumTestList.add(StaticIconName.BATTERY_CAPACITY_2_OF_5);
+ enumTestList.add(StaticIconName.BATTERY_CAPACITY_3_OF_5);
+ enumTestList.add(StaticIconName.BATTERY_CAPACITY_4_OF_5);
+ enumTestList.add(StaticIconName.BATTERY_CAPACITY_5_OF_5);
+ enumTestList.add(StaticIconName.BLUETOOTH_AUDIO_SOURCE);
+ enumTestList.add(StaticIconName.BLUETOOTH1);
+ enumTestList.add(StaticIconName.BLUETOOTH2);
+ enumTestList.add(StaticIconName.BROWSE);
+ enumTestList.add(StaticIconName.CELL_PHONE_IN_ROAMING_MODE);
+ enumTestList.add(StaticIconName.CELL_SERVICE_SIGNAL_STRENGTH_0_OF_5_BARS);
+ enumTestList.add(StaticIconName.CELL_SERVICE_SIGNAL_STRENGTH_1_OF_5_BARS);
+ enumTestList.add(StaticIconName.CELL_SERVICE_SIGNAL_STRENGTH_2_OF_5_BARS);
+ enumTestList.add(StaticIconName.CELL_SERVICE_SIGNAL_STRENGTH_3_OF_5_BARS);
+ enumTestList.add(StaticIconName.CELL_SERVICE_SIGNAL_STRENGTH_4_OF_5_BARS);
+ enumTestList.add(StaticIconName.CELL_SERVICE_SIGNAL_STRENGTH_5_OF_5_BARS);
+ enumTestList.add(StaticIconName.CHANGE_LANE_LEFT);
+ enumTestList.add(StaticIconName.CHANGE_LANE_RIGHT);
+ enumTestList.add(StaticIconName.CHECK_BOX_CHECKED);
+ enumTestList.add(StaticIconName.CHECK_BOX_UNCHECKED);
+ enumTestList.add(StaticIconName.CLIMATE);
+ enumTestList.add(StaticIconName.CLOCK);
+ enumTestList.add(StaticIconName.COMPOSE);
+ enumTestList.add(StaticIconName.CONTACT);
+ enumTestList.add(StaticIconName.CONTINUE);
+ enumTestList.add(StaticIconName.DASH);
+ enumTestList.add(StaticIconName.DATE);
+ enumTestList.add(StaticIconName.DELETE);
+ enumTestList.add(StaticIconName.DESTINATION);
+ enumTestList.add(StaticIconName.DESTINATION_FERRY_AHEAD);
+ enumTestList.add(StaticIconName.EBOOKMARK);
+ enumTestList.add(StaticIconName.END_CALL);
+ enumTestList.add(StaticIconName.FAIL);
+ enumTestList.add(StaticIconName.FAST_FORWARD_30_SECS);
+ enumTestList.add(StaticIconName.FAVORITE_HEART);
+ enumTestList.add(StaticIconName.FAVORITE_STAR);
+ enumTestList.add(StaticIconName.FAX_NUMBER);
+ enumTestList.add(StaticIconName.FILENAME);
+ enumTestList.add(StaticIconName.FILTER);
+ enumTestList.add(StaticIconName.FOLDER);
+ enumTestList.add(StaticIconName.FUEL_PRICES);
+ enumTestList.add(StaticIconName.FULL_MAP);
+ enumTestList.add(StaticIconName.GENERIC_PHONE_NUMBER);
+ enumTestList.add(StaticIconName.GENRE);
+ enumTestList.add(StaticIconName.GLOBAL_KEYBOARD);
+ enumTestList.add(StaticIconName.HIGHWAY_EXIT_INFORMATION);
+ enumTestList.add(StaticIconName.HOME_PHONE_NUMBER);
+ enumTestList.add(StaticIconName.HYPERLINK);
+ enumTestList.add(StaticIconName.ID3_TAG_UNKNOWN);
+ enumTestList.add(StaticIconName.INCOMING_CALLS);
+ enumTestList.add(StaticIconName.INFORMATION);
+ enumTestList.add(StaticIconName.IPOD_MEDIA_SOURCE);
+ enumTestList.add(StaticIconName.JOIN_CALLS);
+ enumTestList.add(StaticIconName.KEEP_LEFT);
+ enumTestList.add(StaticIconName.KEEP_RIGHT);
+ enumTestList.add(StaticIconName.KEY);
+ enumTestList.add(StaticIconName.LEFT);
+ enumTestList.add(StaticIconName.LEFT_ARROW);
+ enumTestList.add(StaticIconName.LEFT_EXIT);
+ enumTestList.add(StaticIconName.LINE_IN_AUDIO_SOURCE);
+ enumTestList.add(StaticIconName.LOCKED);
+ enumTestList.add(StaticIconName.MEDIA_CONTROL_LEFT_ARROW);
+ enumTestList.add(StaticIconName.MEDIA_CONTROL_RECORDING);
+ enumTestList.add(StaticIconName.MEDIA_CONTROL_RIGHT_ARROW);
+ enumTestList.add(StaticIconName.MEDIA_CONTROL_STOP);
+ enumTestList.add(StaticIconName.MICROPHONE);
+ enumTestList.add(StaticIconName.MISSED_CALLS);
+ enumTestList.add(StaticIconName.MOBILE_PHONE_NUMBER);
+ enumTestList.add(StaticIconName.MOVE_DOWN);
+ enumTestList.add(StaticIconName.MOVE_UP);
+ enumTestList.add(StaticIconName.MP3_TAG_ARTIST);
+ enumTestList.add(StaticIconName.NAVIGATION);
+ enumTestList.add(StaticIconName.NAVIGATION_CURRENT_DIRECTION);
+ enumTestList.add(StaticIconName.NEGATIVE_RATING_THUMBS_DOWN);
+ enumTestList.add(StaticIconName.NEW);
+ enumTestList.add(StaticIconName.OFFICE_PHONE_NUMBER);
+ enumTestList.add(StaticIconName.OPENED);
+ enumTestList.add(StaticIconName.ORIGIN);
+ enumTestList.add(StaticIconName.OUTGOING_CALLS);
+ enumTestList.add(StaticIconName.PHONE_CALL_1);
+ enumTestList.add(StaticIconName.PHONE_CALL_2);
+ enumTestList.add(StaticIconName.PHONE_DEVICE);
+ enumTestList.add(StaticIconName.PHONEBOOK);
+ enumTestList.add(StaticIconName.PHOTO);
+ enumTestList.add(StaticIconName.PLAY);
+ enumTestList.add(StaticIconName.PLAYLIST);
+ enumTestList.add(StaticIconName.POPUP);
+ enumTestList.add(StaticIconName.POSITIVE_RATING_THUMBS_UP);
+ enumTestList.add(StaticIconName.POWER);
+ enumTestList.add(StaticIconName.PRIMARY_PHONE);
+ enumTestList.add(StaticIconName.RADIO_BUTTON_CHECKED);
+ enumTestList.add(StaticIconName.RADIO_BUTTON_UNCHECKED);
+ enumTestList.add(StaticIconName.RECENT_CALLS);
+ enumTestList.add(StaticIconName.RECENT_DESTINATIONS);
+ enumTestList.add(StaticIconName.REDO);
+ enumTestList.add(StaticIconName.REFRESH);
+ enumTestList.add(StaticIconName.REMOTE_DIAGNOSTICS_CHECK_ENGINE);
+ enumTestList.add(StaticIconName.RENDERED_911_ASSIST);
+ enumTestList.add(StaticIconName.REPEAT);
+ enumTestList.add(StaticIconName.REPEAT_PLAY);
+ enumTestList.add(StaticIconName.REPLY);
+ enumTestList.add(StaticIconName.REWIND_30_SECS);
+ enumTestList.add(StaticIconName.RIGHT);
+ enumTestList.add(StaticIconName.RIGHT_EXIT);
+ enumTestList.add(StaticIconName.RINGTONES);
+ enumTestList.add(StaticIconName.ROUNDABOUT_LEFT_HAND_1);
+ enumTestList.add(StaticIconName.ROUNDABOUT_LEFT_HAND_2);
+ enumTestList.add(StaticIconName.ROUNDABOUT_LEFT_HAND_3);
+ enumTestList.add(StaticIconName.ROUNDABOUT_LEFT_HAND_4);
+ enumTestList.add(StaticIconName.ROUNDABOUT_LEFT_HAND_5);
+ enumTestList.add(StaticIconName.ROUNDABOUT_LEFT_HAND_6);
+ enumTestList.add(StaticIconName.ROUNDABOUT_LEFT_HAND_7);
+ enumTestList.add(StaticIconName.ROUNDABOUT_RIGHT_HAND_1);
+ enumTestList.add(StaticIconName.ROUNDABOUT_RIGHT_HAND_2);
+ enumTestList.add(StaticIconName.ROUNDABOUT_RIGHT_HAND_3);
+ enumTestList.add(StaticIconName.ROUNDABOUT_RIGHT_HAND_4);
+ enumTestList.add(StaticIconName.ROUNDABOUT_RIGHT_HAND_5);
+ enumTestList.add(StaticIconName.ROUNDABOUT_RIGHT_HAND_6);
+ enumTestList.add(StaticIconName.ROUNDABOUT_RIGHT_HAND_7);
+ enumTestList.add(StaticIconName.RSS);
+ enumTestList.add(StaticIconName.SETTINGS);
+ enumTestList.add(StaticIconName.SHARP_LEFT);
+ enumTestList.add(StaticIconName.SHARP_RIGHT);
+ enumTestList.add(StaticIconName.SHOW);
+ enumTestList.add(StaticIconName.SHUFFLE_PLAY);
+ enumTestList.add(StaticIconName.SKI_PLACES);
+ enumTestList.add(StaticIconName.SLIGHT_LEFT);
+ enumTestList.add(StaticIconName.SLIGHT_RIGHT);
+ enumTestList.add(StaticIconName.SMARTPHONE);
+ enumTestList.add(StaticIconName.SORT_LIST);
+ enumTestList.add(StaticIconName.SPEED_DIAL_NUMBERS_NUMBER_0);
+ enumTestList.add(StaticIconName.SPEED_DIAL_NUMBERS_NUMBER_1);
+ enumTestList.add(StaticIconName.SPEED_DIAL_NUMBERS_NUMBER_2);
+ enumTestList.add(StaticIconName.SPEED_DIAL_NUMBERS_NUMBER_3);
+ enumTestList.add(StaticIconName.SPEED_DIAL_NUMBERS_NUMBER_4);
+ enumTestList.add(StaticIconName.SPEED_DIAL_NUMBERS_NUMBER_5);
+ enumTestList.add(StaticIconName.SPEED_DIAL_NUMBERS_NUMBER_6);
+ enumTestList.add(StaticIconName.SPEED_DIAL_NUMBERS_NUMBER_7);
+ enumTestList.add(StaticIconName.SPEED_DIAL_NUMBERS_NUMBER_8);
+ enumTestList.add(StaticIconName.SPEED_DIAL_NUMBERS_NUMBER_9);
+ enumTestList.add(StaticIconName.SUCCESS);
+ enumTestList.add(StaticIconName.TRACK_TITLE);
+ enumTestList.add(StaticIconName.TRAFFIC_REPORT);
+ enumTestList.add(StaticIconName.TURN_LIST);
+ enumTestList.add(StaticIconName.UTURN_LEFT_TRAFFIC);
+ enumTestList.add(StaticIconName.UTURN_RIGHT_TRAFFIC);
+ enumTestList.add(StaticIconName.UNDO);
+ enumTestList.add(StaticIconName.UNLOCKED);
+ enumTestList.add(StaticIconName.USB_MEDIA_AUDIO_SOURCE);
+ enumTestList.add(StaticIconName.VOICE_CONTROL_SCROLLBAR_LIST_ITEM_NO_1);
+ enumTestList.add(StaticIconName.VOICE_CONTROL_SCROLLBAR_LIST_ITEM_NO_2);
+ enumTestList.add(StaticIconName.VOICE_CONTROL_SCROLLBAR_LIST_ITEM_NO_3);
+ enumTestList.add(StaticIconName.VOICE_CONTROL_SCROLLBAR_LIST_ITEM_NO_4);
+ enumTestList.add(StaticIconName.VOICE_RECOGNITION_FAILED);
+ enumTestList.add(StaticIconName.VOICE_RECOGNITION_PAUSE);
+ enumTestList.add(StaticIconName.VOICE_RECOGNITION_SUCCESSFUL);
+ enumTestList.add(StaticIconName.VOICE_RECOGNITION_SYSTEM_ACTIVE);
+ enumTestList.add(StaticIconName.VOICE_RECOGNITION_SYSTEM_LISTENING);
+ enumTestList.add(StaticIconName.VOICE_RECOGNITION_TRY_AGAIN);
+ enumTestList.add(StaticIconName.WARNING);
+ enumTestList.add(StaticIconName.WEATHER);
+ enumTestList.add(StaticIconName.WIFI_FULL);
+ enumTestList.add(StaticIconName.ZOOM_IN);
+ enumTestList.add(StaticIconName.ZOOM_OUT);
+
+ assertTrue("Enum value list does not match enum class list",
+ enumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList));
+ }
+
+}
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnHMIStatusTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnHMIStatusTests.java
index e506268ea..6f38fdfa0 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnHMIStatusTests.java
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnHMIStatusTests.java
@@ -12,6 +12,7 @@ import com.smartdevicelink.proxy.rpc.enums.SystemContext;
import com.smartdevicelink.proxy.rpc.enums.VideoStreamingState;
import com.smartdevicelink.test.BaseRpcTests;
import com.smartdevicelink.test.Test;
+import com.smartdevicelink.util.Version;
/**
* This is a unit test class for the SmartDeviceLink library project class :
@@ -80,6 +81,9 @@ public class OnHMIStatusTests extends BaseRpcTests{
testNullBase(msg);
assertNull(Test.NULL, msg.getAudioStreamingState());
+
+ assertNull(Test.NULL, msg.getVideoStreamingState());
+ msg.format(new Version(4,5,0),true);
assertEquals(Test.MATCH, VideoStreamingState.STREAMABLE, msg.getVideoStreamingState());
assertNull(Test.NULL, msg.getHmiLevel());
assertNull(Test.NULL, msg.getSystemContext());
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/RegisterAppInterfaceTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/RegisterAppInterfaceTests.java
index 5c65947a6..85b6f28ea 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/RegisterAppInterfaceTests.java
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/RegisterAppInterfaceTests.java
@@ -26,7 +26,7 @@ import com.smartdevicelink.test.json.rpc.JsonFileReader;
/**
* This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.rpc.RegisterAppInterface}
+ * {@link com.smartdevicelink.proxy.rpc.RegisterAppInterface}
*/
public class RegisterAppInterfaceTests extends BaseRpcTests {
@@ -37,7 +37,7 @@ public class RegisterAppInterfaceTests extends BaseRpcTests {
msg.setSdlMsgVersion(Test.GENERAL_SDLMSGVERSION);
msg.setAppName(Test.GENERAL_STRING);
msg.setNgnMediaScreenAppName(Test.GENERAL_STRING);
- msg.setAppID(Test.GENERAL_STRING);
+ msg.setFullAppID(Test.GENERAL_FULL_APP_ID);
msg.setLanguageDesired(Test.GENERAL_LANGUAGE);
msg.setHmiDisplayLanguageDesired(Test.GENERAL_LANGUAGE);
msg.setHashID(Test.GENERAL_STRING);
@@ -70,7 +70,8 @@ public class RegisterAppInterfaceTests extends BaseRpcTests {
result.put(RegisterAppInterface.KEY_SDL_MSG_VERSION, Test.JSON_SDLMSGVERSION);
result.put(RegisterAppInterface.KEY_APP_NAME, Test.GENERAL_STRING);
result.put(RegisterAppInterface.KEY_NGN_MEDIA_SCREEN_APP_NAME, Test.GENERAL_STRING);
- result.put(RegisterAppInterface.KEY_APP_ID, Test.GENERAL_STRING);
+ result.put(RegisterAppInterface.KEY_APP_ID, Test.GENERAL_APP_ID);
+ result.put(RegisterAppInterface.KEY_FULL_APP_ID, Test.GENERAL_FULL_APP_ID);
result.put(RegisterAppInterface.KEY_LANGUAGE_DESIRED, Test.GENERAL_LANGUAGE);
result.put(RegisterAppInterface.KEY_HMI_DISPLAY_LANGUAGE_DESIRED, Test.GENERAL_LANGUAGE);
result.put(RegisterAppInterface.KEY_HASH_ID, Test.GENERAL_STRING);
@@ -97,6 +98,7 @@ public class RegisterAppInterfaceTests extends BaseRpcTests {
String testName = ( (RegisterAppInterface) msg).getAppName();
String testNgnName = ( (RegisterAppInterface) msg).getNgnMediaScreenAppName();
String testAppId = ( (RegisterAppInterface) msg).getAppID();
+ String testFullAppId = ( (RegisterAppInterface) msg).getFullAppID();
Language testLang = ( (RegisterAppInterface) msg).getLanguageDesired();
Language testHmiLang = ( (RegisterAppInterface) msg).getHmiDisplayLanguageDesired();
String testHashId = ( (RegisterAppInterface) msg).getHashID();
@@ -112,7 +114,8 @@ public class RegisterAppInterfaceTests extends BaseRpcTests {
assertTrue(Test.TRUE, Validator.validateSdlMsgVersion(Test.GENERAL_SDLMSGVERSION, testVersion));
assertEquals(Test.MATCH, Test.GENERAL_STRING, testName);
assertEquals(Test.MATCH, Test.GENERAL_STRING, testNgnName);
- assertEquals(Test.MATCH, Test.GENERAL_STRING, testAppId);
+ assertEquals(Test.MATCH, Test.GENERAL_APP_ID, testAppId);
+ assertEquals(Test.MATCH, Test.GENERAL_FULL_APP_ID, testFullAppId);
assertEquals(Test.MATCH, Test.GENERAL_LANGUAGE, testLang);
assertEquals(Test.MATCH, Test.GENERAL_LANGUAGE, testHmiLang);
assertEquals(Test.MATCH, Test.GENERAL_STRING, testHashId);
@@ -133,6 +136,7 @@ public class RegisterAppInterfaceTests extends BaseRpcTests {
assertNull(Test.NULL, msg.getAppName());
assertNull(Test.NULL, msg.getNgnMediaScreenAppName());
assertNull(Test.NULL, msg.getAppID());
+ assertNull(Test.NULL, msg.getFullAppID());
assertNull(Test.NULL, msg.getLanguageDesired());
assertNull(Test.NULL, msg.getHmiDisplayLanguageDesired());
assertNull(Test.NULL, msg.getHashID());
@@ -179,6 +183,7 @@ public class RegisterAppInterfaceTests extends BaseRpcTests {
assertEquals(Test.MATCH, appHmiTypeItem, cmd.getAppHMIType().get(index) );
}
assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterface.KEY_APP_ID), cmd.getAppID());
+ assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterface.KEY_FULL_APP_ID), cmd.getFullAppID());
assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterface.KEY_LANGUAGE_DESIRED), cmd.getLanguageDesired().toString());
JSONObject deviceInfoObj = JsonUtils.readJsonObjectFromJsonObject(parameters, RegisterAppInterface.KEY_DEVICE_INFO);
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/MockPacketizer.java b/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/MockPacketizer.java
index d32a204a6..2c6618f62 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/MockPacketizer.java
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/MockPacketizer.java
@@ -5,6 +5,7 @@ import com.smartdevicelink.protocol.enums.SessionType;
import com.smartdevicelink.proxy.RPCRequest;
import com.smartdevicelink.streaming.AbstractPacketizer;
import com.smartdevicelink.streaming.IStreamListener;
+import com.smartdevicelink.util.Version;
import java.io.IOException;
import java.io.InputStream;
@@ -15,6 +16,7 @@ import java.io.InputStream;
*/
public class MockPacketizer extends AbstractPacketizer {
public MockPacketizer (IStreamListener l, InputStream i, SessionType s, byte sid, SdlSession sdlsession) throws IOException { super (l, i, s, sid, sdlsession); }
+ public MockPacketizer (IStreamListener l, InputStream i, RPCRequest r, SessionType s, byte sid, Version protocolVersion,SdlSession sdlsession) throws IOException { super (l, i, r, s, sid, protocolVersion, sdlsession); }
public MockPacketizer (IStreamListener l, InputStream i, RPCRequest r, SessionType s, byte sid, byte w, SdlSession sdlsession) throws IOException { super (l, i, r, s, sid, w, sdlsession); }
@Override public void start() throws IOException { }
@@ -26,7 +28,9 @@ public class MockPacketizer extends AbstractPacketizer {
public SdlSession getSdlSession () { return _session; }
public byte getSessionId () { return _rpcSessionID; }
public RPCRequest getRPCRequest () { return _request; }
- public byte getWiproVersion () { return _wiproVersion; }
+ @Deprecated
+ public byte getWiproVersion () { if(_wiproVersion != null){return (byte)_wiproVersion.getMajor(); }else{return 5;}}
+ public Version getProtocolVersion () { return _wiproVersion; }
@Override public void pause() { }
@Override public void resume() { }
diff --git a/sdl_android/src/main/java/com/smartdevicelink/api/SdlManager.java b/sdl_android/src/main/java/com/smartdevicelink/api/SdlManager.java
index 075664b34..5fe544ae1 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/api/SdlManager.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/api/SdlManager.java
@@ -745,8 +745,8 @@ public class SdlManager{
}
@Override
- public Version getProtocolVersion() {
- return proxy.getProtocolVersion();
+ public byte getWiProVersion() {
+ return proxy.getWiProVersion();
}
};
diff --git a/sdl_android/src/main/java/com/smartdevicelink/api/VideoStreamingManager.java b/sdl_android/src/main/java/com/smartdevicelink/api/VideoStreamingManager.java
index 7da4070b6..34a1c17dc 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/api/VideoStreamingManager.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/api/VideoStreamingManager.java
@@ -136,13 +136,13 @@ public class VideoStreamingManager extends BaseSubManager{
public void startRemoteDisplayStream(Context context, Class<? extends SdlRemoteDisplay> remoteDisplayClass, VideoStreamingParameters parameters, final boolean encrypted){
this.context = new WeakReference<>(context);
this.remoteDisplayClass = remoteDisplayClass;
- if(internalInterface.getProtocolVersion().getMajor() >= 5 && !internalInterface.isCapabilitySupported(SystemCapabilityType.VIDEO_STREAMING)){
+ if(internalInterface.getWiProVersion() >= 5 && !internalInterface.isCapabilitySupported(SystemCapabilityType.VIDEO_STREAMING)){
Log.e(TAG, "Video streaming not supported on this module");
stateMachine.transitionToState(StreamingStateMachine.ERROR);
return;
}
if(parameters == null){
- if(internalInterface.getProtocolVersion().getMajor() >= 5) {
+ if(internalInterface.getWiProVersion() >= 5) {
internalInterface.getCapability(SystemCapabilityType.VIDEO_STREAMING, new OnSystemCapabilityListener() {
@Override
public void onCapabilityRetrieved(Object capability) {
@@ -351,7 +351,7 @@ public class VideoStreamingManager extends BaseSubManager{
}
//Get touch scalars
ImageResolution resolution = null;
- if(internalInterface.getProtocolVersion().getMajor()>=5){ //At this point we should already have the capability
+ if(internalInterface.getWiProVersion() >=5){ //At this point we should already have the capability
VideoStreamingCapability capability = (VideoStreamingCapability) internalInterface.getCapability(SystemCapabilityType.VIDEO_STREAMING);
resolution = capability.getPreferredResolution();
}else {
diff --git a/sdl_android/src/main/java/com/smartdevicelink/marshal/JsonRPCMarshaller.java b/sdl_android/src/main/java/com/smartdevicelink/marshal/JsonRPCMarshaller.java
index 414538a19..89f4d1ef7 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/marshal/JsonRPCMarshaller.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/marshal/JsonRPCMarshaller.java
@@ -23,7 +23,12 @@ import com.smartdevicelink.util.DebugTool;
public class JsonRPCMarshaller {
private static final String SDL_LIB_PRIVATE_KEY = "42baba60-eb57-11df-98cf-0800200c9a66";
-
+
+ /**
+ * @param msg RPC message to be marshaled
+ * @param version protocol version
+ * @return byte array of the marshalled message
+ */
public static byte[] marshall(RPCMessage msg, byte version) {
byte[] jsonBytes = null;
try {
@@ -81,7 +86,7 @@ public class JsonRPCMarshaller {
return ret;
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("unchecked" )
private static JSONArray serializeList(List<?> list) throws JSONException{
JSONArray toPut = new JSONArray();
Iterator<Object> valueIterator = (Iterator<Object>) list.iterator();
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/RPCStruct.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/RPCStruct.java
index 116c491df..2d9ab77d7 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/RPCStruct.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/RPCStruct.java
@@ -1,6 +1,9 @@
package com.smartdevicelink.proxy;
+import android.util.Log;
+
import com.smartdevicelink.marshal.JsonRPCMarshaller;
+import com.smartdevicelink.util.Version;
import org.json.JSONException;
import org.json.JSONObject;
@@ -20,6 +23,10 @@ public class RPCStruct {
private byte[] _bulkData = null;
private Boolean protectedPayload = false;
+ private boolean formatRequested = false;
+ private Version rpcSpecVersion = null;
+
+
protected Hashtable<String, Object> store = null;
public boolean getStoreValue(String key) { // for unit testing
@@ -45,6 +52,7 @@ public class RPCStruct {
public void deserializeJSON(JSONObject jsonObject) throws JSONException {
store = JsonRPCMarshaller.deserializeJSONObject(jsonObject);
+
}
// deserializeJSONObject method moved to JsonRPCMarshaller for consistency
@@ -54,14 +62,14 @@ public class RPCStruct {
throws JSONException {
return JsonRPCMarshaller.deserializeJSONObject(jsonObject);
}
-
+
public JSONObject serializeJSON() throws JSONException {
return JsonRPCMarshaller.serializeHashtable(store);
}
@SuppressWarnings("unchecked")
- public JSONObject serializeJSON(byte version) throws JSONException {
- if (version > 1) {
+ public JSONObject serializeJSON(byte protocolVersion) throws JSONException {
+ if (protocolVersion > 1) {
String messageType = getMessageTypeName(store.keySet());
Hashtable<String, Object> function = (Hashtable<String, Object>) store.get(messageType);
Hashtable<String, Object> parameters = (Hashtable<String, Object>) function.get(RPCMessage.KEY_PARAMETERS);
@@ -69,6 +77,57 @@ public class RPCStruct {
} else return JsonRPCMarshaller.serializeHashtable(store);
}
+ /**
+ * This method should clean the the RPC to make sure it is compliant with the spec.
+ * <br><br><b> NOTE:</b> Super needs to be called at the END of the method
+ *
+ * @param rpcVersion the rpc spec version that has been negotiated. If value is null the
+ * the max value of RPC spec version this library supports should be used.
+ * @param formatParams if true, the format method will be called on subsequent params
+ */
+ public void format(Version rpcVersion, boolean formatParams){
+ formatRequested = true;
+ rpcSpecVersion = rpcVersion;
+ //Should override this method when breaking changes are made to the RPC spec
+ if(formatParams && store != null){
+ Hashtable<String, Object> parameters;
+
+ if(this instanceof RPCMessage) {
+ //If this is a message (request, response, notification) the parameters have to be
+ //retrieved from the store object.
+ String messageType = getMessageTypeName(store.keySet());
+ Hashtable<String, Object> function = (Hashtable<String, Object>) store.get(messageType);
+ parameters = (Hashtable<String, Object>) function.get(RPCMessage.KEY_PARAMETERS);
+ } else {
+ //If this is just an RPC struct the store itself should be used
+ parameters = store;
+ }
+
+ for(Object value:parameters.values()){
+ internalFormat(rpcVersion, value);
+ }
+ }
+ }
+
+ /**
+ * Cycles through parameters in this RPC to ensure they all get formated
+ * @param rpcVersion version of the rpc spec that should be used to format this rpc
+ * @param value the object to investigate if it needs to be formated
+ */
+ private void internalFormat(Version rpcVersion, Object value) {
+ if(value instanceof RPCStruct) {
+ ((RPCStruct)value).format(rpcVersion,true);
+ } else if(value instanceof List<?>) {
+ List<?> list = (List<?>)value;
+ if(list != null && list.size() > 0) {
+ for(Object listItem: list){
+ internalFormat(rpcVersion, listItem);
+ }
+ }
+ }
+ }
+
+
public byte[] getBulkData() {
return this._bulkData;
}
@@ -156,7 +215,12 @@ public class RPCStruct {
} else if (obj instanceof Hashtable) {
try {
Constructor constructor = tClass.getConstructor(Hashtable.class);
- return constructor.newInstance((Hashtable<String, Object>) obj);
+ Object customObject = constructor.newInstance((Hashtable<String, Object>) obj);
+ if(formatRequested && customObject instanceof RPCStruct){
+ ((RPCStruct)customObject).format(rpcSpecVersion,true);
+ }
+
+ return customObject;
} catch (Exception e) {
e.printStackTrace();
}
@@ -168,10 +232,17 @@ public class RPCStruct {
return list;
} else if (item instanceof Hashtable) {
List<Object> newList = new ArrayList<Object>();
+ Object customObject;
for (Object hashObj : list) {
try {
Constructor constructor = tClass.getConstructor(Hashtable.class);
- newList.add(constructor.newInstance((Hashtable<String, Object>)hashObj));
+ customObject = constructor.newInstance((Hashtable<String, Object>) hashObj);
+ if(formatRequested
+ && customObject != null
+ && customObject instanceof RPCStruct){
+ ((RPCStruct)customObject).format(rpcSpecVersion,true);
+ }
+ newList.add(customObject);
} catch (Exception e) {
e.printStackTrace();
return null;
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBase.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBase.java
index df516aef5..2dc48c24c 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBase.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBase.java
@@ -91,7 +91,6 @@ import com.smartdevicelink.transport.SiphonServer;
import com.smartdevicelink.transport.enums.TransportType;
import com.smartdevicelink.util.CorrelationIdGenerator;
import com.smartdevicelink.util.DebugTool;
-import com.smartdevicelink.util.Version;
import org.json.JSONArray;
import org.json.JSONException;
@@ -127,7 +126,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
private static final int PROX_PROT_VER_ONE = 1;
private static final int RESPONSE_WAIT_TIME = 2000;
- private static final com.smartdevicelink.util.Version MAX_SUPPORTED_RPC_VERSION = new com.smartdevicelink.util.Version("4.5.0");
+ public static final com.smartdevicelink.util.Version MAX_SUPPORTED_RPC_VERSION = new com.smartdevicelink.util.Version("5.0.0");
private SdlSession sdlSession = null;
private proxyListenerType _proxyListener = null;
@@ -240,7 +239,8 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
private final CopyOnWriteArrayList<IPutFileResponseListener> _putFileListenerList = new CopyOnWriteArrayList<IPutFileResponseListener>();
- protected Version protocolVersion = new Version("1.0.0");
+ protected byte _wiproVersion = 1;
+ protected com.smartdevicelink.util.Version rpcSpecVersion;
protected SparseArray<OnRPCResponseListener> rpcResponseListeners = null;
protected SparseArray<CopyOnWriteArrayList<OnRPCNotificationListener>> rpcNotificationListeners = null;
@@ -367,8 +367,8 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
}
@Override
- public com.smartdevicelink.util.Version getProtocolVersion() {
- return SdlProxyBase.this.getProtocolVersion();
+ public byte getWiProVersion() {
+ return getWiProVersion();
}
@Override
@@ -494,7 +494,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
updateBroadcastIntent(sendIntent, "COMMENT3", " Encrypted: " + isEncrypted);
sendBroadcastIntent(sendIntent);
- setProtocolVersion(new Version(Byte.toString(version)+".0.0"));
+ setWiProVersion(version);
if (sessionType.eq(SessionType.RPC)) {
@@ -524,7 +524,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
} else if (sessionType.eq(SessionType.RPC)){
cycleProxy(SdlDisconnectedReason.RPC_SESSION_ENDED);
}
- else if (protocolVersion.getMajor() > 1) {
+ else if (_wiproVersion > 1) {
//If version is 2 or above then don't need to specify a Session Type
startRPCProtocolSession();
} //else{} Handle other protocol session types here
@@ -710,8 +710,8 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
boolean callbackToUIThread, Boolean preRegister, String sHashID, Boolean bAppResumeEnab,
BaseTransportConfig transportConfig) throws SdlException
{
- Log.i(TAG, "SDL_LIB_VERSION: " + com.smartdevicelink.proxy.Version.VERSION);
- setProtocolVersion(new Version(Byte.toString((byte)PROX_PROT_VER_ONE )+ ".0.0"));
+ Log.i(TAG, "SDL_LIB_VERSION: " + Version.VERSION);
+ setWiProVersion((byte)PROX_PROT_VER_ONE);
if (preRegister != null && preRegister)
{
@@ -1434,7 +1434,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
_systemCapabilityManager = new SystemCapabilityManager(_internalInterface);
// Setup SdlConnection
synchronized(CONNECTION_REFERENCE_LOCK) {
- this.sdlSession = SdlSession.createSession((byte) protocolVersion.getMajor(),_interfaceBroker, _transportConfig);
+ this.sdlSession = SdlSession.createSession(_wiproVersion,_interfaceBroker, _transportConfig);
}
synchronized(CONNECTION_REFERENCE_LOCK) {
@@ -1692,15 +1692,12 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
if (message.getSessionType().equals(SessionType.RPC)
||message.getSessionType().equals(SessionType.BULK_DATA) ) {
try {
- if (protocolVersion.getMajor() == 1) {
- if (message.getVersion() > 1) {
- setProtocolVersion(
- new Version(Byte.toString(message.getVersion())+".0.0"));
- }
+ if (_wiproVersion == 1) {
+ if (message.getVersion() > 1) setWiProVersion(message.getVersion());
}
Hashtable<String, Object> hash = new Hashtable<String, Object>();
- if (protocolVersion.getMajor() > 1) {
+ if (_wiproVersion > 1) {
Hashtable<String, Object> hashTemp = new Hashtable<String, Object>();
hashTemp.put(RPCMessage.KEY_CORRELATION_ID, message.getCorrID());
if (message.getJsonSize() > 0) {
@@ -1743,20 +1740,19 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
}
}
- public Version getProtocolVersion() {
- return this.protocolVersion;
+ public byte getWiProVersion() {
+ return this._wiproVersion;
}
- private void setProtocolVersion(Version version) {
- this.protocolVersion = version;
+ private void setWiProVersion(byte version) {
+ this._wiproVersion = version;
}
public String serializeJSON(RPCMessage msg)
{
- String sReturn;
try
{
- sReturn = msg.serializeJSON((byte) getProtocolVersion().getMajor()).toString(2);
+ return msg.serializeJSON(getWiProVersion()).toString(2);
}
catch (final Exception e)
{
@@ -1764,7 +1760,6 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
passErrorToProxyListener("Error serializing message.", e);
return null;
}
- return sReturn;
}
private void handleErrorsFromIncomingMessageDispatcher(String info, Exception e) {
@@ -1909,7 +1904,8 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
try {
SdlTrace.logRPCEvent(InterfaceActivityDirection.Transmit, request, SDL_LIB_TRACE_KEY);
- byte[] msgBytes = JsonRPCMarshaller.marshall(request, (byte) protocolVersion.getMajor());
+ request.format(rpcSpecVersion,true);
+ byte[] msgBytes = JsonRPCMarshaller.marshall(request, _wiproVersion);
ProtocolMessage pm = new ProtocolMessage();
pm.setData(msgBytes);
@@ -2117,6 +2113,8 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
private void handleRPCMessage(Hashtable<String, Object> hash) {
RPCMessage rpcMsg = new RPCMessage(hash);
+ //Call format to ensure the RPC is ready to be handled regardless of RPC spec version
+
String functionName = rpcMsg.getFunctionName();
String messageType = rpcMsg.getMessageType();
@@ -2131,6 +2129,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
&& _advancedLifecycleManagementEnabled
&& functionName.equals(FunctionID.REGISTER_APP_INTERFACE.toString())) {
final RegisterAppInterfaceResponse msg = new RegisterAppInterfaceResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (msg.getSuccess()) {
_appInterfaceRegisterd = true;
}
@@ -2155,12 +2154,19 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
_sdlLanguage = msg.getLanguage();
_hmiDisplayLanguage = msg.getHmiDisplayLanguage();
_sdlMsgVersion = msg.getSdlMsgVersion();
+ if(_sdlMsgVersion != null){
+ rpcSpecVersion = new com.smartdevicelink.util.Version(_sdlMsgVersion.getMajorVersion(),_sdlMsgVersion.getMinorVersion(), _sdlMsgVersion.getPatchVersion());
+ }else{
+ rpcSpecVersion = MAX_SUPPORTED_RPC_VERSION;
+ }
_vehicleType = msg.getVehicleType();
_systemSoftwareVersion = msg.getSystemSoftwareVersion();
_proxyVersionInfo = msg.getProxyVersionInfo();
_iconResumed = msg.getIconResumed();
-
+ if (_iconResumed == null){
+ _iconResumed = false;
+ }
if (_bAppResumeEnabled)
{
@@ -2273,6 +2279,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
APP_INTERFACE_REGISTERED_LOCK.notify();
}
final UnregisterAppInterfaceResponse msg = new UnregisterAppInterfaceResponse(hash);
+ msg.format(rpcSpecVersion, true);
Intent sendIntent = createBroadcastIntent();
updateBroadcastIntent(sendIntent, "RPC_NAME", FunctionID.UNREGISTER_APP_INTERFACE.toString());
updateBroadcastIntent(sendIntent, "TYPE", RPCMessage.KEY_RESPONSE);
@@ -2288,6 +2295,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
if (functionName.equals(FunctionID.REGISTER_APP_INTERFACE.toString())) {
final RegisterAppInterfaceResponse msg = new RegisterAppInterfaceResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (msg.getSuccess()) {
_appInterfaceRegisterd = true;
}
@@ -2301,6 +2309,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
_sdlLanguage = msg.getLanguage();
_hmiDisplayLanguage = msg.getHmiDisplayLanguage();
_sdlMsgVersion = msg.getSdlMsgVersion();
+ rpcSpecVersion = new com.smartdevicelink.util.Version(_sdlMsgVersion.getMajorVersion(),_sdlMsgVersion.getMinorVersion(), _sdlMsgVersion.getPatchVersion());
_vehicleType = msg.getVehicleType();
_systemSoftwareVersion = msg.getSystemSoftwareVersion();
_proxyVersionInfo = msg.getProxyVersionInfo();
@@ -2361,6 +2370,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
// SpeakResponse
final SpeakResponse msg = new SpeakResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -2378,6 +2388,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
// AlertResponse
final AlertResponse msg = new AlertResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -2395,6 +2406,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
// ShowResponse
final ShowResponse msg = new ShowResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -2412,6 +2424,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
// AddCommand
final AddCommandResponse msg = new AddCommandResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -2429,6 +2442,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
// DeleteCommandResponse
final DeleteCommandResponse msg = new DeleteCommandResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -2446,6 +2460,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
// AddSubMenu
final AddSubMenuResponse msg = new AddSubMenuResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -2463,6 +2478,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
// DeleteSubMenu
final DeleteSubMenuResponse msg = new DeleteSubMenuResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -2480,6 +2496,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
// SubscribeButton
final SubscribeButtonResponse msg = new SubscribeButtonResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -2497,6 +2514,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
// UnsubscribeButton
final UnsubscribeButtonResponse msg = new UnsubscribeButtonResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -2514,6 +2532,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
// SetMediaClockTimer
final SetMediaClockTimerResponse msg = new SetMediaClockTimerResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -2530,7 +2549,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
} else if (functionName.equals(FunctionID.ENCODED_SYNC_P_DATA.toString())) {
final SystemRequestResponse msg = new SystemRequestResponse(hash);
-
+ msg.format(rpcSpecVersion,true);
Intent sendIntent = createBroadcastIntent();
updateBroadcastIntent(sendIntent, "RPC_NAME", FunctionID.SYSTEM_REQUEST.toString());
updateBroadcastIntent(sendIntent, "TYPE", RPCMessage.KEY_RESPONSE);
@@ -2557,6 +2576,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
// CreateInteractionChoiceSet
final CreateInteractionChoiceSetResponse msg = new CreateInteractionChoiceSetResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -2574,6 +2594,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
// DeleteInteractionChoiceSet
final DeleteInteractionChoiceSetResponse msg = new DeleteInteractionChoiceSetResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -2591,6 +2612,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
// PerformInteraction
final PerformInteractionResponse msg = new PerformInteractionResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -2608,6 +2630,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
// SetGlobalPropertiesResponse
final SetGlobalPropertiesResponse msg = new SetGlobalPropertiesResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -2625,6 +2648,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
// ResetGlobalProperties
final ResetGlobalPropertiesResponse msg = new ResetGlobalPropertiesResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -2647,7 +2671,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
}
final UnregisterAppInterfaceResponse msg = new UnregisterAppInterfaceResponse(hash);
-
+ msg.format(rpcSpecVersion,true);
Intent sendIntent = createBroadcastIntent();
updateBroadcastIntent(sendIntent, "RPC_NAME", FunctionID.UNREGISTER_APP_INTERFACE.toString());
updateBroadcastIntent(sendIntent, "TYPE", RPCMessage.KEY_RESPONSE);
@@ -2680,6 +2704,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
} else if (functionName.equals(FunctionID.GENERIC_RESPONSE.toString())) {
// GenericResponse (Usually and error)
final GenericResponse msg = new GenericResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -2696,6 +2721,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
} else if (functionName.equals(FunctionID.SLIDER.toString())) {
// Slider
final SliderResponse msg = new SliderResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -2712,6 +2738,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
} else if (functionName.equals(FunctionID.PUT_FILE.toString())) {
// PutFile
final PutFileResponse msg = new PutFileResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -2730,6 +2757,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
} else if (functionName.equals(FunctionID.DELETE_FILE.toString())) {
// DeleteFile
final DeleteFileResponse msg = new DeleteFileResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -2746,6 +2774,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
} else if (functionName.equals(FunctionID.LIST_FILES.toString())) {
// ListFiles
final ListFilesResponse msg = new ListFilesResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -2762,6 +2791,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
} else if (functionName.equals(FunctionID.SET_APP_ICON.toString())) {
// SetAppIcon
final SetAppIconResponse msg = new SetAppIconResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -2778,6 +2808,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
} else if (functionName.equals(FunctionID.SCROLLABLE_MESSAGE.toString())) {
// ScrollableMessage
final ScrollableMessageResponse msg = new ScrollableMessageResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -2794,6 +2825,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
} else if (functionName.equals(FunctionID.CHANGE_REGISTRATION.toString())) {
// ChangeLanguageRegistration
final ChangeRegistrationResponse msg = new ChangeRegistrationResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -2810,7 +2842,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
} else if (functionName.equals(FunctionID.SET_DISPLAY_LAYOUT.toString())) {
// SetDisplayLayout
final SetDisplayLayoutResponse msg = new SetDisplayLayoutResponse(hash);
-
+ msg.format(rpcSpecVersion,true);
// successfully changed display layout - update layout capabilities
if(msg.getSuccess() && _systemCapabilityManager!=null){
_systemCapabilityManager.setCapability(SystemCapabilityType.DISPLAY, msg.getDisplayCapabilities());
@@ -2835,6 +2867,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
} else if (functionName.equals(FunctionID.PERFORM_AUDIO_PASS_THRU.toString())) {
// PerformAudioPassThru
final PerformAudioPassThruResponse msg = new PerformAudioPassThruResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -2851,6 +2884,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
} else if (functionName.equals(FunctionID.END_AUDIO_PASS_THRU.toString())) {
// EndAudioPassThru
final EndAudioPassThruResponse msg = new EndAudioPassThruResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -2867,6 +2901,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
} else if (functionName.equals(FunctionID.SUBSCRIBE_VEHICLE_DATA.toString())) {
// SubscribeVehicleData
final SubscribeVehicleDataResponse msg = new SubscribeVehicleDataResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -2883,6 +2918,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
} else if (functionName.equals(FunctionID.UNSUBSCRIBE_VEHICLE_DATA.toString())) {
// UnsubscribeVehicleData
final UnsubscribeVehicleDataResponse msg = new UnsubscribeVehicleDataResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -2899,6 +2935,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
} else if (functionName.equals(FunctionID.GET_VEHICLE_DATA.toString())) {
// GetVehicleData
final GetVehicleDataResponse msg = new GetVehicleDataResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -2915,6 +2952,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
} else if (functionName.equals(FunctionID.SUBSCRIBE_WAY_POINTS.toString())) {
// SubscribeWayPoints
final SubscribeWayPointsResponse msg = new SubscribeWayPointsResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -2931,6 +2969,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
} else if (functionName.equals(FunctionID.UNSUBSCRIBE_WAY_POINTS.toString())) {
// UnsubscribeWayPoints
final UnsubscribeWayPointsResponse msg = new UnsubscribeWayPointsResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -2947,6 +2986,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
} else if (functionName.equals(FunctionID.GET_WAY_POINTS.toString())) {
// GetWayPoints
final GetWayPointsResponse msg = new GetWayPointsResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -2962,6 +3002,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
}
} else if (functionName.equals(FunctionID.READ_DID.toString())) {
final ReadDIDResponse msg = new ReadDIDResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -2977,6 +3018,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
}
} else if (functionName.equals(FunctionID.GET_DTCS.toString())) {
final GetDTCsResponse msg = new GetDTCsResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -2992,6 +3034,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
}
} else if (functionName.equals(FunctionID.DIAGNOSTIC_MESSAGE.toString())) {
final DiagnosticMessageResponse msg = new DiagnosticMessageResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -3009,6 +3052,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
else if (functionName.equals(FunctionID.SYSTEM_REQUEST.toString())) {
final SystemRequestResponse msg = new SystemRequestResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -3026,6 +3070,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
else if (functionName.equals(FunctionID.SEND_LOCATION.toString())) {
final SendLocationResponse msg = new SendLocationResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -3043,6 +3088,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
else if (functionName.equals(FunctionID.DIAL_NUMBER.toString())) {
final DialNumberResponse msg = new DialNumberResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -3059,6 +3105,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
}
else if (functionName.equals(FunctionID.SHOW_CONSTANT_TBT.toString())) {
final ShowConstantTbtResponse msg = new ShowConstantTbtResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
_mainUIHandler.post(new Runnable() {
@Override
@@ -3074,6 +3121,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
}
else if (functionName.equals(FunctionID.ALERT_MANEUVER.toString())) {
final AlertManeuverResponse msg = new AlertManeuverResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
_mainUIHandler.post(new Runnable() {
@Override
@@ -3088,6 +3136,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
}
} else if (functionName.equals(FunctionID.UPDATE_TURN_LIST.toString())) {
final UpdateTurnListResponse msg = new UpdateTurnListResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
_mainUIHandler.post(new Runnable() {
@Override
@@ -3102,6 +3151,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
}
} else if (functionName.equals(FunctionID.SET_INTERIOR_VEHICLE_DATA.toString())) {
final SetInteriorVehicleDataResponse msg = new SetInteriorVehicleDataResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
_mainUIHandler.post(new Runnable() {
@Override
@@ -3116,6 +3166,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
}
} else if (functionName.equals(FunctionID.GET_INTERIOR_VEHICLE_DATA.toString())) {
final GetInteriorVehicleDataResponse msg = new GetInteriorVehicleDataResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
_mainUIHandler.post(new Runnable() {
@Override
@@ -3131,6 +3182,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
} else if (functionName.equals(FunctionID.GET_SYSTEM_CAPABILITY.toString())) {
// GetSystemCapabilityResponse
final GetSystemCapabilityResponse msg = new GetSystemCapabilityResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
_mainUIHandler.post(new Runnable() {
@Override
@@ -3145,6 +3197,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
}
} else if (functionName.equals(FunctionID.BUTTON_PRESS.toString())) {
final ButtonPressResponse msg = new ButtonPressResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
_mainUIHandler.post(new Runnable() {
@Override
@@ -3159,6 +3212,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
}
} else if (functionName.equals(FunctionID.SEND_HAPTIC_DATA.toString())) {
final SendHapticDataResponse msg = new SendHapticDataResponse(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -3201,6 +3255,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
_hmiLevel = msg.getHmiLevel();
_audioStreamingState = msg.getAudioStreamingState();
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -3220,6 +3275,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
// OnCommand
final OnCommand msg = new OnCommand(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -3245,6 +3301,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
sdlSession.getLockScreenMan().setDriverDistStatus(drDist == DriverDistractionState.DD_ON);
}
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -3271,7 +3328,8 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
// If url is null, then send notification to the app, otherwise, send to URL
if (msg.getUrl() == null) {
updateBroadcastIntent(sendIntent, "COMMENT1", "URL is a null value (received)");
- sendBroadcastIntent(sendIntent);
+ sendBroadcastIntent(sendIntent);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -3307,6 +3365,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
//OnPermissionsChange
final OnPermissionsChange msg = new OnPermissionsChange(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -3324,6 +3383,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
// OnTBTClientState
final OnTBTClientState msg = new OnTBTClientState(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -3341,6 +3401,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
// OnButtonPress
final OnButtonPress msg = new OnButtonPress(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -3358,6 +3419,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
// OnButtonEvent
final OnButtonEvent msg = new OnButtonEvent(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -3375,6 +3437,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
// OnLanguageChange
final OnLanguageChange msg = new OnLanguageChange(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -3392,6 +3455,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
// OnLanguageChange
final OnHashChange msg = new OnHashChange(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -3417,7 +3481,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
// OnSystemRequest
final OnSystemRequest msg = new OnSystemRequest(hash);
-
+ msg.format(rpcSpecVersion,true);
if ((msg.getUrl() != null) &&
(((msg.getRequestType() == RequestType.PROPRIETARY) && (msg.getFileType() == FileType.JSON))
|| ((msg.getRequestType() == RequestType.HTTP) && (msg.getFileType() == FileType.BINARY)))){
@@ -3437,6 +3501,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
lockScreenIconRequest = msg;
}
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -3453,6 +3518,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
} else if (functionName.equals(FunctionID.ON_AUDIO_PASS_THRU.toString())) {
// OnAudioPassThru
final OnAudioPassThru msg = new OnAudioPassThru(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -3469,6 +3535,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
} else if (functionName.equals(FunctionID.ON_VEHICLE_DATA.toString())) {
// OnVehicleData
final OnVehicleData msg = new OnVehicleData(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -3492,6 +3559,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
}
final OnAppInterfaceUnregistered msg = new OnAppInterfaceUnregistered(hash);
+ msg.format(rpcSpecVersion,true);
Intent sendIntent = createBroadcastIntent();
updateBroadcastIntent(sendIntent, "RPC_NAME", FunctionID.ON_APP_INTERFACE_UNREGISTERED.toString());
@@ -3521,6 +3589,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
}
else if (functionName.equals(FunctionID.ON_KEYBOARD_INPUT.toString())) {
final OnKeyboardInput msg = new OnKeyboardInput(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -3537,6 +3606,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
}
else if (functionName.equals(FunctionID.ON_TOUCH_EVENT.toString())) {
final OnTouchEvent msg = new OnTouchEvent(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -3553,6 +3623,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
}
else if (functionName.equals(FunctionID.ON_WAY_POINT_CHANGE.toString())) {
final OnWayPointChange msg = new OnWayPointChange(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -3569,6 +3640,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
}
else if (functionName.equals(FunctionID.ON_INTERIOR_VEHICLE_DATA.toString())) {
final OnInteriorVehicleData msg = new OnInteriorVehicleData(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -3585,6 +3657,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
}
else if (functionName.equals(FunctionID.ON_RC_STATUS.toString())) {
final OnRCStatus msg = new OnRCStatus(hash);
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -3947,25 +4020,25 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
private RPCStreamController startPutFileStream(String sPath, PutFile msg) {
if (sdlSession == null) return null;
- return startRPCStream(sPath, msg, SessionType.RPC, sdlSession.getSessionId(), (byte) protocolVersion.getMajor());
+ return startRPCStream(sPath, msg, SessionType.RPC, sdlSession.getSessionId(), _wiproVersion);
}
private RPCStreamController startPutFileStream(InputStream is, PutFile msg) {
if (sdlSession == null) return null;
if (is == null) return null;
- return startRPCStream(is, msg, SessionType.RPC, sdlSession.getSessionId(), (byte) protocolVersion.getMajor());
+ return startRPCStream(is, msg, SessionType.RPC, sdlSession.getSessionId(), _wiproVersion);
}
@SuppressWarnings("UnusedReturnValue")
public boolean startRPCStream(InputStream is, RPCRequest msg) {
if (sdlSession == null) return false;
- sdlSession.startRPCStream(is, msg, SessionType.RPC, sdlSession.getSessionId(), (byte) protocolVersion.getMajor());
+ sdlSession.startRPCStream(is, msg, SessionType.RPC, sdlSession.getSessionId(), _wiproVersion);
return true;
}
public OutputStream startRPCStream(RPCRequest msg) {
if (sdlSession == null) return null;
- return sdlSession.startRPCStream(msg, SessionType.RPC, sdlSession.getSessionId(), (byte) protocolVersion.getMajor());
+ return sdlSession.startRPCStream(msg, SessionType.RPC, sdlSession.getSessionId(), _wiproVersion);
}
public void endRPCStream() {
@@ -4365,7 +4438,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
*/
@TargetApi(19)
public void startRemoteDisplayStream(Context context, final Class<? extends SdlRemoteDisplay> remoteDisplay, final VideoStreamingParameters parameters, final boolean encrypted){
- if(getProtocolVersion().getMajor() >= 5 && !_systemCapabilityManager.isCapabilitySupported(SystemCapabilityType.VIDEO_STREAMING)){
+ if(getWiProVersion() >= 5 && !_systemCapabilityManager.isCapabilitySupported(SystemCapabilityType.VIDEO_STREAMING)){
Log.e(TAG, "Video streaming not supported on this module");
return;
}
@@ -4375,7 +4448,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
}
if(parameters == null){
- if(getProtocolVersion().getMajor() >= 5) {
+ if(getWiProVersion() >= 5) {
_systemCapabilityManager.getCapability(SystemCapabilityType.VIDEO_STREAMING, new OnSystemCapabilityListener() {
@Override
public void onCapabilityRetrieved(Object capability) {
@@ -4436,7 +4509,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
DebugTool.logWarning("SdlSession is not created yet.");
return null;
}
- if(getProtocolVersion().getMajor() >= 5 && !_systemCapabilityManager.isCapabilitySupported(SystemCapabilityType.VIDEO_STREAMING)){
+ if(getWiProVersion() >= 5 && !_systemCapabilityManager.isCapabilitySupported(SystemCapabilityType.VIDEO_STREAMING)){
DebugTool.logWarning("Module doesn't support video streaming.");
return null;
}
@@ -4462,7 +4535,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
scheduler.shutdown();
if (navServiceStartResponse) {
- if(getProtocolVersion().getMajor() < 5){ //Versions 1-4 do not support streaming parameter negotiations
+ if(getWiProVersion() < 5){ //Versions 1-4 do not support streaming parameter negotiations
sdlSession.setAcceptedVideoParams(parameters);
}
return sdlSession.getAcceptedVideoParams();
@@ -7219,7 +7292,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
}
//Get touch scalars
ImageResolution resolution = null;
- if(getProtocolVersion().getMajor()>=5){ //At this point we should already have the capability
+ if(getWiProVersion()>=5){ //At this point we should already have the capability
VideoStreamingCapability capability = (VideoStreamingCapability)_systemCapabilityManager.getCapability(SystemCapabilityType.VIDEO_STREAMING);
resolution = capability.getPreferredResolution();
}else {
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/SystemCapabilityManager.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/SystemCapabilityManager.java
index 0d2ed9864..291d02a8f 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/SystemCapabilityManager.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/SystemCapabilityManager.java
@@ -78,7 +78,8 @@ public class SystemCapabilityManager {
* @return if that capability is supported with the current, connected module
*/
public boolean isCapabilitySupported(SystemCapabilityType type){
- if(cachedSystemCapabilities.containsKey(type)){
+ if(cachedSystemCapabilities.get(type) != null){
+ //The capability exists in the map and is not null
return true;
}else if(cachedSystemCapabilities.containsKey(SystemCapabilityType.HMI)){
HMICapabilities hmiCapabilities = ((HMICapabilities)cachedSystemCapabilities.get(SystemCapabilityType.HMI));
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/interfaces/ISdl.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/interfaces/ISdl.java
index 22807fff0..d7e2758c6 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/interfaces/ISdl.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/interfaces/ISdl.java
@@ -207,9 +207,9 @@ public interface ISdl {
SdlMsgVersion getSdlMsgVersion();
/**
- * Get protocol version
- * @return Version object representing protocol version
+ * Get WiPro version
+ * @return byte value representing WiPro version
*/
- Version getProtocolVersion();
+ byte getWiProVersion();
}
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
new file mode 100644
index 000000000..ab1738739
--- /dev/null
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AudioControlCapabilities.java
@@ -0,0 +1,131 @@
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+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_VOLUME_AVAILABLE = "volumeAvailable";
+ public static final String KEY_EQUALIZER_AVAILABLE = "equalizerAvailable";
+ public static final String KEY_EQUALIZER_MAX_CHANNEL_ID = "equalizerMaxChannelId";
+
+ /**
+ * Constructs a newly allocated AudioControlCapabilities object
+ */
+ public AudioControlCapabilities() {
+ }
+
+ /**
+ * Constructs a newly allocated AudioControlCapabilities object indicated by the Hashtable parameter
+ *
+ * @param hash The Hashtable to use
+ */
+ public AudioControlCapabilities(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a newly allocated AudioControlCapabilities object
+ *
+ * @param moduleName short friendly name of the light control module.
+ */
+ public AudioControlCapabilities(@NonNull String moduleName) {
+ this();
+ setModuleName(moduleName);
+ }
+
+ /**
+ * Sets the moduleName portion of the AudioControlCapabilities class
+ *
+ * @param moduleName The short friendly name of the light control module. It should not be used to identify a module by mobile application.
+ */
+ public void setModuleName(@NonNull String moduleName) {
+ setValue(KEY_MODULE_NAME, moduleName);
+ }
+
+ /**
+ * Gets the moduleName portion of the AudioControlCapabilities class
+ *
+ * @return String - The short friendly name of the light control module. It should not be used to identify a module by mobile application.
+ */
+ public String getModuleName() {
+ return getString(KEY_MODULE_NAME);
+ }
+
+ /**
+ * Sets the sourceAvailable portion of the AudioControlCapabilities class
+ *
+ * @param sourceAvailable Availability of the control of audio source.
+ */
+ public void setSourceAvailable(Boolean sourceAvailable) {
+ setValue(KEY_SOURCE_AVAILABLE, sourceAvailable);
+ }
+
+ /**
+ * Gets the sourceAvailable portion of the AudioControlCapabilities class
+ *
+ * @return Boolean - Availability of the control of audio source.
+ */
+ public Boolean getSourceAvailable() {
+ return getBoolean(KEY_SOURCE_AVAILABLE);
+ }
+
+ /**
+ * Sets the volumeAvailable portion of the AudioControlCapabilities class
+ *
+ * @param volumeAvailable Availability of the control of audio volume.
+ */
+ public void setVolumeAvailable(Boolean volumeAvailable) {
+ setValue(KEY_VOLUME_AVAILABLE, volumeAvailable);
+ }
+
+ /**
+ * Gets the volumeAvailable portion of the AudioControlCapabilities class
+ *
+ * @return Boolean - Availability of the control of audio volume.
+ */
+ public Boolean getVolumeAvailable() {
+ return getBoolean(KEY_VOLUME_AVAILABLE);
+ }
+
+ /**
+ * Sets the equalizerAvailable portion of the AudioControlCapabilities class
+ *
+ * @param equalizerAvailable Availability of the control of Equalizer Settings.
+ */
+ public void setEqualizerAvailable(Boolean equalizerAvailable) {
+ setValue(KEY_EQUALIZER_AVAILABLE, equalizerAvailable);
+ }
+
+ /**
+ * Gets the equalizerAvailable portion of the AudioControlCapabilities class
+ *
+ * @return Boolean - Availability of the control of Equalizer Settings.
+ */
+ public Boolean getEqualizerAvailable() {
+ return getBoolean(KEY_EQUALIZER_AVAILABLE);
+ }
+
+ /**
+ * Sets the equalizerMaxChannelId portion of the AudioControlCapabilities class
+ *
+ * @param equalizerMaxChannelId Must be included if equalizerAvailable=true, and assume all IDs starting from 1 to this value are valid.
+ */
+ public void setEqualizerMaxChannelId(Integer equalizerMaxChannelId) {
+ setValue(KEY_EQUALIZER_MAX_CHANNEL_ID, equalizerMaxChannelId);
+ }
+
+ /**
+ * Gets the equalizerMaxChannelId portion of the AudioControlCapabilities class
+ *
+ * @return Integer - Must be included if equalizerAvailable=true, and assume all IDs starting from 1 to this value are valid.
+ */
+ public Integer getEqualizerMaxChannelId() {
+ return getInteger(KEY_EQUALIZER_MAX_CHANNEL_ID);
+ }
+
+}
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
new file mode 100644
index 000000000..9403fa9ab
--- /dev/null
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AudioControlData.java
@@ -0,0 +1,113 @@
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.PrimaryAudioSource;
+
+import java.util.Hashtable;
+import java.util.List;
+
+public class AudioControlData extends RPCStruct {
+ public static final String KEY_SOURCE = "source";
+ public static final String KEY_KEEP_CONTEXT = "keepContext";
+ public static final String KEY_VOLUME = "volume";
+ public static final String KEY_EQUALIZER_SETTINGS = "equalizerSettings";
+
+ /**
+ * Constructs a newly allocated AudioControlData object
+ */
+ public AudioControlData() {
+ }
+
+ /**
+ * Constructs a newly allocated AudioControlData object indicated by the Hashtable parameter
+ *
+ * @param hash The Hashtable to use
+ */
+ public AudioControlData(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Sets the source portion of the AudioControlData class
+ *
+ * @param source In a getter response or a notification, it is the current primary audio source of the system.
+ * In a setter request, it is the target audio source that the system shall switch to.
+ * If the value is MOBILE_APP, the system shall switch to the mobile media app that issues the setter RPC.
+ */
+ public void setSource(PrimaryAudioSource source) {
+ setValue(KEY_SOURCE, source);
+ }
+
+ /**
+ * Gets the source portion of the AudioControlData class
+ *
+ * @return PrimaryAudioSource - In a getter response or a notification, it is the current primary audio source of the system.
+ * In a setter request, it is the target audio source that the system shall switch to.
+ * If the value is MOBILE_APP, the system shall switch to the mobile media app that issues the setter RPC.
+ */
+ public PrimaryAudioSource getSource() {
+ return (PrimaryAudioSource) getObject(PrimaryAudioSource.class, KEY_SOURCE);
+ }
+
+ /**
+ * 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.
+ */
+ public void setKeepContext(Boolean keepContext) {
+ setValue(KEY_KEEP_CONTEXT, keepContext);
+ }
+
+ /**
+ * 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.
+ */
+ public Boolean getKeepContext() {
+ return getBoolean(KEY_KEEP_CONTEXT);
+ }
+
+ /**
+ * Sets the volume portion of the AudioControlData class
+ *
+ * @param volume Reflects the volume of audio, from 0%-100%.
+ */
+ public void setVolume(Integer volume) {
+ setValue(KEY_VOLUME, volume);
+ }
+
+ /**
+ * Gets the volume portion of the AudioControlData class
+ *
+ * @return Integer - Reflects the volume of audio, from 0%-100%.
+ */
+ public Integer getVolume() {
+ return getInteger(KEY_VOLUME);
+ }
+
+ /**
+ * Gets the equalizerSettings portion of the AudioControlData class
+ *
+ * @return List<EqualizerSettings> - Defines the list of supported channels (band) and their current/desired settings on HMI.
+ */
+ @SuppressWarnings("unchecked")
+ public List<EqualizerSettings> getEqualizerSettings() {
+ return (List<EqualizerSettings>) getObject(EqualizerSettings.class, KEY_EQUALIZER_SETTINGS);
+ }
+
+ /**
+ * Sets the equalizerSettings portion of the AudioControlData class
+ *
+ * @param equalizerSettings Defines the list of supported channels (band) and their current/desired settings on HMI.
+ */
+ public void setEqualizerSettings(List<EqualizerSettings> equalizerSettings) {
+ setValue(KEY_EQUALIZER_SETTINGS, equalizerSettings);
+ }
+
+}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Choice.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Choice.java
index 989ac2997..e93196bd5 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Choice.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Choice.java
@@ -3,7 +3,9 @@ package com.smartdevicelink.proxy.rpc;
import android.support.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.util.Version;
+import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
@@ -64,10 +66,12 @@ public class Choice extends RPCStruct {
public static final String KEY_VR_COMMANDS = "vrCommands";
public static final String KEY_CHOICE_ID = "choiceID";
public static final String KEY_IMAGE = "image";
+
/**
* Constructs a newly allocated Choice object
*/
public Choice() { }
+
/**
* Constructs a newly allocated Choice object indicated by the Hashtable parameter
* @param hash The Hashtable to use
@@ -75,18 +79,64 @@ public class Choice extends RPCStruct {
public Choice(Hashtable<String, Object> hash) {
super(hash);
}
+
+ /**
+ * Constructs a newly allocated Choice object
+ * @param choiceID Min: 0 Max: 65535
+ * @param menuName the menu name
+ */
+ public Choice(@NonNull Integer choiceID, @NonNull String menuName) {
+ this();
+ setChoiceID(choiceID);
+ setMenuName(menuName);
+ }
+
/**
* Constructs a newly allocated Choice object
* @param choiceID Min: 0 Max: 65535
* @param menuName the menu name
* @param vrCommands the List of vrCommands
+ *
+ * Deprecated - use {@link #Choice(Integer, String)}
*/
+ @Deprecated
public Choice(@NonNull Integer choiceID, @NonNull String menuName, @NonNull List<String> vrCommands) {
this();
setChoiceID(choiceID);
setMenuName(menuName);
setVrCommands(vrCommands);
}
+
+ /**
+ * VrCommands became optional as of RPC Spec 5.0. On legacy systems, we must still set VrCommands, as
+ * they are expected, even though the developer may not specify them. <br>
+ *
+ * Additionally, VrCommands must be unique, therefore we will use the string value of the command's ID
+ *
+ * @param rpcVersion the rpc spec version that has been negotiated. If value is null the
+ * the max value of RPC spec version this library supports should be used.
+ * @param formatParams if true, the format method will be called on subsequent params
+ */
+ @Override
+ public void format(Version rpcVersion, boolean formatParams){
+
+ if (rpcVersion == null || rpcVersion.getMajor() < 5){
+
+ // make sure there is at least one vr param
+ List<String> existingVrCommands = getVrCommands();
+
+ if (existingVrCommands == null || existingVrCommands.size() == 0) {
+ // if no commands set, set one due to a legacy head unit requirement
+ Integer choiceID = getChoiceID();
+ List<String> vrCommands = new ArrayList<>();
+ vrCommands.add(String.valueOf(choiceID));
+ setVrCommands(vrCommands);
+ }
+ }
+
+ super.format(rpcVersion, formatParams);
+ }
+
/**
* Get the application-scoped identifier that uniquely identifies this choice.
* @return choiceID Min: 0; Max: 65535
@@ -133,7 +183,7 @@ public class Choice extends RPCStruct {
* @param vrCommands the List of vrCommands
* @since SmartDeviceLink 2.0
*/
- public void setVrCommands(@NonNull List<String> vrCommands) {
+ public void setVrCommands(List<String> vrCommands) {
setValue(KEY_VR_COMMANDS, vrCommands);
}
/**
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ClimateControlCapabilities.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ClimateControlCapabilities.java
index 61a967585..335fffa48 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ClimateControlCapabilities.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ClimateControlCapabilities.java
@@ -25,6 +25,10 @@ public class ClimateControlCapabilities extends RPCStruct{
public static final String KEY_DEFROST_ZONE= "defrostZone";
public static final String KEY_VENTILATION_MODE_AVAILABLE= "ventilationModeAvailable";
public static final String KEY_VENTILATION_MODE= "ventilationMode";
+ public static final String KEY_HEATED_STEERING_WHEEL_AVAILABLE = "heatedSteeringWheelAvailable";
+ public static final String KEY_HEATED_WIND_SHIELD_AVAILABLE = "heatedWindshieldAvailable";
+ public static final String KEY_HEATED_REAR_WINDOW_AVAILABLE = "heatedRearWindowAvailable";
+ public static final String KEY_HEATED_MIRRORS_AVAILABLE = "heatedMirrorsAvailable";
public ClimateControlCapabilities() {
}
@@ -287,4 +291,84 @@ public class ClimateControlCapabilities extends RPCStruct{
public void setVentilationMode(List<VentilationMode> ventilationMode) {
setValue(KEY_VENTILATION_MODE, ventilationMode);
}
+
+ /**
+ * Sets the heatedSteeringWheelAvailable portion of the ClimateControlCapabilities class
+ *
+ * @param heatedSteeringWheelAvailable Availability of the control (enable/disable) of heated Steering Wheel.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public void setHeatedSteeringWheelAvailable(Boolean heatedSteeringWheelAvailable) {
+ setValue(KEY_HEATED_STEERING_WHEEL_AVAILABLE, heatedSteeringWheelAvailable);
+ }
+
+ /**
+ * Gets the heatedSteeringWheelAvailable portion of the ClimateControlCapabilities class
+ *
+ * @return Boolean - Availability of the control (enable/disable) of heated Steering Wheel.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public Boolean getHeatedSteeringWheelAvailable() {
+ return getBoolean(KEY_HEATED_STEERING_WHEEL_AVAILABLE);
+ }
+
+ /**
+ * Sets the heatedWindshieldAvailable portion of the ClimateControlCapabilities class
+ *
+ * @param heatedWindshieldAvailable Availability of the control (enable/disable) of heated Windshield.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public void setHeatedWindshieldAvailable(Boolean heatedWindshieldAvailable) {
+ setValue(KEY_HEATED_WIND_SHIELD_AVAILABLE, heatedWindshieldAvailable);
+ }
+
+ /**
+ * Gets the heatedWindshieldAvailable portion of the ClimateControlCapabilities class
+ *
+ * @return Boolean - Availability of the control (enable/disable) of heated Windshield.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public Boolean getHeatedWindshieldAvailable() {
+ return getBoolean(KEY_HEATED_WIND_SHIELD_AVAILABLE);
+ }
+
+ /**
+ * Sets the heatedRearWindowAvailable portion of the ClimateControlCapabilities class
+ *
+ * @param heatedRearWindowAvailable Availability of the control (enable/disable) of heated Rear Window.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public void setHeatedRearWindowAvailable(Boolean heatedRearWindowAvailable) {
+ setValue(KEY_HEATED_REAR_WINDOW_AVAILABLE, heatedRearWindowAvailable);
+ }
+
+ /**
+ * Gets the heatedRearWindowAvailable portion of the ClimateControlCapabilities class
+ *
+ * @return Boolean - Availability of the control (enable/disable) of heated Rear Window.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public Boolean getHeatedRearWindowAvailable() {
+ return getBoolean(KEY_HEATED_REAR_WINDOW_AVAILABLE);
+ }
+
+ /**
+ * Sets the heatedMirrorsAvailable portion of the ClimateControlCapabilities class
+ *
+ * @param heatedMirrorsAvailable Availability of the control (enable/disable) of heated Mirrors.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public void setHeatedMirrorsAvailable(Boolean heatedMirrorsAvailable) {
+ setValue(KEY_HEATED_MIRRORS_AVAILABLE, heatedMirrorsAvailable);
+ }
+
+ /**
+ * Gets the heatedMirrorsAvailable portion of the ClimateControlCapabilities class
+ *
+ * @return Boolean - Availability of the control (enable/disable) of heated Mirrors.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public Boolean getHeatedMirrorsAvailable() {
+ return getBoolean(KEY_HEATED_MIRRORS_AVAILABLE);
+ }
}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ClimateControlData.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ClimateControlData.java
index 0da8060f3..1229e4668 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ClimateControlData.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ClimateControlData.java
@@ -3,6 +3,7 @@ package com.smartdevicelink.proxy.rpc;
import com.smartdevicelink.proxy.RPCStruct;
import com.smartdevicelink.proxy.rpc.enums.DefrostZone;
import com.smartdevicelink.proxy.rpc.enums.VentilationMode;
+
import java.util.Hashtable;
public class ClimateControlData extends RPCStruct{
@@ -16,6 +17,10 @@ public class ClimateControlData extends RPCStruct{
public static final String KEY_DUAL_MODE_ENABLE= "dualModeEnable";
public static final String KEY_AC_MAX_ENABLE= "acMaxEnable";
public static final String KEY_VENTILATION_MODE= "ventilationMode";
+ public static final String KEY_HEATED_STEERING_WHEEL_ENABLE = "heatedSteeringWheelEnable";
+ public static final String KEY_HEATED_WIND_SHIELD_ENABLE = "heatedWindshieldEnable";
+ public static final String KEY_HEATED_REAR_WINDOW_ENABLE = "heatedRearWindowEnable";
+ public static final String KEY_HEATED_MIRRORS_ENABLE = "heatedMirrorsEnable";
public ClimateControlData() {
}
@@ -103,4 +108,76 @@ public class ClimateControlData extends RPCStruct{
public VentilationMode getVentilationMode() {
return (VentilationMode) getObject(VentilationMode.class, KEY_VENTILATION_MODE);
}
+
+ /**
+ * Sets the heatedSteeringWheelEnable portion of the ClimateControlCapabilities class
+ *
+ * @param heatedSteeringWheelEnable Value false means disabled/turn off, value true means enabled/turn on.
+ */
+ public void setHeatedSteeringWheelEnable(Boolean heatedSteeringWheelEnable) {
+ setValue(KEY_HEATED_STEERING_WHEEL_ENABLE, heatedSteeringWheelEnable);
+ }
+
+ /**
+ * Gets the heatedSteeringWheelEnable portion of the ClimateControlCapabilities class
+ *
+ * @return Boolean - Value false means disabled/turn off, value true means enabled/turn on.
+ */
+ public Boolean getHeatedSteeringWheelEnable() {
+ return getBoolean(KEY_HEATED_STEERING_WHEEL_ENABLE);
+ }
+
+ /**
+ * Sets the heatedWindshieldEnable portion of the ClimateControlCapabilities class
+ *
+ * @param heatedWindshieldEnable Value false means disabled, value true means enabled.
+ */
+ public void setHeatedWindshieldEnable(Boolean heatedWindshieldEnable) {
+ setValue(KEY_HEATED_WIND_SHIELD_ENABLE, heatedWindshieldEnable);
+ }
+
+ /**
+ * Gets the heatedWindshieldEnable portion of the ClimateControlCapabilities class
+ *
+ * @return Boolean - Value false means disabled, value true means enabled.
+ */
+ public Boolean getHeatedWindshieldEnable() {
+ return getBoolean(KEY_HEATED_WIND_SHIELD_ENABLE);
+ }
+
+ /**
+ * Sets the heatedRearWindowEnable portion of the ClimateControlCapabilities class
+ *
+ * @param heatedRearWindowEnable Value false means disabled, value true means enabled.
+ */
+ public void setHeatedRearWindowEnable(Boolean heatedRearWindowEnable) {
+ setValue(KEY_HEATED_REAR_WINDOW_ENABLE, heatedRearWindowEnable);
+ }
+
+ /**
+ * Gets the heatedRearWindowEnable portion of the ClimateControlCapabilities class
+ *
+ * @return Boolean - Value false means disabled, value true means enabled.
+ */
+ public Boolean getHeatedRearWindowEnable() {
+ return getBoolean(KEY_HEATED_REAR_WINDOW_ENABLE);
+ }
+
+ /**
+ * Sets the heatedMirrorsEnable portion of the ClimateControlCapabilities class
+ *
+ * @param heatedMirrorsEnable Value false means disabled, value true means enabled.
+ */
+ public void setHeatedMirrorsEnable(Boolean heatedMirrorsEnable) {
+ setValue(KEY_HEATED_MIRRORS_ENABLE, heatedMirrorsEnable);
+ }
+
+ /**
+ * Gets the heatedMirrorsEnable portion of the ClimateControlCapabilities class
+ *
+ * @return Boolean - Value false means disabled, value true means enabled.
+ */
+ public Boolean getHeatedMirrorsEnable() {
+ return getBoolean(KEY_HEATED_MIRRORS_ENABLE);
+ }
}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/EqualizerSettings.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/EqualizerSettings.java
new file mode 100644
index 000000000..78e76c808
--- /dev/null
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/EqualizerSettings.java
@@ -0,0 +1,97 @@
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+
+/**
+ * Defines the each Equalizer channel settings.
+ */
+public class EqualizerSettings extends RPCStruct {
+ public static final String KEY_CHANNEL_ID = "channelId";
+ public static final String KEY_CHANNEL_NAME = "channelName";
+ public static final String KEY_CHANNEL_SETTING = "channelSetting";
+
+ /**
+ * Constructs a newly allocated EqualizerSettings object
+ */
+ public EqualizerSettings() {
+ }
+
+ /**
+ * Constructs a newly allocated EqualizerSettings object indicated by the Hashtable parameter
+ *
+ * @param hash The Hashtable to use
+ */
+ public EqualizerSettings(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a newly allocated EqualizerSettings object
+ *
+ * @param channelId Min: 0 Max: 100
+ * @param channelSetting Min: 0 Max: 100
+ */
+ public EqualizerSettings(@NonNull Integer channelId, @NonNull Integer channelSetting) {
+ this();
+ setChannelId(channelId);
+ setChannelSetting(channelSetting);
+ }
+
+ /**
+ * Sets the channelId portion of the EqualizerSettings class
+ *
+ * @param channelId
+ */
+ public void setChannelId(@NonNull Integer channelId) {
+ setValue(KEY_CHANNEL_ID, channelId);
+ }
+
+ /**
+ * Gets the channelId portion of the EqualizerSettings class
+ *
+ * @return Integer
+ */
+ public Integer getChannelId() {
+ return getInteger(KEY_CHANNEL_ID);
+ }
+
+ /**
+ * Sets the channelName portion of the EqualizerSettings class
+ *
+ * @param channelName Read-only channel / frequency name (e.i. "Treble, Midrange, Bass" or "125 Hz").
+ */
+ public void setChannelName(String channelName) {
+ setValue(KEY_CHANNEL_NAME, channelName);
+ }
+
+ /**
+ * Gets the channelName portion of the EqualizerSettings class
+ *
+ * @return String - Read-only channel / frequency name (e.i. "Treble, Midrange, Bass" or "125 Hz").
+ */
+ public String getChannelName() {
+ return getString(KEY_CHANNEL_NAME);
+ }
+
+ /**
+ * Sets the channelSetting portion of the EqualizerSettings class
+ *
+ * @param channelSetting Reflects the setting, from 0%-100%.
+ */
+ public void setChannelSetting(@NonNull Integer channelSetting) {
+ setValue(KEY_CHANNEL_SETTING, channelSetting);
+ }
+
+ /**
+ * Gets the channelSetting portion of the EqualizerSettings class
+ *
+ * @return Integer - Reflects the setting, from 0%-100%.
+ */
+ public Integer getChannelSetting() {
+ return getInteger(KEY_CHANNEL_SETTING);
+ }
+}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GPSData.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GPSData.java
index 274e5c1be..ca264556f 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GPSData.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GPSData.java
@@ -79,21 +79,21 @@ import java.util.Hashtable;
* <tr>
* <td>pdop</td>
* <td>Integer</td>
- * <td>Positional Dilution of Precision<b>Minvalue: 0<b>Maxvalue: 31
+ * <td>Positional Dilution of Precision. If undefined or unavailable, then value shall be set to 0.<b>Minvalue: 0<b>Maxvalue: 1000
* </td>
* <td>SmartDeviceLink 2.0</td>
* </tr>
* <tr>
* <td>hdop</td>
* <td>Integer</td>
- * <td>Horizontal Dilution of Precision<b>Minvalue: 0<b>Maxvalue: 31
+ * <td>Horizontal Dilution of Precision. If value is unknown, value shall be set to 0.<b>Minvalue: 0<b>Maxvalue: 1000
* </td>
* <td>SmartDeviceLink 2.0</td>
* </tr>
* <tr>
* <td>vdop</td>
* <td>Integer</td>
- * <td>Vertical Dilution of Precision<b>Minvalue: 0<b>Maxvalue: 31
+ * <td>Vertical Dilution of Precision. If value is unknown, value shall be set to 0.<b>Minvalue: 0<b>Maxvalue: 1000
* </td>
* <td>SmartDeviceLink 2.0</td>
* </tr>
@@ -138,7 +138,7 @@ import java.util.Hashtable;
* <td>Integer</td>
* <td>The speed in KPH
* <b>Minvalue: 0
- * <b>Maxvalue: 400
+ * <b>Maxvalue: 500
* </td>
* <td>SmartDeviceLink 2.0</td>
* </tr>
@@ -169,7 +169,7 @@ public class GPSData extends RPCStruct {
* Constructs a newly allocated GPSData object
*/
public GPSData() { }
-
+
/**
* Constructs a newly allocated GPSData object indicated by the Hashtable parameter
* @param hash The Hashtable to use
@@ -180,7 +180,9 @@ public class GPSData extends RPCStruct {
/**
* Constructs a newly allocated GPSData object
+ * @deprecated Use {@link #GPSData(@NonNull Double, @NonNull Double)()} instead
*/
+ @Deprecated
public GPSData(@NonNull Double longitudeDegrees, @NonNull Double latitudeDegrees, @NonNull Integer utcYear,
@NonNull Integer utcMonth, @NonNull Integer utcDay, @NonNull Integer utcHours,
@NonNull Integer utcMinutes, @NonNull Integer utcSeconds, @NonNull CompassDirection compassDirection,
@@ -206,6 +208,15 @@ public class GPSData extends RPCStruct {
setHeading(heading);
setSpeed(speed);
}
+
+ /**
+ * Constructs a newly allocated GPSData object
+ */
+ public GPSData(@NonNull Double longitudeDegrees, @NonNull Double latitudeDegrees) {
+ this();
+ setLongitudeDegrees(longitudeDegrees);
+ setLatitudeDegrees(latitudeDegrees);
+ }
/**
* set longitude degrees
* @param longitudeDegrees
@@ -244,7 +255,7 @@ public class GPSData extends RPCStruct {
* set utc year
* @param utcYear utc year
*/
- public void setUtcYear(@NonNull Integer utcYear) {
+ public void setUtcYear(Integer utcYear) {
setValue(KEY_UTC_YEAR, utcYear);
}
@@ -260,7 +271,7 @@ public class GPSData extends RPCStruct {
* set utc month
* @param utcMonth utc month
*/
- public void setUtcMonth(@NonNull Integer utcMonth) {
+ public void setUtcMonth(Integer utcMonth) {
setValue(KEY_UTC_MONTH, utcMonth);
}
@@ -276,7 +287,7 @@ public class GPSData extends RPCStruct {
* set utc day
* @param utcDay utc day
*/
- public void setUtcDay(@NonNull Integer utcDay) {
+ public void setUtcDay(Integer utcDay) {
setValue(KEY_UTC_DAY, utcDay);
}
@@ -292,7 +303,7 @@ public class GPSData extends RPCStruct {
* set utc hours
* @param utcHours utc hours
*/
- public void setUtcHours(@NonNull Integer utcHours) {
+ public void setUtcHours(Integer utcHours) {
setValue(KEY_UTC_HOURS, utcHours);
}
@@ -308,7 +319,7 @@ public class GPSData extends RPCStruct {
* set utc minutes
* @param utcMinutes utc minutes
*/
- public void setUtcMinutes(@NonNull Integer utcMinutes) {
+ public void setUtcMinutes(Integer utcMinutes) {
setValue(KEY_UTC_MINUTES, utcMinutes);
}
@@ -324,7 +335,7 @@ public class GPSData extends RPCStruct {
* set utc seconds
* @param utcSeconds utc seconds
*/
- public void setUtcSeconds(@NonNull Integer utcSeconds) {
+ public void setUtcSeconds(Integer utcSeconds) {
setValue(KEY_UTC_SECONDS, utcSeconds);
}
@@ -335,7 +346,7 @@ public class GPSData extends RPCStruct {
public Integer getUtcSeconds() {
return getInteger(KEY_UTC_SECONDS);
}
- public void setCompassDirection(@NonNull CompassDirection compassDirection) {
+ public void setCompassDirection(CompassDirection compassDirection) {
setValue(KEY_COMPASS_DIRECTION, compassDirection);
}
public CompassDirection getCompassDirection() {
@@ -346,7 +357,7 @@ public class GPSData extends RPCStruct {
* set the positional dilution of precision
* @param pdop the positional dilution of precision
*/
- public void setPdop(@NonNull Double pdop) {
+ public void setPdop(Double pdop) {
setValue(KEY_PDOP, pdop);
}
@@ -362,7 +373,7 @@ public class GPSData extends RPCStruct {
* set the horizontal dilution of precision
* @param hdop the horizontal dilution of precision
*/
- public void setHdop(@NonNull Double hdop) {
+ public void setHdop(Double hdop) {
setValue(KEY_HDOP, hdop);
}
@@ -379,7 +390,7 @@ public class GPSData extends RPCStruct {
* set the vertical dilution of precision
* @param vdop the vertical dilution of precision
*/
- public void setVdop(@NonNull Double vdop) {
+ public void setVdop(Double vdop) {
setValue(KEY_VDOP, vdop);
}
@@ -396,7 +407,7 @@ public class GPSData extends RPCStruct {
* set what coordinates based on
* @param actual True, if coordinates are based on satellites.False, if based on dead reckoning
*/
- public void setActual(@NonNull Boolean actual) {
+ public void setActual(Boolean actual) {
setValue(KEY_ACTUAL, actual);
}
@@ -412,7 +423,7 @@ public class GPSData extends RPCStruct {
* set the number of satellites in view
* @param satellites the number of satellites in view
*/
- public void setSatellites(@NonNull Integer satellites) {
+ public void setSatellites(Integer satellites) {
setValue(KEY_SATELLITES, satellites);
}
@@ -423,7 +434,7 @@ public class GPSData extends RPCStruct {
public Integer getSatellites() {
return getInteger(KEY_SATELLITES);
}
- public void setDimension(@NonNull Dimension dimension) {
+ public void setDimension(Dimension dimension) {
setValue(KEY_DIMENSION, dimension);
}
public Dimension getDimension() {
@@ -434,7 +445,7 @@ public class GPSData extends RPCStruct {
* set altitude in meters
* @param altitude altitude in meters
*/
- public void setAltitude(@NonNull Double altitude) {
+ public void setAltitude(Double altitude) {
setValue(KEY_ALTITUDE, altitude);
}
@@ -451,7 +462,7 @@ public class GPSData extends RPCStruct {
* set the heading.North is 0, East is 90, etc.
* @param heading the heading.
*/
- public void setHeading(@NonNull Double heading) {
+ public void setHeading(Double heading) {
setValue(KEY_HEADING, heading);
}
@@ -467,7 +478,7 @@ public class GPSData extends RPCStruct {
* set speed in KPH
* @param speed the speed
*/
- public void setSpeed(@NonNull Double speed) {
+ public void setSpeed(Double speed) {
setValue(KEY_SPEED, speed);
}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/HMISettingsControlCapabilities.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/HMISettingsControlCapabilities.java
new file mode 100644
index 000000000..f5377b1b0
--- /dev/null
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/HMISettingsControlCapabilities.java
@@ -0,0 +1,107 @@
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+
+public class HMISettingsControlCapabilities extends RPCStruct {
+ public static final String KEY_MODULE_NAME = "moduleName";
+ public static final String KEY_DISTANCE_UNIT_AVAILABLE = "distanceUnitAvailable";
+ public static final String KEY_TEMPERATURE_UNIT_AVAILABLE = "temperatureUnitAvailable";
+ public static final String KEY_DISPLAY_MODE_UNIT_AVAILABLE = "displayModeUnitAvailable";
+
+ /**
+ * Constructs a new HMISettingsControlCapabilities object
+ */
+ public HMISettingsControlCapabilities() {
+ }
+
+ /**
+ * <p>Constructs a new HMISettingsControlCapabilities object indicated by the Hashtable parameter
+ * </p>
+ *
+ * @param hash The Hashtable to use
+ */
+ public HMISettingsControlCapabilities(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ public HMISettingsControlCapabilities(@NonNull String moduleName) {
+ this();
+ setModuleName(moduleName);
+ }
+
+ /**
+ * Sets the moduleName portion of the HMISettingsControlCapabilities class
+ *
+ * @param moduleName The short friendly name of the hmi setting module. It should not be used to identify a module by mobile application.
+ */
+ public void setModuleName(@NonNull String moduleName) {
+ setValue(KEY_MODULE_NAME, moduleName);
+ }
+
+ /**
+ * Gets the moduleName portion of the HMISettingsControlCapabilities class
+ *
+ * @return String - The short friendly name of the hmi setting module. It should not be used to identify a module by mobile application.
+ */
+ public String getModuleName() {
+ return getString(KEY_MODULE_NAME);
+ }
+
+ /**
+ * Sets the distanceUnitAvailable portion of the HMISettingsControlCapabilities class
+ *
+ * @param distanceUnitAvailable Availability of the control of distance unit.
+ */
+ public void setDistanceUnitAvailable(Boolean distanceUnitAvailable) {
+ setValue(KEY_DISTANCE_UNIT_AVAILABLE, distanceUnitAvailable);
+ }
+
+ /**
+ * Gets the distanceUnitAvailable portion of the HMISettingsControlCapabilities class
+ *
+ * @return Boolean - Availability of the control of distance unit.
+ */
+ public Boolean getDistanceUnitAvailable() {
+ return getBoolean(KEY_DISTANCE_UNIT_AVAILABLE);
+ }
+
+ /**
+ * Sets the temperatureUnitAvailable portion of the HMISettingsControlCapabilities class
+ *
+ * @param temperatureUnitAvailable Availability of the control of temperature unit.
+ */
+ public void setTemperatureUnitAvailable(Boolean temperatureUnitAvailable) {
+ setValue(KEY_TEMPERATURE_UNIT_AVAILABLE, temperatureUnitAvailable);
+ }
+
+ /**
+ * Gets the temperatureUnitAvailable portion of the HMISettingsControlCapabilities class
+ *
+ * @return Boolean - Availability of the control of temperature unit.
+ */
+ public Boolean getTemperatureUnitAvailable() {
+ return getBoolean(KEY_TEMPERATURE_UNIT_AVAILABLE);
+ }
+
+ /**
+ * Sets the displayModeUnitAvailable portion of the HMISettingsControlCapabilities class
+ *
+ * @param displayModeUnitAvailable Availability of the control of HMI display mode.
+ */
+ public void setDisplayModeUnitAvailable(Boolean displayModeUnitAvailable) {
+ setValue(KEY_DISPLAY_MODE_UNIT_AVAILABLE, displayModeUnitAvailable);
+ }
+
+ /**
+ * Gets the displayModeUnitAvailable portion of the HMISettingsControlCapabilities class
+ *
+ * @return Boolean - Availability of the control of HMI display mode.
+ */
+ public Boolean getDisplayModeUnitAvailable() {
+ return getBoolean(KEY_DISPLAY_MODE_UNIT_AVAILABLE);
+ }
+}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/HMISettingsControlData.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/HMISettingsControlData.java
new file mode 100644
index 000000000..e6dc4d301
--- /dev/null
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/HMISettingsControlData.java
@@ -0,0 +1,79 @@
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.DisplayMode;
+import com.smartdevicelink.proxy.rpc.enums.DistanceUnit;
+import com.smartdevicelink.proxy.rpc.enums.TemperatureUnit;
+
+import java.util.Hashtable;
+
+/**
+ * Corresponds to "HMI_SETTINGS" ModuleType
+ */
+
+public class HMISettingsControlData extends RPCStruct {
+ public static final String KEY_DISPLAY_MODE = "displayMode";
+ public static final String KEY_TEMPERATURE_UNIT = "temperatureUnit";
+ public static final String KEY_DISTANCE_UNIT = "distanceUnit";
+
+ public HMISettingsControlData() {
+ }
+
+ public HMISettingsControlData(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Sets the displayMode portion of the HMISettingsControlData class
+ *
+ * @param displayMode
+ */
+ public void setDisplayMode(DisplayMode displayMode) {
+ setValue(KEY_DISPLAY_MODE, displayMode);
+ }
+
+ /**
+ * Gets the displayMode portion of the HMISettingsControlData class
+ *
+ * @return DisplayMode
+ */
+ public DisplayMode getDisplayMode() {
+ return (DisplayMode) getObject(DisplayMode.class, KEY_DISPLAY_MODE);
+ }
+
+ /**
+ * Sets the temperatureUnit portion of the HMISettingsControlData class
+ *
+ * @param temperatureUnit
+ */
+ public void setTemperatureUnit(TemperatureUnit temperatureUnit) {
+ setValue(KEY_TEMPERATURE_UNIT, temperatureUnit);
+ }
+
+ /**
+ * Gets the temperatureUnit portion of the HMISettingsControlData class
+ *
+ * @return TemperatureUnit
+ */
+ public TemperatureUnit getTemperatureUnit() {
+ return (TemperatureUnit) getObject(TemperatureUnit.class, KEY_TEMPERATURE_UNIT);
+ }
+
+ /**
+ * Sets the distanceUnit portion of the HMISettingsControlData class
+ *
+ * @param distanceUnit
+ */
+ public void setDistanceUnit(DistanceUnit distanceUnit) {
+ setValue(KEY_DISTANCE_UNIT, distanceUnit);
+ }
+
+ /**
+ * Gets the distanceUnit portion of the HMISettingsControlData class
+ *
+ * @return DistanceUnit
+ */
+ public DistanceUnit getDistanceUnit() {
+ return (DistanceUnit) getObject(DistanceUnit.class, KEY_DISTANCE_UNIT);
+ }
+}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/LightCapabilities.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/LightCapabilities.java
new file mode 100644
index 000000000..b23c8356c
--- /dev/null
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/LightCapabilities.java
@@ -0,0 +1,113 @@
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.LightName;
+
+import java.util.Hashtable;
+
+public class LightCapabilities extends RPCStruct {
+
+ public static final String KEY_NAME = "name";
+ public static final String KEY_DENSITY_AVAILABLE = "densityAvailable";
+ public static final String KEY_RGB_COLOR_SPACE_AVAILABLE = "rgbColorSpaceAvailable";
+ public static final String KEY_STATUS_AVAILABLE = "statusAvailable";
+
+ /**
+ * Constructs a newly allocated LightCapabilities object
+ */
+ public LightCapabilities() {
+ }
+
+ /**
+ * Constructs a newly allocated LightCapabilities object indicated by the Hashtable parameter
+ *
+ * @param hash The Hashtable to use
+ */
+ public LightCapabilities(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a newly allocated LightCapabilities object
+ *
+ * @param name name of Light
+ */
+ public LightCapabilities(@NonNull LightName name) {
+ this();
+ setName(name);
+ }
+
+ /**
+ * Sets the name portion of the LightCapabilities class
+ *
+ * @param name
+ */
+ public void setName(@NonNull LightName name) {
+ setValue(KEY_NAME, name);
+ }
+
+ /**
+ * Gets the name portion of the LightCapabilities class
+ *
+ * @return LightName
+ */
+ public LightName getName() {
+ return (LightName) getObject(LightName.class, KEY_NAME);
+ }
+
+ /**
+ * Sets the densityAvailable portion of the LightCapabilities class
+ *
+ * @param densityAvailable Indicates if the light's density can be set remotely (similar to a dimmer).
+ */
+ public void setDensityAvailable(Boolean densityAvailable) {
+ setValue(KEY_DENSITY_AVAILABLE, densityAvailable);
+ }
+
+ /**
+ * Gets the densityAvailable portion of the LightCapabilities class
+ *
+ * @return Boolean - Indicates if the light's density can be set remotely (similar to a dimmer).
+ */
+ public Boolean getDensityAvailable() {
+ return getBoolean(KEY_DENSITY_AVAILABLE);
+ }
+
+ /**
+ * Sets the RGBColorSpaceAvailable portion of the LightCapabilities class
+ *
+ * @param RGBColorSpaceAvailable Indicates if the light's color can be set remotely by using the RGB color space.
+ */
+ public void setRGBColorSpaceAvailable(Boolean RGBColorSpaceAvailable) {
+ setValue(KEY_RGB_COLOR_SPACE_AVAILABLE, RGBColorSpaceAvailable);
+ }
+
+ /**
+ * Gets the RGBColorSpaceAvailable portion of the LightCapabilities class
+ *
+ * @return Boolean - Indicates if the light's color can be set remotely by using the RGB color space.
+ */
+ public Boolean getRGBColorSpaceAvailable() {
+ return getBoolean(KEY_RGB_COLOR_SPACE_AVAILABLE);
+ }
+
+ /**
+ * Sets the statusAvailable portion of the LightCapabilities class
+ *
+ * @param statusAvailable Indicates if the status (ON/OFF) can be set remotely. App shall not use read-only values (RAMP_UP/RAMP_DOWN/UNKNOWN/INVALID) in a setInteriorVehicleData request.
+ */
+ public void setStatusAvailable(Boolean statusAvailable) {
+ setValue(KEY_STATUS_AVAILABLE, statusAvailable);
+ }
+
+ /**
+ * Gets the statusAvailable portion of the LightCapabilities class
+ *
+ * @return Boolean - Indicates if the status (ON/OFF) can be set remotely. App shall not use read-only values (RAMP_UP/RAMP_DOWN/UNKNOWN/INVALID) in a setInteriorVehicleData request.
+ */
+ public Boolean getStatusAvailable() {
+ return getBoolean(KEY_STATUS_AVAILABLE);
+ }
+}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/LightControlCapabilities.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/LightControlCapabilities.java
new file mode 100644
index 000000000..ab84da275
--- /dev/null
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/LightControlCapabilities.java
@@ -0,0 +1,78 @@
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+import java.util.List;
+
+public class LightControlCapabilities extends RPCStruct {
+ public static final String KEY_MODULE_NAME = "moduleName";
+ public static final String KEY_SUPPORTED_LIGHTS = "supportedLights";
+
+ /**
+ * Constructs a new LightControlCapabilities object
+ */
+ public LightControlCapabilities() {
+ }
+
+ /**
+ * <p>Constructs a new LightControlCapabilities object indicated by the Hashtable parameter
+ * </p>
+ *
+ * @param hash The Hashtable to use
+ */
+ public LightControlCapabilities(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a newly allocated LightControlCapabilities object
+ *
+ * @param moduleName short friendly name of the light control module.
+ * @param supportedLights An array of available LightCapabilities that are controllable.
+ */
+ public LightControlCapabilities(@NonNull String moduleName, @NonNull List<LightCapabilities> supportedLights) {
+ this();
+ setModuleName(moduleName);
+ setSupportedLights(supportedLights);
+ }
+
+ /**
+ * Sets the moduleName portion of the LightControlCapabilities class
+ *
+ * @param moduleName The short friendly name of the light control module. It should not be used to identify a module by mobile application.
+ */
+ public void setModuleName(@NonNull String moduleName) {
+ setValue(KEY_MODULE_NAME, moduleName);
+ }
+
+ /**
+ * Gets the moduleName portion of the LightControlCapabilities class
+ *
+ * @return String - The short friendly name of the light control module. It should not be used to identify a module by mobile application.
+ */
+ public String getModuleName() {
+ return getString(KEY_MODULE_NAME);
+ }
+
+ /**
+ * Gets the supportedLights portion of the LightControlCapabilities class
+ *
+ * @return List<LightCapabilities> - An array of available LightCapabilities that are controllable.
+ */
+ @SuppressWarnings("unchecked")
+ public List<LightCapabilities> getSupportedLights() {
+ return (List<LightCapabilities>) getObject(LightCapabilities.class, KEY_SUPPORTED_LIGHTS);
+ }
+
+ /**
+ * Sets the supportedLights portion of the LightControlCapabilities class
+ *
+ * @param supportedLights An array of available LightCapabilities that are controllable.
+ */
+ public void setSupportedLights(@NonNull List<LightCapabilities> supportedLights) {
+ setValue(KEY_SUPPORTED_LIGHTS, supportedLights);
+ }
+}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/LightControlData.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/LightControlData.java
new file mode 100644
index 000000000..a78b979c5
--- /dev/null
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/LightControlData.java
@@ -0,0 +1,58 @@
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+import java.util.List;
+
+public class LightControlData extends RPCStruct {
+ public static final String KEY_LIGHT_STATE = "lightState";
+
+ /**
+ * Constructs a new LightControlData object
+ */
+ public LightControlData() {
+ }
+
+ /**
+ * <p>Constructs a new LightControlData object indicated by the Hashtable parameter
+ * </p>
+ *
+ * @param hash The Hashtable to use
+ */
+ public LightControlData(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a newly allocated LightControlData object
+ *
+ * @param lightState An array of LightNames and their current or desired status.
+ * Status of the LightNames that are not listed in the array shall remain unchanged.
+ */
+ public LightControlData(@NonNull List<LightState> lightState) {
+ this();
+ setLightState(lightState);
+ }
+
+ /**
+ * Gets the lightState portion of the LightControlData class
+ *
+ * @return List<LightState> - An array of LightNames and their current or desired status. Status of the LightNames that are not listed in the array shall remain unchanged.
+ */
+ @SuppressWarnings("unchecked")
+ public List<LightState> getLightState() {
+ return (List<LightState>) getObject(LightState.class, KEY_LIGHT_STATE);
+ }
+
+ /**
+ * Sets the lightState portion of the LightControlData class
+ *
+ * @param lightState An array of LightNames and their current or desired status. Status of the LightNames that are not listed in the array shall remain unchanged.
+ */
+ public void setLightState(@NonNull List<LightState> lightState) {
+ setValue(KEY_LIGHT_STATE, lightState);
+ }
+}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/LightState.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/LightState.java
new file mode 100644
index 000000000..90315f785
--- /dev/null
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/LightState.java
@@ -0,0 +1,119 @@
+package com.smartdevicelink.proxy.rpc;
+
+import android.support.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.LightName;
+import com.smartdevicelink.proxy.rpc.enums.LightStatus;
+import com.smartdevicelink.util.SdlDataTypeConverter;
+
+import java.util.Hashtable;
+
+public class LightState extends RPCStruct {
+ public static final String KEY_ID = "id";
+ public static final String KEY_STATUS = "status";
+ public static final String KEY_DENSITY = "density";
+ public static final String KEY_COLOR = "color";
+
+ /**
+ * Constructs a new LightState object
+ */
+ public LightState() {
+ }
+
+ /**
+ * <p>Constructs a new LightState object indicated by the Hashtable parameter
+ * </p>
+ *
+ * @param hash The Hashtable to use
+ */
+ public LightState(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Constructs a newly allocated LightState object
+ *
+ * @param id The name of a light or a group of lights.
+ * @param status Status of Light.
+ */
+ public LightState(@NonNull LightName id, @NonNull LightStatus status) {
+ this();
+ setId(id);
+ setStatus(status);
+ }
+
+ /**
+ * Sets the id portion of the LightState class
+ *
+ * @param id The name of a light or a group of lights.
+ */
+ public void setId(@NonNull LightName id) {
+ setValue(KEY_ID, id);
+ }
+
+ /**
+ * Gets the id portion of the LightState class
+ *
+ * @return LightName - The name of a light or a group of lights.
+ */
+ public LightName getId() {
+ return (LightName) getObject(LightName.class, KEY_ID);
+ }
+
+ /**
+ * Sets the status portion of the LightState class
+ *
+ * @param status
+ */
+ public void setStatus(@NonNull LightStatus status) {
+ setValue(KEY_STATUS, status);
+ }
+
+ /**
+ * Gets the status portion of the LightState class
+ *
+ * @return LightStatus
+ */
+ public LightStatus getStatus() {
+ return (LightStatus) getObject(LightStatus.class, KEY_STATUS);
+ }
+
+ /**
+ * Gets the density portion of the LightState class
+ *
+ * @return Float
+ */
+ public Float getDensity() {
+ Object value = getValue(KEY_DENSITY);
+ return SdlDataTypeConverter.objectToFloat(value);
+ }
+
+ /**
+ * Sets the density portion of the LightState class
+ *
+ * @param density
+ */
+ public void setDensity(Float density) {
+ setValue(KEY_DENSITY, density);
+ }
+
+ /**
+ * Gets the color portion of the LightState class
+ *
+ * @return RGBColor
+ */
+ @SuppressWarnings("unchecked")
+ public RGBColor getColor() {
+ return (RGBColor) getObject(RGBColor.class, KEY_COLOR);
+ }
+
+ /**
+ * Sets the color portion of the LightState class
+ *
+ * @param color
+ */
+ public void setColor(RGBColor color) {
+ setValue(KEY_COLOR, color);
+ }
+}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ModuleData.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ModuleData.java
index b21c60be2..85a24c064 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ModuleData.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ModuleData.java
@@ -12,6 +12,9 @@ public class ModuleData extends RPCStruct {
public static final String KEY_RADIO_CONTROL_DATA = "radioControlData";
public static final String KEY_CLIMATE_CONTROL_DATA = "climateControlData";
public static final String KEY_SEAT_CONTROL_DATA = "seatControlData";
+ public static final String KEY_AUDIO_CONTROL_DATA = "audioControlData";
+ public static final String KEY_LIGHT_CONTROL_DATA = "lightControlData";
+ public static final String KEY_HMI_SETTINGS_CONTROL_DATA = "hmiSettingsControlData";
public ModuleData() {
}
@@ -98,4 +101,58 @@ public class ModuleData extends RPCStruct {
public SeatControlData getSeatControlData() {
return (SeatControlData) getObject(SeatControlData.class, KEY_SEAT_CONTROL_DATA);
}
+
+ /**
+ * Sets the audioControlData portion of the ModuleData class
+ *
+ * @param audioControlData
+ */
+ public void setAudioControlData(AudioControlData audioControlData) {
+ setValue(KEY_AUDIO_CONTROL_DATA, audioControlData);
+ }
+
+ /**
+ * Gets the audioControlData portion of the ModuleData class
+ *
+ * @return AudioControlData
+ */
+ public AudioControlData getAudioControlData() {
+ return (AudioControlData) getObject(AudioControlData.class, KEY_AUDIO_CONTROL_DATA);
+ }
+
+ /**
+ * Sets the lightControlData portion of the ModuleData class
+ *
+ * @param lightControlData
+ */
+ public void setLightControlData(LightControlData lightControlData) {
+ setValue(KEY_LIGHT_CONTROL_DATA, lightControlData);
+ }
+
+ /**
+ * Gets the lightControlData portion of the ModuleData class
+ *
+ * @return LightControlData
+ */
+ public LightControlData getLightControlData() {
+ return (LightControlData) getObject(LightControlData.class, KEY_LIGHT_CONTROL_DATA);
+ }
+
+ /**
+ * Sets the hmiSettingsControlData portion of the ModuleData class
+ *
+ * @param hmiSettingsControlData
+ */
+ public void setHmiSettingsControlData(HMISettingsControlData hmiSettingsControlData) {
+ setValue(KEY_HMI_SETTINGS_CONTROL_DATA, hmiSettingsControlData);
+ }
+
+ /**
+ * Gets the hmiSettingsControlData portion of the ModuleData class
+ *
+ * @return HMISettingsControlData
+ */
+ public HMISettingsControlData getHmiSettingsControlData() {
+ return (HMISettingsControlData) getObject(HMISettingsControlData.class, KEY_HMI_SETTINGS_CONTROL_DATA);
+ }
}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnHMIStatus.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnHMIStatus.java
index a7ebc26ae..bcb281986 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnHMIStatus.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/OnHMIStatus.java
@@ -104,6 +104,18 @@ public class OnHMIStatus extends RPCNotification {
setAudioStreamingState(audioStreamingState);
setSystemContext(systemContext);
}
+
+ @Override
+ public void format(com.smartdevicelink.util.Version rpcVersion, boolean formatParams){
+ if(rpcVersion.getMajor() < 5){
+ if(getVideoStreamingState() == null){
+ setVideoStreamingState(VideoStreamingState.STREAMABLE);
+ }
+ }
+
+ super.format(rpcVersion,formatParams);
+ }
+
/**
* <p>Get HMILevel in effect for the application</p>
* @return {@linkplain HMILevel} the current HMI Level in effect for the application
@@ -137,11 +149,7 @@ public class OnHMIStatus extends RPCNotification {
* @return {@linkplain VideoStreamingState} Returns current state of video streaming for the application
*/
public VideoStreamingState getVideoStreamingState() {
- VideoStreamingState videoStreamingState = (VideoStreamingState) getObject(VideoStreamingState.class, KEY_VIDEO_STREAMING_STATE);
- if (videoStreamingState == null){
- videoStreamingState = VideoStreamingState.STREAMABLE;
- }
- return videoStreamingState;
+ return (VideoStreamingState) getObject(VideoStreamingState.class, KEY_VIDEO_STREAMING_STATE);
}
/**
* <p>Set the video streaming state</p>
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RadioControlCapabilities.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RadioControlCapabilities.java
index 1eee9a17a..0438d08cb 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RadioControlCapabilities.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RadioControlCapabilities.java
@@ -19,6 +19,7 @@ public class RadioControlCapabilities extends RPCStruct{
public static final String KEY_STATE_AVAILABLE= "stateAvailable";
public static final String KEY_SIGNAL_STRENGTH_AVAILABLE= "signalStrengthAvailable";
public static final String KEY_SIGNAL_CHANGE_THRESHOLD_AVAILABLE= "signalChangeThresholdAvailable";
+ public static final String KEY_SIS_DATA_AVAILABLE = "sisDataAvailable";
public RadioControlCapabilities() {
}
@@ -245,4 +246,24 @@ public class RadioControlCapabilities extends RPCStruct{
public Boolean getSignalChangeThresholdAvailable() {
return getBoolean(KEY_SIGNAL_CHANGE_THRESHOLD_AVAILABLE);
}
+
+ /**
+ * Sets the sisDataAvailable portion of the RadioControlCapabilities class
+ *
+ * @param sisDataAvailable Availability of the getting HD radio Station Information Service (SIS) data.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public void setSisDataAvailable(Boolean sisDataAvailable) {
+ setValue(KEY_SIS_DATA_AVAILABLE, sisDataAvailable);
+ }
+
+ /**
+ * Gets the sisDataAvailable portion of the RadioControlCapabilities class
+ *
+ * @return Boolean - Availability of the getting HD radio Station Information Service (SIS) data.
+ * True: Available, False: Not Available, Not present: Not Available.
+ */
+ public Boolean getSisDataAvailable() {
+ return getBoolean(KEY_SIS_DATA_AVAILABLE);
+ }
}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RadioControlData.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RadioControlData.java
index 4744399ac..6a34d27aa 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RadioControlData.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RadioControlData.java
@@ -20,6 +20,7 @@ public class RadioControlData extends RPCStruct{
public static final String KEY_SIGNAL_CHANGE_THRESHOLD= "signalChangeThreshold";
public static final String KEY_RADIO_ENABLE= "radioEnable";
public static final String KEY_STATE= "state";
+ public static final String KEY_SIS_DATA = "sisData";
public RadioControlData() {
}
@@ -220,4 +221,22 @@ public class RadioControlData extends RPCStruct{
public RadioState getState() {
return (RadioState) getObject(RadioState.class, KEY_STATE);
}
+
+ /**
+ * Sets the sisData portion of the RadioControlData class
+ *
+ * @param sisData Read-only Station Information Service (SIS) data provides basic information about the station such as call sign, as well as information not displayable to the consumer such as the station identification number.
+ */
+ public void setSisData(SisData sisData) {
+ setValue(KEY_SIS_DATA, sisData);
+ }
+
+ /**
+ * Gets the sisData portion of the RadioControlData class
+ *
+ * @return SisData - Read-only Station Information Service (SIS) data provides basic information about the station such as call sign, as well as information not displayable to the consumer such as the station identification number.
+ */
+ public SisData getSisData() {
+ return (SisData) getObject(SisData.class, KEY_SIS_DATA);
+ }
}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterface.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterface.java
index e52498874..19b7059b8 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterface.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterface.java
@@ -6,6 +6,7 @@ import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCRequest;
import com.smartdevicelink.proxy.rpc.enums.AppHMIType;
import com.smartdevicelink.proxy.rpc.enums.Language;
+import com.smartdevicelink.util.Version;
import java.util.Hashtable;
import java.util.List;
@@ -182,7 +183,14 @@ import java.util.List;
* <td>Maxlength: 100</td>
* <td>SmartDeviceLink 2.0 </td>
* </tr>
- *
+ * <tr>
+ * <td>fullAppID</td>
+ * <td>String</td>
+ * <td>ID used to validate app with policy table entries</td>
+ * <td>N</td>
+ * <td>Maxlength: 100</td>
+ * <td>SmartDeviceLink 4.6</td>
+ * </tr>
* <tr>
* <td>hmiCapabilities</td>
* <td>HMICapabilities</td>
@@ -238,6 +246,7 @@ public class RegisterAppInterface extends RPCRequest {
public static final String KEY_HMI_DISPLAY_LANGUAGE_DESIRED = "hmiDisplayLanguageDesired";
public static final String KEY_APP_HMI_TYPE = "appHMIType";
public static final String KEY_APP_ID = "appID";
+ public static final String KEY_FULL_APP_ID = "fullAppID";
public static final String KEY_LANGUAGE_DESIRED = "languageDesired";
public static final String KEY_DEVICE_INFO = "deviceInfo";
public static final String KEY_APP_NAME = "appName";
@@ -248,6 +257,7 @@ public class RegisterAppInterface extends RPCRequest {
public static final String KEY_HASH_ID = "hashID";
public static final String KEY_DAY_COLOR_SCHEME = "dayColorScheme";
public static final String KEY_NIGHT_COLOR_SCHEME = "nightColorScheme";
+ private static final int APP_ID_MAX_LENGTH = 10;
/**
* Constructs a new RegisterAppInterface object
@@ -291,18 +301,18 @@ public class RegisterAppInterface extends RPCRequest {
* @param isMediaApplication a Boolean value
* @param languageDesired a Language Enumeration
* @param hmiDisplayLanguageDesired
- * @param appID a String value representing a unique ID, which an app will be given when approved <br>
+ * @param fullAppID a String value representing a unique ID, which an app will be given when approved <br>
* <b>Notes: </b>Maxlength = 100
*/
public RegisterAppInterface(@NonNull SdlMsgVersion syncMsgVersion, @NonNull String appName, @NonNull Boolean isMediaApplication,
- @NonNull Language languageDesired, @NonNull Language hmiDisplayLanguageDesired, @NonNull String appID) {
+ @NonNull Language languageDesired, @NonNull Language hmiDisplayLanguageDesired, @NonNull String fullAppID) {
this();
setSdlMsgVersion(syncMsgVersion);
setAppName(appName);
setIsMediaApplication(isMediaApplication);
setLanguageDesired(languageDesired);
setHmiDisplayLanguageDesired(hmiDisplayLanguageDesired);
- setAppID(appID);
+ setFullAppID(fullAppID);
}
/**
* Gets the version of the SDL&reg; SmartDeviceLink interface
@@ -573,22 +583,22 @@ public class RegisterAppInterface extends RPCRequest {
public void setHashID(String hashID) {
setParameters(KEY_HASH_ID, hashID);
- }
-
+ }
+
/**
* Gets the unique ID, which an app will be given when approved
- *
+ *
* @return String - a String value representing the unique ID, which an app
* will be given when approved
* @since SmartDeviceLink 2.0
*/
- public String getAppID() {
- return getString(KEY_APP_ID);
- }
+ public String getAppID() {
+ return getString(KEY_APP_ID);
+ }
/**
* Sets a unique ID, which an app will be given when approved
- *
+ *
* @param appID
* a String value representing a unique ID, which an app will be
* given when approved
@@ -596,9 +606,60 @@ public class RegisterAppInterface extends RPCRequest {
* <b>Notes: </b>Maxlength = 100
* @since SmartDeviceLink 2.0
*/
- public void setAppID(@NonNull String appID) {
- setParameters(KEY_APP_ID, appID);
- }
+ public void setAppID(@NonNull String appID) {
+ if (appID != null) {
+ setParameters(KEY_APP_ID, appID.toLowerCase());
+ } else {
+ setParameters(KEY_APP_ID, appID);
+ }
+ }
+
+ /**
+ * Gets the unique ID, which an app will be given when approved
+ *
+ * @return String - a String value representing the unique ID, which an app
+ * will be given when approved
+ * @since SmartDeviceLink 4.6
+ */
+ public String getFullAppID() {
+ return getString(KEY_FULL_APP_ID);
+ }
+
+ /**
+ * Sets a unique ID, which an app will be given when approved <br>
+ * Note: this will automatically parse the fullAppID into the smaller appId and set the appId value as well
+ * @param fullAppID
+ * a String value representing a unique ID, which an app will be
+ * given when approved
+ * <p></p>
+ * <b>Notes: </b>Maxlength = 100
+ * @since SmartDeviceLink 4.6
+ */
+ public void setFullAppID(String fullAppID) {
+ if (fullAppID != null) {
+ fullAppID = fullAppID.toLowerCase();
+ setParameters(KEY_FULL_APP_ID, fullAppID);
+ String appID;
+ if (fullAppID.length() <= APP_ID_MAX_LENGTH) {
+ appID = fullAppID;
+ } else {
+ appID = fullAppID.replace("-", "").substring(0, APP_ID_MAX_LENGTH);
+ }
+ setAppID(appID);
+ } else {
+ setParameters(KEY_FULL_APP_ID, null);
+ }
+ }
+
+ @Override
+ public void format(Version rpcVersion, boolean formatParams) {
+ if(rpcVersion == null || rpcVersion.getMajor() >= 5) {
+ if (getFullAppID() == null) {
+ setFullAppID(getAppID());
+ }
+ }
+ super.format(rpcVersion, formatParams);
+ }
/**
* Gets the color scheme that is currently used for day
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterfaceResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterfaceResponse.java
index d77678662..13ecd9c75 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterfaceResponse.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterfaceResponse.java
@@ -77,6 +77,17 @@ public class RegisterAppInterfaceResponse extends RPCResponse {
setSuccess(success);
setResultCode(resultCode);
}
+
+ @Override
+ public void format(com.smartdevicelink.util.Version rpcVersion, boolean formatParams){
+ //Add in 5.0.0 of the rpc spec
+ if(getIconResumed() == null){
+ setIconResumed(Boolean.FALSE);
+ }
+
+ super.format(rpcVersion,formatParams);
+ }
+
@SuppressWarnings("unchecked")
public SdlMsgVersion getSdlMsgVersion() {
return (SdlMsgVersion) getObject(SdlMsgVersion.class, KEY_SDL_MSG_VERSION);
@@ -380,11 +391,22 @@ public class RegisterAppInterfaceResponse extends RPCResponse {
return getString(KEY_SYSTEM_SOFTWARE_VERSION);
}
- public void setIconResumed(Boolean iconResumed){
- setParameters(KEY_ICON_RESUMED, iconResumed);
- }
+ /**
+ * Sets Icon Resumed Boolean
+ * @param iconResumed - if param not included, set to false
+ */
+ public void setIconResumed(Boolean iconResumed){
+ if(iconResumed == null){
+ iconResumed = false;
+ }
+ setParameters(KEY_ICON_RESUMED, iconResumed);
+ }
- public Boolean getIconResumed() {
- return getBoolean(KEY_ICON_RESUMED);
- }
+ /**
+ * Tells developer whether or not their app icon has been resumed on core.
+ * @return boolean - true if icon was resumed, false if not
+ */
+ public Boolean getIconResumed() {
+ return getBoolean(KEY_ICON_RESUMED);
+ }
}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RemoteControlCapabilities.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RemoteControlCapabilities.java
index 8a2106f6e..4c9861101 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RemoteControlCapabilities.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/RemoteControlCapabilities.java
@@ -10,6 +10,9 @@ public class RemoteControlCapabilities extends RPCStruct {
public static final String KEY_RADIO_CONTROL_CAPABILITIES = "radioControlCapabilities";
public static final String KEY_BUTTON_CAPABILITIES = "buttonCapabilities";
public static final String KEY_SEAT_CONTROL_CAPABILITIES = "seatControlCapabilities";
+ public static final String KEY_AUDIO_CONTROL_CAPABILITIES = "audioControlCapabilities";
+ public static final String KEY_HMI_SETTINGS_CONTROL_CAPABILITIES = "hmiSettingsControlCapabilities";
+ public static final String KEY_LIGHT_CONTROL_CAPABILITIES = "lightControlCapabilities";
public RemoteControlCapabilities() {
}
@@ -97,4 +100,59 @@ public class RemoteControlCapabilities extends RPCStruct {
public List<SeatControlCapabilities> getSeatControlCapabilities() {
return (List<SeatControlCapabilities>) getObject(SeatControlCapabilities.class, KEY_SEAT_CONTROL_CAPABILITIES);
}
+
+ /**
+ * Sets the audioControlCapabilities portion of the RemoteControlCapabilities class
+ *
+ * @param audioControlCapabilities If included, the platform supports audio controls.
+ */
+ public void setAudioControlCapabilities(List<AudioControlCapabilities> audioControlCapabilities) {
+ setValue(KEY_AUDIO_CONTROL_CAPABILITIES, audioControlCapabilities);
+ }
+
+ /**
+ * Gets the audioControlCapabilities portion of the RemoteControlCapabilities class
+ *
+ * @return List<AudioControlCapabilities>
+ * If included, the platform supports audio controls.
+ */
+ public List<AudioControlCapabilities> getAudioControlCapabilities() {
+ return (List<AudioControlCapabilities>) getObject(AudioControlCapabilities.class, KEY_AUDIO_CONTROL_CAPABILITIES);
+ }
+
+ /**
+ * Sets the hmiSettingsControlCapabilities portion of the RemoteControlCapabilities class
+ *
+ * @param hmiSettingsControlCapabilities If included, the platform supports hmi setting controls.
+ */
+ public void setHmiSettingsControlCapabilities(HMISettingsControlCapabilities hmiSettingsControlCapabilities) {
+ setValue(KEY_HMI_SETTINGS_CONTROL_CAPABILITIES, hmiSettingsControlCapabilities);
+ }
+
+ /**
+ * Gets the hmiSettingsControlCapabilities portion of the RemoteControlCapabilities class
+ *
+ * @return HMISettingsControlCapabilities - If included, the platform supports hmi setting controls.
+ */
+ public HMISettingsControlCapabilities getHmiSettingsControlCapabilities() {
+ return (HMISettingsControlCapabilities) getObject(HMISettingsControlCapabilities.class, KEY_HMI_SETTINGS_CONTROL_CAPABILITIES);
+ }
+
+ /**
+ * Sets the lightControlCapabilities portion of the RemoteControlCapabilities class
+ *
+ * @param lightControlCapabilities If included, the platform supports light controls.
+ */
+ public void setLightControlCapabilities(LightControlCapabilities lightControlCapabilities) {
+ setValue(KEY_LIGHT_CONTROL_CAPABILITIES, lightControlCapabilities);
+ }
+
+ /**
+ * Gets the lightControlCapabilities portion of the RemoteControlCapabilities class
+ *
+ * @return LightControlCapabilities - If included, the platform supports light controls.
+ */
+ public LightControlCapabilities getLightControlCapabilities() {
+ return (LightControlCapabilities) getObject(LightControlCapabilities.class, KEY_LIGHT_CONTROL_CAPABILITIES);
+ }
}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SdlMsgVersion.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SdlMsgVersion.java
index 128d2050f..3e1637e22 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SdlMsgVersion.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SdlMsgVersion.java
@@ -74,7 +74,17 @@ public class SdlMsgVersion extends RPCStruct {
this();
setMajorVersion(majorVersion);
setMinorVersion(minorVersion);
+
+ }
+
+ @Override
+ public void format(com.smartdevicelink.util.Version rpcVersion, boolean formatParams) {
+ if(getPatchVersion() == null){
+ setPatchVersion(0);
+ }
+ super.format(rpcVersion,formatParams);
}
+
public Integer getMajorVersion() {
return getInteger( KEY_MAJOR_VERSION );
}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SisData.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SisData.java
new file mode 100644
index 000000000..13b30e37d
--- /dev/null
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SisData.java
@@ -0,0 +1,123 @@
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+
+public class SisData extends RPCStruct {
+ public static final String KEY_STATION_SHORT_NAME = "stationShortName";
+ public static final String KEY_STATION_ID_NUMBER = "stationIDNumber";
+ public static final String KEY_STATION_LONG_NAME = "stationLongName";
+ public static final String KEY_STATION_LOCATION = "stationLocation";
+ public static final String KEY_STATION_MESSAGE = "stationMessage";
+
+ /**
+ * Constructs a new SisData object
+ */
+ public SisData() {
+ }
+
+ /**
+ * <p>Constructs a new SisData object indicated by the Hashtable parameter
+ * </p>
+ *
+ * @param hash The Hashtable to use
+ */
+ public SisData(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Sets the stationShortName portion of the SisData class
+ *
+ * @param stationShortName Identifies the 4-alpha-character station call sign plus an optional (-FM) extension.
+ */
+ public void setStationShortName(String stationShortName) {
+ setValue(KEY_STATION_SHORT_NAME, stationShortName);
+ }
+
+ /**
+ * Gets the stationShortName portion of the SisData class
+ *
+ * @return String - Identifies the 4-alpha-character station call sign plus an optional (-FM) extension.
+ */
+ public String getStationShortName() {
+ return getString(KEY_STATION_SHORT_NAME);
+ }
+
+ /**
+ * Sets the stationIDNumber portion of the SisData class
+ *
+ * @param stationIDNumber
+ */
+ public void setStationIDNumber(StationIDNumber stationIDNumber) {
+ setValue(KEY_STATION_ID_NUMBER, stationIDNumber);
+ }
+
+ /**
+ * Gets the stationIDNumber portion of the SisData class
+ *
+ * @return StationIDNumber.
+ */
+ @SuppressWarnings("unchecked")
+ public StationIDNumber getStationIDNumber() {
+ return (StationIDNumber) getObject(StationIDNumber.class, KEY_STATION_ID_NUMBER);
+ }
+
+ /**
+ * Sets the stationLongName portion of the SisData class
+ *
+ * @param stationLongName Identifies the station call sign or other identifying information in the long format.
+ */
+ public void setStationLongName(String stationLongName) {
+ setValue(KEY_STATION_LONG_NAME, stationLongName);
+ }
+
+ /**
+ * Gets the stationLongName portion of the SisData class
+ *
+ * @return String - Identifies the station call sign or other identifying information in the long format.
+ */
+ public String getStationLongName() {
+ return getString(KEY_STATION_LONG_NAME);
+ }
+
+ /**
+ * Sets the stationLocation portion of the SisData class
+ *
+ * @param stationLocation Provides the 3-dimensional geographic station location.
+ */
+ public void setStationLocation(GPSData stationLocation) {
+ setValue(KEY_STATION_LOCATION, stationLocation);
+ }
+
+ /**
+ * Gets the stationLocation portion of the SisData class
+ *
+ * @return GPSData - Provides the 3-dimensional geographic station location.
+ */
+ @SuppressWarnings("unchecked")
+ public GPSData getStationLocation() {
+ return (GPSData) getObject(GPSData.class, KEY_STATION_LOCATION);
+ }
+
+ /**
+ * Sets the stationMessage portion of the SisData class
+ *
+ * @param stationMessage May be used to convey textual information of general interest to the consumer such as weather forecasts or public service announcements.
+ * Includes a high priority delivery feature to convey emergencies that may be in the listening area.
+ */
+ public void setStationMessage(String stationMessage) {
+ setValue(KEY_STATION_MESSAGE, stationMessage);
+ }
+
+ /**
+ * Gets the stationMessage portion of the SisData class
+ *
+ * @return String - May be used to convey textual information of general interest to the consumer such as weather forecasts or public service announcements.
+ * Includes a high priority delivery feature to convey emergencies that may be in the listening area.
+ */
+ public String getStationMessage() {
+ return getString(KEY_STATION_MESSAGE);
+ }
+}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/StationIDNumber.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/StationIDNumber.java
new file mode 100644
index 000000000..a8e926a2b
--- /dev/null
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/StationIDNumber.java
@@ -0,0 +1,54 @@
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+
+public class StationIDNumber extends RPCStruct {
+ public static final String KEY_COUNTRY_CODE = "countryCode";
+ public static final String KEY_FCC_FACILITY_ID = "fccFacilityId";
+
+ public StationIDNumber() {
+ }
+
+ public StationIDNumber(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Sets the countryCode portion of the StationIDNumber class
+ *
+ * @param countryCode Binary Representation of ITU Country Code. USA Code is 001.
+ */
+ public void setCountryCode(Integer countryCode) {
+ setValue(KEY_COUNTRY_CODE, countryCode);
+ }
+
+ /**
+ * Gets the countryCode portion of the StationIDNumber class
+ *
+ * @return Integer - Binary Representation of ITU Country Code. USA Code is 001.
+ */
+ public Integer getCountryCode() {
+ return getInteger(KEY_COUNTRY_CODE);
+ }
+
+ /**
+ * Sets the fccFacilityId portion of the StationIDNumber class
+ *
+ * @param fccFacilityId Binary representation of unique facility ID assigned by the FCC; FCC controlled for U.S. territory.
+ */
+ public void setFccFacilityId(Integer fccFacilityId) {
+ setValue(KEY_FCC_FACILITY_ID, fccFacilityId);
+ }
+
+ /**
+ * Gets the fccFacilityId portion of the StationIDNumber class
+ *
+ * @return Integer - Binary representation of unique facility ID assigned by the FCC; FCC controlled for U.S. territory.
+ */
+ public Integer getFccFacilityId() {
+ return getInteger(KEY_FCC_FACILITY_ID);
+ }
+
+}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/DisplayMode.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/DisplayMode.java
new file mode 100644
index 000000000..5a0c0c7e4
--- /dev/null
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/DisplayMode.java
@@ -0,0 +1,16 @@
+package com.smartdevicelink.proxy.rpc.enums;
+
+public enum DisplayMode {
+ DAY,
+ NIGHT,
+ AUTO,
+ ;
+
+ public static DisplayMode valueForString(String value) {
+ try {
+ return valueOf(value);
+ } catch (Exception e) {
+ return null;
+ }
+ }
+}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/DistanceUnit.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/DistanceUnit.java
new file mode 100644
index 000000000..36e103bf3
--- /dev/null
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/DistanceUnit.java
@@ -0,0 +1,15 @@
+package com.smartdevicelink.proxy.rpc.enums;
+
+public enum DistanceUnit {
+ MILES,
+ KILOMETERS,
+ ;
+
+ public static DistanceUnit valueForString(String value) {
+ try {
+ return valueOf(value);
+ } catch (Exception e) {
+ return null;
+ }
+ }
+}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/LightName.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/LightName.java
new file mode 100644
index 000000000..c3812f2da
--- /dev/null
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/LightName.java
@@ -0,0 +1,134 @@
+package com.smartdevicelink.proxy.rpc.enums;
+
+public enum LightName {
+ /*Common Single Light*/
+ FRONT_LEFT_HIGH_BEAM,
+ FRONT_RIGHT_HIGH_BEAM,
+ FRONT_LEFT_LOW_BEAM,
+ FRONT_RIGHT_LOW_BEAM,
+ FRONT_LEFT_PARKING_LIGHT,
+ FRONT_RIGHT_PARKING_LIGHT,
+ FRONT_LEFT_FOG_LIGHT,
+ FRONT_RIGHT_FOG_LIGHT,
+ FRONT_LEFT_DAYTIME_RUNNING_LIGHT,
+ FRONT_RIGHT_DAYTIME_RUNNING_LIGHT,
+ FRONT_LEFT_TURN_LIGHT,
+ FRONT_RIGHT_TURN_LIGHT,
+ REAR_LEFT_FOG_LIGHT,
+ REAR_RIGHT_FOG_LIGHT,
+ REAR_LEFT_TAIL_LIGHT,
+ REAR_RIGHT_TAIL_LIGHT,
+ REAR_LEFT_BRAKE_LIGHT,
+ REAR_RIGHT_BRAKE_LIGHT,
+ REAR_LEFT_TURN_LIGHT,
+ REAR_RIGHT_TURN_LIGHT,
+ REAR_REGISTRATION_PLATE_LIGHT,
+
+ /**
+ * Include all high beam lights: front_left and front_right.
+ */
+ HIGH_BEAMS,
+ /**
+ * Include all low beam lights: front_left and front_right.
+ */
+ LOW_BEAMS,
+ /**
+ * Include all fog lights: front_left, front_right, rear_left and rear_right.
+ */
+ FOG_LIGHTS,
+ /**
+ * Include all daytime running lights: front_left and front_right.
+ */
+ RUNNING_LIGHTS,
+ /**
+ * Include all parking lights: front_left and front_right.
+ */
+ PARKING_LIGHTS,
+ /**
+ * Include all brake lights: rear_left and rear_right.
+ */
+ BRAKE_LIGHTS,
+ REAR_REVERSING_LIGHTS,
+ SIDE_MARKER_LIGHTS,
+
+ /**
+ * Include all left turn signal lights: front_left, rear_left, left_side and mirror_mounted.
+ */
+ LEFT_TURN_LIGHTS,
+ /**
+ * Include all right turn signal lights: front_right, rear_right, right_side and mirror_mounted.
+ */
+ RIGHT_TURN_LIGHTS,
+ /**
+ * Include all hazard lights: front_left, front_right, rear_left and rear_right.
+ */
+ HAZARD_LIGHTS,
+ /**
+ * Cargo lamps illuminate the cargo area.
+ */
+ REAR_CARGO_LIGHTS,
+ /**
+ * Truck bed lamps light up the bed of the truck.
+ */
+ REAR_TRUCK_BED_LIGHTS,
+ /**
+ * Trailer lights are lamps mounted on a trailer hitch.
+ */
+ REAR_TRAILER_LIGHTS,
+ /**
+ * It is the spotlights mounted on the left side of a vehicle.
+ */
+ LEFT_SPOT_LIGHTS,
+ /**
+ * It is the spotlights mounted on the right side of a vehicle.
+ */
+ RIGHT_SPOT_LIGHTS,
+ /**
+ * Puddle lamps illuminate the ground beside the door as the customer is opening or approaching the door.
+ */
+ LEFT_PUDDLE_LIGHTS,
+ /**
+ * Puddle lamps illuminate the ground beside the door as the customer is opening or approaching the door.
+ */
+ RIGHT_PUDDLE_LIGHTS,
+
+ /*Interior Lights by common function groups*/
+
+ AMBIENT_LIGHTS,
+ OVERHEAD_LIGHTS,
+ READING_LIGHTS,
+ TRUNK_LIGHTS,
+
+
+ /*Lights by location*/
+
+ /**
+ * Include exterior lights located in front of the vehicle. For example, fog lights and low beams.
+ */
+ EXTERIOR_FRONT_LIGHTS,
+ /**
+ * Include exterior lights located at the back of the vehicle. For example, license plate lights, reverse lights, cargo lights, bed lights an trailer assist lights.
+ */
+ EXTERIOR_REAR_LIGHTS,
+ /**
+ * Include exterior lights located at the left side of the vehicle. For example, left puddle lights and spot lights.
+ */
+ EXTERIOR_LEFT_LIGHTS,
+ /**
+ * Include exterior lights located at the right side of the vehicle. For example, right puddle lights and spot lights.
+ */
+ EXTERIOR_RIGHT_LIGHTS,
+ /**
+ * Include all exterior lights around the vehicle.
+ */
+ EXTERIOR_ALL_LIGHTS,
+ ;
+
+ public static LightName valueForString(String value) {
+ try {
+ return valueOf(value);
+ } catch (Exception e) {
+ return null;
+ }
+ }
+}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/LightStatus.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/LightStatus.java
new file mode 100644
index 000000000..98c4b175c
--- /dev/null
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/LightStatus.java
@@ -0,0 +1,19 @@
+package com.smartdevicelink.proxy.rpc.enums;
+
+public enum LightStatus {
+ ON,
+ OFF,
+ RAMP_UP,
+ RAMP_DOWN,
+ UNKNOWN,
+ INVALID,
+ ;
+
+ public static LightStatus valueForString(String value) {
+ try {
+ return valueOf(value);
+ } catch (Exception e) {
+ return null;
+ }
+ }
+}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/ModuleType.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/ModuleType.java
index 5eaf6366e..c4bedfd46 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/ModuleType.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/ModuleType.java
@@ -4,6 +4,9 @@ public enum ModuleType {
CLIMATE,
RADIO,
SEAT,
+ AUDIO,
+ LIGHT,
+ HMI_SETTINGS,
;
public static ModuleType valueForString(String value) {
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/PredefinedLayout.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/PredefinedLayout.java
new file mode 100644
index 000000000..458320d1e
--- /dev/null
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/PredefinedLayout.java
@@ -0,0 +1,140 @@
+package com.smartdevicelink.proxy.rpc.enums;
+
+import java.util.EnumSet;
+
+/**
+ A template layout an app uses to display information. The broad details of the layout are defined, but the details depend on the IVI system. Used in SetDisplayLayout.
+ */
+public enum PredefinedLayout {
+
+ /**
+ A default layout
+ */
+ DEFAULT("DEFAULT"),
+
+ /**
+ The default media layout
+ */
+ MEDIA("MEDIA"),
+
+ /**
+ The default non-media layout
+ */
+ NON_MEDIA("NON-MEDIA"),
+
+ /**
+ A media layout containing preset buttons
+ */
+ ONSCREEN_PRESETS("ONSCREEN_PRESETS"),
+
+ /**
+ The default navigation layout with a fullscreen map
+ */
+ NAV_FULLSCREEN_MAP("NAV_FULLSCREEN_MAP"),
+
+ /**
+ A list layout used for navigation apps
+ */
+ NAV_LIST("NAV_LIST"),
+
+ /**
+ A keyboard layout used for navigation apps
+ */
+ NAV_KEYBOARD("NAV_KEYBOARD"),
+
+ /**
+ A layout with a single graphic on the left and text on the right
+ */
+ GRAPHIC_WITH_TEXT("GRAPHIC_WITH_TEXT"),
+
+ /**
+ A layout with text on the left and a single graphic on the right
+ */
+ TEXT_WITH_GRAPHIC("TEXT_WITH_GRAPHIC"),
+
+ /**
+ A layout with only softbuttons placed in a tile layout
+ */
+ TILES_ONLY("TILES_ONLY"),
+
+ /**
+ A layout with only soft buttons that only accept text
+ */
+ TEXTBUTTONS_ONLY("TEXTBUTTONS_ONLY"),
+
+ /**
+ A layout with a single graphic on the left and soft buttons in a tile layout on the right
+ */
+ GRAPHIC_WITH_TILES("GRAPHIC_WITH_TILES"),
+
+ /**
+ A layout with soft buttons in a tile layout on the left and a single graphic on the right
+ */
+ TILES_WITH_GRAPHIC("TILES_WITH_GRAPHIC"),
+
+ /**
+ A layout with a single graphic on the left and both text and soft buttons on the right
+ */
+ GRAPHIC_WITH_TEXT_AND_SOFTBUTTONS("GRAPHIC_WITH_TEXT_AND_SOFTBUTTONS"),
+
+ /**
+ A layout with both text and soft buttons on the left and a single graphic on the right
+ */
+ TEXT_AND_SOFTBUTTONS_WITH_GRAPHIC("TEXT_AND_SOFTBUTTONS_WITH_GRAPHIC"),
+
+ /**
+ A layout with a single graphic on the left and text-only soft buttons on the right
+ */
+ GRAPHIC_WITH_TEXTBUTTONS("GRAPHIC_WITH_TEXTBUTTONS"),
+
+ /**
+ A layout with text-only soft buttons on the left and a single graphic on the right
+ */
+ TEXTBUTTONS_WITH_GRAPHIC("TEXTBUTTONS_WITH_GRAPHIC"),
+
+ /**
+ A layout with a single large graphic and soft buttons
+ */
+ LARGE_GRAPHIC_WITH_SOFTBUTTONS("LARGE_GRAPHIC_WITH_SOFTBUTTONS"),
+
+ /**
+ A layout with two graphics and soft buttons
+ */
+ DOUBLE_GRAPHIC_WITH_SOFTBUTTONS("DOUBLE_GRAPHIC_WITH_SOFTBUTTONS"),
+
+ /**
+ A layout with only a single large graphic
+ */
+ LARGE_GRAPHIC_ONLY("LARGE_GRAPHIC_ONLY"),
+ ;
+
+ private final String INTERNAL_NAME;
+
+ private PredefinedLayout(String internalName) {
+ this.INTERNAL_NAME = internalName;
+ }
+ /**
+ * Returns a String representing a PredefinedLayout
+ */
+ public String toString() {
+ return this.INTERNAL_NAME;
+ }
+
+ /**
+ * Returns a PredefinedLayout
+ * @param value a String
+ * @return PredefinedLayout
+ */
+ public static PredefinedLayout valueForString(String value) {
+ if(value == null){
+ return null;
+ }
+
+ for (PredefinedLayout anEnum : EnumSet.allOf(PredefinedLayout.class)) {
+ if (anEnum.toString().equals(value)) {
+ return anEnum;
+ }
+ }
+ return null;
+ }
+}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/PrimaryAudioSource.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/PrimaryAudioSource.java
index b06045d1a..27f83d7d4 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/PrimaryAudioSource.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/PrimaryAudioSource.java
@@ -5,11 +5,15 @@ package com.smartdevicelink.proxy.rpc.enums;
* @since SmartDeviceLink 2.0
*/
public enum PrimaryAudioSource {
- /**
- * Currently no source selected
- */
+ /**
+ * Currently no source selected
+ */
NO_SOURCE_SELECTED,
/**
+ * CD is current source
+ */
+ CD,
+ /**
* USB is current source
*/
USB,
@@ -32,18 +36,23 @@ public enum PrimaryAudioSource {
/**
* Mobile app is current source
*/
- MOBILE_APP;
+ MOBILE_APP,
+ AM,
+ FM,
+ XM,
+ DAB,
+ ;
/**
* Convert String to PrimaryAudioSource
* @param value String
* @return PrimaryAudioSource
- */
+ */
public static PrimaryAudioSource valueForString(String value) {
- try{
- return valueOf(value);
- }catch(Exception e){
- return null;
- }
+ try{
+ return valueOf(value);
+ }catch(Exception e){
+ return null;
+ }
}
}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/StaticIconName.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/StaticIconName.java
new file mode 100644
index 000000000..455995ff3
--- /dev/null
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/enums/StaticIconName.java
@@ -0,0 +1,910 @@
+package com.smartdevicelink.proxy.rpc.enums;
+
+/**
+ * Enumeration of Static Icon Names
+ */
+public enum StaticIconName {
+
+ /**
+ * Icon Name accept call / active phone call in progress / initiate a phone call
+ */
+ ACCEPT_CALL("0x29"),
+
+ /**
+ * Icon Name add waypoint
+ */
+ ADD_WAYPOINT("0x1B"),
+
+ /**
+ * Icon Name album
+ */
+ ALBUM("0x21"),
+
+ /**
+ * Icon Name ambient lighting
+ */
+ AMBIENT_LIGHTING("0x3d"),
+
+ /**
+ * Icon Name arrow - north
+ */
+ ARROW_NORTH("0x40"),
+
+ /**
+ * Icon Name audio mute
+ */
+ AUDIO_MUTE("0x12"),
+
+ /**
+ * Icon Name audiobook episode
+ */
+ AUDIOBOOK_EPISODE("0x83"),
+
+ /**
+ * Icon Name audiobook narrator
+ */
+ AUDIOBOOK_NARRATOR("0x82"),
+
+ /**
+ * Icon Name auxillary audio
+ */
+ AUXILLARY_AUDIO("0x45"),
+
+ /**
+ * Icon Name back / return
+ */
+ BACK("0x86"),
+
+ /**
+ * Icon Name battery capacity 0 of 5
+ */
+ BATTERY_CAPACITY_0_OF_5("0xF7"),
+
+ /**
+ * Icon Name battery capacity 1 of 5
+ */
+ BATTERY_CAPACITY_1_OF_5("0xF8"),
+
+ /**
+ * Icon Name battery capacity 2 of 5
+ */
+ BATTERY_CAPACITY_2_OF_5("0xF9"),
+
+ /**
+ * Icon Name battery capacity 3 of 5
+ */
+ BATTERY_CAPACITY_3_OF_5("0xFA"),
+
+ /**
+ * Icon Name battery capacity 4 of 5
+ */
+ BATTERY_CAPACITY_4_OF_5("0xf6"),
+
+ /**
+ * Icon Name battery capacity 5 of 5
+ */
+ BATTERY_CAPACITY_5_OF_5("0xFB"),
+
+ /**
+ * Icon Name bluetooth audio source
+ */
+ BLUETOOTH_AUDIO_SOURCE("0x09"),
+
+ /**
+ * Icon Name bluetooth1
+ */
+ BLUETOOTH1("0xcc"),
+
+ /**
+ * Icon Name bluetooth2
+ */
+ BLUETOOTH2("0xCD"),
+
+ /**
+ * Icon Name browse
+ */
+ BROWSE("0x77"),
+
+ /**
+ * Icon Name cell phone in roaming mode
+ */
+ CELL_PHONE_IN_ROAMING_MODE("0x66"),
+
+ /**
+ * Icon Name cell service signal strength 0 of 5 bars
+ */
+ CELL_SERVICE_SIGNAL_STRENGTH_0_OF_5_BARS("0x67"),
+
+ /**
+ * Icon Name cell service signal strength 1 of 5 bars
+ */
+ CELL_SERVICE_SIGNAL_STRENGTH_1_OF_5_BARS("0x68"),
+
+ /**
+ * Icon Name cell service signal strength 2 of 5 bars
+ */
+ CELL_SERVICE_SIGNAL_STRENGTH_2_OF_5_BARS("0x69"),
+
+ /**
+ * Icon Name cell service signal strength 3 of 5 bars
+ */
+ CELL_SERVICE_SIGNAL_STRENGTH_3_OF_5_BARS("0x6A"),
+
+ /**
+ * Icon Name cell service signal strength 4 of 5 bars
+ */
+ CELL_SERVICE_SIGNAL_STRENGTH_4_OF_5_BARS("0x6B"),
+
+ /**
+ * Icon Name cell service signal strength 5 of 5 bars
+ */
+ CELL_SERVICE_SIGNAL_STRENGTH_5_OF_5_BARS("0xd3"),
+
+ /**
+ * Icon Name change lane left
+ */
+ CHANGE_LANE_LEFT("0xc3"),
+
+ /**
+ * Icon Name change lane right
+ */
+ CHANGE_LANE_RIGHT("0xc1"),
+
+ /**
+ * Icon Name check box checked
+ */
+ CHECK_BOX_CHECKED("0x27"),
+
+ /**
+ * Icon Name check box unchecked
+ */
+ CHECK_BOX_UNCHECKED("0x28"),
+
+ /**
+ * Icon Name climate
+ */
+ CLIMATE("0xd1"),
+
+ /**
+ * Icon Name clock
+ */
+ CLOCK("0xfc"),
+
+ /**
+ * Icon Name compose (e.g. message)
+ */
+ COMPOSE("0x1A"),
+
+ /**
+ * Icon Name contact / person
+ */
+ CONTACT("0x5C"),
+
+ /**
+ * Icon Name continue
+ */
+ CONTINUE("0x42"),
+
+ /**
+ * Icon Name dash / bullet point
+ */
+ DASH("0x7F"),
+
+ /**
+ * Icon Name date / calendar
+ */
+ DATE("0x87"),
+
+ /**
+ * Icon Name delete/remove - trash
+ */
+ DELETE("0x0F"),
+
+ /**
+ * Icon Name destination
+ */
+ DESTINATION("0x94"),
+
+ /**
+ * Icon Name destination ferry ahead
+ */
+ DESTINATION_FERRY_AHEAD("0x4D"),
+
+ /**
+ * Icon Name ebookmark (e.g. message, feed)
+ */
+ EBOOKMARK("0x2B"),
+
+ /**
+ * Icon Name end call / reject call
+ */
+ END_CALL("0x2C"),
+
+ /**
+ * Icon Name fail / X
+ */
+ FAIL("0xD6"),
+
+ /**
+ * Icon Name fast forward 30 secs
+ */
+ FAST_FORWARD_30_SECS("0x08"),
+
+ /**
+ * Icon Name favorite / heart
+ */
+ FAVORITE_HEART("0x0E"),
+
+ /**
+ * Icon Name favorite / star
+ */
+ FAVORITE_STAR("0x95"),
+
+ /**
+ * Icon Name fax number
+ */
+ FAX_NUMBER("0x80"),
+
+ /**
+ * Icon Name filename
+ */
+ FILENAME("0x50"),
+
+ /**
+ * Icon Name filter / search
+ */
+ FILTER("0x79"),
+
+ /**
+ * Icon Name folder
+ */
+ FOLDER("0x1C"),
+
+ /**
+ * Icon Name fuel prices
+ */
+ FUEL_PRICES("0xe9"),
+
+ /**
+ * Icon Name full map
+ */
+ FULL_MAP("0x0c"),
+
+ /**
+ * Icon Name generic phone number
+ */
+ GENERIC_PHONE_NUMBER("0x53"),
+
+ /**
+ * Icon Name genre
+ */
+ GENRE("0x4E"),
+
+ /**
+ * Icon Name global keyboard
+ */
+ GLOBAL_KEYBOARD("0xea"),
+
+ /**
+ * Icon Name highway exit information
+ */
+ HIGHWAY_EXIT_INFORMATION("0xf4"),
+
+ /**
+ * Icon Name home phone number
+ */
+ HOME_PHONE_NUMBER("0x55"),
+
+ /**
+ * Icon Name hyperlink
+ */
+ HYPERLINK("0x78"),
+
+ /**
+ * Icon Name ID3 tag unknown
+ */
+ ID3_TAG_UNKNOWN("0x51"),
+
+ /**
+ * Icon Name incoming calls (in list of phone calls)
+ */
+ INCOMING_CALLS("0x57"),
+
+ /**
+ * Icon Name information
+ */
+ INFORMATION("0x5d"),
+
+ /**
+ * Icon Name IPOD media source
+ */
+ IPOD_MEDIA_SOURCE("0x0D"),
+
+ /**
+ * Icon Name join calls
+ */
+ JOIN_CALLS("0x02"),
+
+ /**
+ * Icon Name keep left
+ */
+ KEEP_LEFT("0x46"),
+
+ /**
+ * Icon Name keep right
+ */
+ KEEP_RIGHT("0x48"),
+
+ /**
+ * Icon Name key / keycode
+ */
+ KEY("0x7D"),
+
+ /**
+ * Icon Name left
+ */
+ LEFT("0x9f"),
+
+ /**
+ * Icon Name left arrow / back
+ */
+ LEFT_ARROW("0x4B"),
+
+ /**
+ * Icon Name left exit
+ */
+ LEFT_EXIT("0xaf"),
+
+ /**
+ * Icon Name LINE IN audio source
+ */
+ LINE_IN_AUDIO_SOURCE("0x06"),
+
+ /**
+ * Icon Name locked
+ */
+ LOCKED("0x22"),
+
+ /**
+ * Icon Name media control - left arrow
+ */
+ MEDIA_CONTROL_LEFT_ARROW("0x17"),
+
+ /**
+ * Icon Name media control - recording
+ */
+ MEDIA_CONTROL_RECORDING("0x20"),
+
+ /**
+ * Icon Name media control - right arrow
+ */
+ MEDIA_CONTROL_RIGHT_ARROW("0x15"),
+
+ /**
+ * Icon Name media control - stop (e.g. streaming)
+ */
+ MEDIA_CONTROL_STOP("0x16"),
+
+ /**
+ * Icon Name microphone
+ */
+ MICROPHONE("0xe8"),
+
+ /**
+ * Icon Name missed calls (in list of phone calls)
+ */
+ MISSED_CALLS("0x58"),
+
+ /**
+ * Icon Name mobile phone number
+ */
+ MOBILE_PHONE_NUMBER("0x54"),
+
+ /**
+ * Icon Name move down / download
+ */
+ MOVE_DOWN("0xE5"),
+
+ /**
+ * Icon Name move up
+ */
+ MOVE_UP("0xe4"),
+
+ /**
+ * Icon Name MP3 tag artist
+ */
+ MP3_TAG_ARTIST("0x24"),
+
+ /**
+ * Icon Name navigation / navigation settings
+ */
+ NAVIGATION("0x8e"),
+
+ /**
+ * Icon Name navigation current direction
+ */
+ NAVIGATION_CURRENT_DIRECTION("0x0a"),
+
+ /**
+ * Icon Name negative rating - thumbs down
+ */
+ NEGATIVE_RATING_THUMBS_DOWN("0x14"),
+
+ /**
+ * Icon Name new/unread text message/email
+ */
+ NEW("0x5E"),
+
+ /**
+ * Icon Name office phone number / work phone number
+ */
+ OFFICE_PHONE_NUMBER("0x56"),
+
+ /**
+ * Icon Name opened/read text message/email
+ */
+ OPENED("0x5F"),
+
+ /**
+ * Icon Name origin / nearby locale / current position
+ */
+ ORIGIN("0x96"),
+
+ /**
+ * Icon Name outgoing calls (in list of phone calls)
+ */
+ OUTGOING_CALLS("0x59"),
+
+ /**
+ * Icon Name phone call 1
+ */
+ PHONE_CALL_1("0x1D"),
+
+ /**
+ * Icon Name phone call 2
+ */
+ PHONE_CALL_2("0x1E"),
+
+ /**
+ * Icon Name phone device
+ */
+ PHONE_DEVICE("0x03"),
+
+ /**
+ * Icon Name phonebook
+ */
+ PHONEBOOK("0x81"),
+
+ /**
+ * Icon Name photo / picture
+ */
+ PHOTO("0x88"),
+
+ /**
+ * Icon Name play / pause - pause active
+ */
+ PLAY("0xD0"),
+
+ /**
+ * Icon Name playlist
+ */
+ PLAYLIST("0x4F"),
+
+ /**
+ * Icon Name pop-up
+ */
+ POPUP("0x76"),
+
+ /**
+ * Icon Name positive rating - thumbs up
+ */
+ POSITIVE_RATING_THUMBS_UP("0x13"),
+
+ /**
+ * Icon Name power
+ */
+ POWER("0x5b"),
+
+ /**
+ * Icon Name primary phone (favorite)
+ */
+ PRIMARY_PHONE("0x1F"),
+
+ /**
+ * Icon Name radio button checked
+ */
+ RADIO_BUTTON_CHECKED("0x25"),
+
+ /**
+ * Icon Name radio button unchecked
+ */
+ RADIO_BUTTON_UNCHECKED("0x26"),
+
+ /**
+ * Icon Name recent calls / history
+ */
+ RECENT_CALLS("0xe7"),
+
+ /**
+ * Icon Name recent destinations
+ */
+ RECENT_DESTINATIONS("0xf2"),
+
+ /**
+ * Icon Name redo
+ */
+ REDO("0x19"),
+
+ /**
+ * Icon Name refresh
+ */
+ REFRESH("0x97"),
+
+ /**
+ * Icon Name remote diagnostics - check engine
+ */
+ REMOTE_DIAGNOSTICS_CHECK_ENGINE("0x7E"),
+
+ /**
+ * Icon Name rendered 911 assist / emergency assistance
+ */
+ RENDERED_911_ASSIST("0xac"),
+
+ /**
+ * Icon Name repeat
+ */
+ REPEAT("0xe6"),
+
+ /**
+ * Icon Name repeat play
+ */
+ REPEAT_PLAY("0x73"),
+
+ /**
+ * Icon Name reply
+ */
+ REPLY("0x04"),
+
+ /**
+ * Icon Name rewind 30 secs
+ */
+ REWIND_30_SECS("0x07"),
+
+ /**
+ * Icon Name right
+ */
+ RIGHT("0xa3"),
+
+ /**
+ * Icon Name right exit
+ */
+ RIGHT_EXIT("0xb1"),
+
+ /**
+ * Icon Name ringtones
+ */
+ RINGTONES("0x5A"),
+
+ /**
+ * Icon Name roundabout left hand 1
+ */
+ ROUNDABOUT_LEFT_HAND_1("0xee"),
+
+ /**
+ * Icon Name roundabout left hand 2
+ */
+ ROUNDABOUT_LEFT_HAND_2("0x8c"),
+
+ /**
+ * Icon Name roundabout left hand 3
+ */
+ ROUNDABOUT_LEFT_HAND_3("0x84"),
+
+ /**
+ * Icon Name roundabout left hand 4
+ */
+ ROUNDABOUT_LEFT_HAND_4("0x72"),
+
+ /**
+ * Icon Name roundabout left hand 5
+ */
+ ROUNDABOUT_LEFT_HAND_5("0x6e"),
+
+ /**
+ * Icon Name roundabout left hand 6
+ */
+ ROUNDABOUT_LEFT_HAND_6("0x64"),
+
+ /**
+ * Icon Name roundabout left hand 7
+ */
+ ROUNDABOUT_LEFT_HAND_7("0x60"),
+
+ /**
+ * Icon Name roundabout right hand 1
+ */
+ ROUNDABOUT_RIGHT_HAND_1("0x62"),
+
+ /**
+ * Icon Name roundabout right hand 2
+ */
+ ROUNDABOUT_RIGHT_HAND_2("0x6c"),
+
+ /**
+ * Icon Name roundabout right hand 3
+ */
+ ROUNDABOUT_RIGHT_HAND_3("0x70"),
+
+ /**
+ * Icon Name roundabout right hand 4
+ */
+ ROUNDABOUT_RIGHT_HAND_4("0x7a"),
+
+ /**
+ * Icon Name roundabout right hand 5
+ */
+ ROUNDABOUT_RIGHT_HAND_5("0x8a"),
+
+ /**
+ * Icon Name roundabout right hand 6
+ */
+ ROUNDABOUT_RIGHT_HAND_6("0xec"),
+
+ /**
+ * Icon Name roundabout right hand 7
+ */
+ ROUNDABOUT_RIGHT_HAND_7("0xf0"),
+
+ /**
+ * Icon Name RSS
+ */
+ RSS("0x89"),
+
+ /**
+ * Icon Name settings / menu
+ */
+ SETTINGS("0x49"),
+
+ /**
+ * Icon Name sharp left
+ */
+ SHARP_LEFT("0xa5"),
+
+ /**
+ * Icon Name sharp right
+ */
+ SHARP_RIGHT("0xa7"),
+
+ /**
+ * Icon Name show
+ */
+ SHOW("0xe1"),
+
+ /**
+ * Icon Name shuffle play
+ */
+ SHUFFLE_PLAY("0x74"),
+
+ /**
+ * Icon Name ski places / elevation / altitude
+ */
+ SKI_PLACES("0xab"),
+
+ /**
+ * Icon Name slight left
+ */
+ SLIGHT_LEFT("0x9d"),
+
+ /**
+ * Icon Name slight right
+ */
+ SLIGHT_RIGHT("0xa1"),
+
+ /**
+ * Icon Name smartphone
+ */
+ SMARTPHONE("0x05"),
+
+ /**
+ * Icon Name sort list
+ */
+ SORT_LIST("0x7B"),
+
+ /**
+ * Icon Name speed dial numbers - number 0
+ */
+ SPEED_DIAL_NUMBERS_NUMBER_0("0xE0"),
+
+ /**
+ * Icon Name speed dial numbers - number 1
+ */
+ SPEED_DIAL_NUMBERS_NUMBER_1("0xD7"),
+
+ /**
+ * Icon Name speed dial numbers - number 2
+ */
+ SPEED_DIAL_NUMBERS_NUMBER_2("0xD8"),
+
+ /**
+ * Icon Name speed dial numbers - number 3
+ */
+ SPEED_DIAL_NUMBERS_NUMBER_3("0xD9"),
+
+ /**
+ * Icon Name speed dial numbers - number 4
+ */
+ SPEED_DIAL_NUMBERS_NUMBER_4("0xDA"),
+
+ /**
+ * Icon Name speed dial numbers - number 5
+ */
+ SPEED_DIAL_NUMBERS_NUMBER_5("0xDB"),
+
+ /**
+ * Icon Name speed dial numbers - number 6
+ */
+ SPEED_DIAL_NUMBERS_NUMBER_6("0xDC"),
+
+ /**
+ * Icon Name speed dial numbers - number 7
+ */
+ SPEED_DIAL_NUMBERS_NUMBER_7("0xDD"),
+
+ /**
+ * Icon Name speed dial numbers - number 8
+ */
+ SPEED_DIAL_NUMBERS_NUMBER_8("0xDE"),
+
+ /**
+ * Icon Name speed dial numbers - number 9
+ */
+ SPEED_DIAL_NUMBERS_NUMBER_9("0xDF"),
+
+ /**
+ * Icon Name success / check
+ */
+ SUCCESS("0xD5"),
+
+ /**
+ * Icon Name track title / song title
+ */
+ TRACK_TITLE("0x4C"),
+
+ /**
+ * Icon Name traffic report
+ */
+ TRAFFIC_REPORT("0x2A"),
+
+ /**
+ * Icon Name turn list
+ */
+ TURN_LIST("0x10"),
+
+ /**
+ * Icon Name u-turn left traffic
+ */
+ UTURN_LEFT_TRAFFIC("0xad"),
+
+ /**
+ * Icon Name u-turn right traffic
+ */
+ UTURN_RIGHT_TRAFFIC("0xa9"),
+
+ /**
+ * Icon Name undo
+ */
+ UNDO("0x18"),
+
+ /**
+ * Icon Name unlocked
+ */
+ UNLOCKED("0x23"),
+
+ /**
+ * Icon Name USB media audio source
+ */
+ USB_MEDIA_AUDIO_SOURCE("0x0B"),
+
+ /**
+ * Icon Name voice control scrollbar - list item no. 1
+ */
+ VOICE_CONTROL_SCROLLBAR_LIST_ITEM_NO_1("0xC7"),
+
+ /**
+ * Icon Name voice control scrollbar - list item no. 2
+ */
+ VOICE_CONTROL_SCROLLBAR_LIST_ITEM_NO_2("0xC8"),
+
+ /**
+ * Icon Name voice control scrollbar - list item no. 3
+ */
+ VOICE_CONTROL_SCROLLBAR_LIST_ITEM_NO_3("0xC9"),
+
+ /**
+ * Icon Name voice control scrollbar - list item no. 4
+ */
+ VOICE_CONTROL_SCROLLBAR_LIST_ITEM_NO_4("0xCA"),
+
+ /**
+ * Icon Name voice recognition - failed
+ */
+ VOICE_RECOGNITION_FAILED("0x90"),
+
+ /**
+ * Icon Name voice recognition - pause
+ */
+ VOICE_RECOGNITION_PAUSE("0x92"),
+
+ /**
+ * Icon Name voice recognition - successful
+ */
+ VOICE_RECOGNITION_SUCCESSFUL("0x8F"),
+
+ /**
+ * Icon Name voice recognition - system active
+ */
+ VOICE_RECOGNITION_SYSTEM_ACTIVE("0x11"),
+
+ /**
+ * Icon Name voice recognition - system listening
+ */
+ VOICE_RECOGNITION_SYSTEM_LISTENING("0x91"),
+
+ /**
+ * Icon Name voice recognition - try again
+ */
+ VOICE_RECOGNITION_TRY_AGAIN("0x93"),
+
+ /**
+ * Icon Name warning / safety alert
+ */
+ WARNING("0xfe"),
+
+ /**
+ * Icon Name weather
+ */
+ WEATHER("0xeb"),
+
+ /**
+ * Icon Name wifi full
+ */
+ WIFI_FULL("0x43"),
+
+ /**
+ * Icon Name zoom in
+ */
+ ZOOM_IN("0x98"),
+
+ /**
+ * Icon Name zoom out
+ */
+ ZOOM_OUT("0x9a"),
+
+ ;
+
+ private final String INTERNAL_NAME;
+
+ private StaticIconName(String internalName) {
+ this.INTERNAL_NAME = internalName;
+ }
+
+ public static StaticIconName valueForString(String value) {
+ if(value == null){
+ return null;
+ }
+
+ for (StaticIconName type : StaticIconName.values()) {
+ if (type.toString().equals(value)) {
+ return type;
+ }
+ }
+
+ return null;
+ }
+
+ @Override
+ public String toString() {
+ return INTERNAL_NAME;
+ }
+
+} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/streaming/AbstractPacketizer.java b/sdl_android/src/main/java/com/smartdevicelink/streaming/AbstractPacketizer.java
index 722fa54f9..1a2c393cd 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/streaming/AbstractPacketizer.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/streaming/AbstractPacketizer.java
@@ -6,6 +6,7 @@ import java.io.InputStream;
import com.smartdevicelink.SdlConnection.SdlSession;
import com.smartdevicelink.protocol.enums.SessionType;
import com.smartdevicelink.proxy.RPCRequest;
+import com.smartdevicelink.util.Version;
abstract public class AbstractPacketizer {
@@ -19,7 +20,7 @@ abstract public class AbstractPacketizer {
protected byte[] buffer;
protected boolean upts = false;
protected RPCRequest _request = null;
- protected byte _wiproVersion = 1;
+ protected Version _wiproVersion = new Version("1.0.0");
//protected long ts = 0, intervalBetweenReports = 5000, delta = 0;
protected long intervalBetweenReports = 5000, delta = 0;
@@ -38,13 +39,30 @@ abstract public class AbstractPacketizer {
}
}
+ @Deprecated
public AbstractPacketizer(IStreamListener streamListener, InputStream is, RPCRequest request, SessionType sType, byte rpcSessionID, byte wiproVersion, SdlSession session) throws IOException, IllegalArgumentException {
this._streamListener = streamListener;
this.is = is;
_rpcSessionID = rpcSessionID;
_serviceType = sType;
_request = request;
- _wiproVersion = wiproVersion;
+ _wiproVersion = new Version(wiproVersion+".0.0");
+ this._session = session;
+ if (this._session != null) {
+ bufferSize = this._session.getMtu();
+ buffer = new byte[bufferSize];
+ }else{
+ throw new IllegalArgumentException("Session variable is null");
+ }
+ }
+
+ public AbstractPacketizer(IStreamListener streamListener, InputStream is, RPCRequest request, SessionType sType, byte rpcSessionID, Version protocolVersion, SdlSession session) throws IOException, IllegalArgumentException {
+ this._streamListener = streamListener;
+ this.is = is;
+ _rpcSessionID = rpcSessionID;
+ _serviceType = sType;
+ _request = request;
+ _wiproVersion = protocolVersion;
this._session = session;
if (this._session != null) {
bufferSize = this._session.getMtu();
diff --git a/sdl_android/src/main/java/com/smartdevicelink/streaming/StreamRPCPacketizer.java b/sdl_android/src/main/java/com/smartdevicelink/streaming/StreamRPCPacketizer.java
index 5652aafc3..8aab788c9 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/streaming/StreamRPCPacketizer.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/streaming/StreamRPCPacketizer.java
@@ -22,6 +22,7 @@ import com.smartdevicelink.proxy.rpc.PutFileResponse;
import com.smartdevicelink.proxy.rpc.StreamRPCResponse;
import com.smartdevicelink.proxy.rpc.enums.Result;
import com.smartdevicelink.proxy.rpc.listeners.OnPutFileUpdateListener;
+import com.smartdevicelink.util.Version;
public class StreamRPCPacketizer extends AbstractPacketizer implements IPutFileResponseListener, Runnable{
@@ -36,7 +37,9 @@ public class StreamRPCPacketizer extends AbstractPacketizer implements IPutFileR
private Object mPauseLock;
private boolean mPaused;
private boolean isRPCProtected = false;
- private OnPutFileUpdateListener callBack;
+ private OnPutFileUpdateListener callBack;
+
+ private Version rpcSpecVersion;
public StreamRPCPacketizer(SdlProxyBase<IProxyListenerBase> proxy, IStreamListener streamListener, InputStream is, RPCRequest request, SessionType sType, byte rpcSessionID, byte wiproVersion, long lLength, SdlSession session) throws IOException {
super(streamListener, is, request, sType, rpcSessionID, wiproVersion, session);
@@ -56,6 +59,24 @@ public class StreamRPCPacketizer extends AbstractPacketizer implements IPutFileR
}
}
+ public StreamRPCPacketizer(SdlProxyBase<IProxyListenerBase> proxy, IStreamListener streamListener, InputStream is, RPCRequest request, SessionType sType, byte rpcSessionID, Version wiproVersion, Version rpcSpecVersion, long lLength, SdlSession session) throws IOException {
+ super(streamListener, is, request, sType, rpcSessionID, wiproVersion, session);
+ this.rpcSpecVersion = rpcSpecVersion;
+ lFileSize = lLength;
+ iInitialCorrID = request.getCorrelationID();
+ mPauseLock = new Object();
+ mPaused = false;
+ isRPCProtected = request.isPayloadProtected();
+ if (proxy != null) {
+ _proxy = proxy;
+ _proxyListener = _proxy.getProxyListener();
+ _proxy.addPutFileResponseListener(this);
+ }
+ if(_request.getFunctionName().equalsIgnoreCase(FunctionID.PUT_FILE.toString())){
+ callBack = ((PutFile)_request).getOnPutFileUpdateListener();
+ }
+ }
+
@Override
public void start() throws IOException {
if (thread == null) {
@@ -201,7 +222,8 @@ public class StreamRPCPacketizer extends AbstractPacketizer implements IPutFileR
if (msg.getOffset() != 0)
msg.setLength((Long)null); //only need to send length when offset 0
- msgBytes = JsonRPCMarshaller.marshall(msg, _wiproVersion);
+ msg.format(rpcSpecVersion,true);
+ msgBytes = JsonRPCMarshaller.marshall(msg, (byte)_wiproVersion.getMajor());
pm = new ProtocolMessage();
pm.setData(msgBytes);
diff --git a/sdl_android/src/main/java/com/smartdevicelink/transport/SdlBroadcastReceiver.java b/sdl_android/src/main/java/com/smartdevicelink/transport/SdlBroadcastReceiver.java
index defeb67fa..251765ed2 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/transport/SdlBroadcastReceiver.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/transport/SdlBroadcastReceiver.java
@@ -294,7 +294,12 @@ public abstract class SdlBroadcastReceiver extends BroadcastReceiver{
Intent intent = new Intent();
intent.setClassName(packageName, className);
intent.putExtra(TransportConstants.PING_ROUTER_SERVICE_EXTRA, true);
- context.startService(intent);
+ if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){
+ intent.putExtra(FOREGROUND_EXTRA, true);
+ context.startForegroundService(intent);
+ }else {
+ context.startService(intent);
+ }
}catch(SecurityException e){
Log.e(TAG, "Security exception, process is bad");
// This service could not be started
diff --git a/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterService.java b/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterService.java
index 617fabcb2..dfe1c85bd 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterService.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterService.java
@@ -78,6 +78,7 @@ import com.smartdevicelink.transport.utl.ByteArrayMessageSpliter;
import com.smartdevicelink.util.AndroidTools;
import com.smartdevicelink.util.BitConverter;
import com.smartdevicelink.util.SdlAppInfo;
+import com.smartdevicelink.util.Version;
import static com.smartdevicelink.transport.TransportConstants.FOREGROUND_EXTRA;
import static com.smartdevicelink.transport.TransportConstants.SDL_NOTIFICATION_CHANNEL_ID;
@@ -97,7 +98,7 @@ public class SdlRouterService extends Service{
/**
* <b> NOTE: DO NOT MODIFY THIS UNLESS YOU KNOW WHAT YOU'RE DOING.</b>
*/
- protected static final int ROUTER_SERVICE_VERSION_NUMBER = 6;
+ protected static final int ROUTER_SERVICE_VERSION_NUMBER = 7;
private static final String ROUTER_SERVICE_PROCESS = "com.smartdevicelink.router";
@@ -150,7 +151,8 @@ public class SdlRouterService extends Service{
private SparseArray<String> sessionMap;
private SparseIntArray sessionHashIdMap;
private SparseIntArray cleanedSessionMap;
- private final Object SESSION_LOCK = new Object(), REGISTERED_APPS_LOCK = new Object(), PING_COUNT_LOCK = new Object();
+ private final Object SESSION_LOCK = new Object(), REGISTERED_APPS_LOCK = new Object(),
+ PING_COUNT_LOCK = new Object(), NOTIFICATION_LOCK = new Object();
private static Messenger altTransportService = null;
@@ -1026,26 +1028,30 @@ public class SdlRouterService extends Service{
if(android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB_MR2){
return;
}
- if(foregroundTimeoutHandler == null){
- foregroundTimeoutHandler = new Handler();
- }
- if(foregroundTimeoutRunnable == null) {
- foregroundTimeoutRunnable = new Runnable() {
- @Override
- public void run() {
- exitForeground();
- }
- };
- }else{
- //This instance likely means there is a callback in the queue so we should remove it
- foregroundTimeoutHandler.removeCallbacks(foregroundTimeoutRunnable);
+ synchronized (NOTIFICATION_LOCK) {
+ if (foregroundTimeoutHandler == null) {
+ foregroundTimeoutHandler = new Handler();
+ }
+ if (foregroundTimeoutRunnable == null) {
+ foregroundTimeoutRunnable = new Runnable() {
+ @Override
+ public void run() {
+ exitForeground();
+ }
+ };
+ } else {
+ //This instance likely means there is a callback in the queue so we should remove it
+ foregroundTimeoutHandler.removeCallbacks(foregroundTimeoutRunnable);
+ }
+ foregroundTimeoutHandler.postDelayed(foregroundTimeoutRunnable, delay);
}
- foregroundTimeoutHandler.postDelayed(foregroundTimeoutRunnable,delay);
}
public void cancelForegroundTimeOut(){
- if(foregroundTimeoutHandler != null && foregroundTimeoutRunnable != null){
- foregroundTimeoutHandler.removeCallbacks(foregroundTimeoutRunnable);
+ synchronized (NOTIFICATION_LOCK) {
+ if (foregroundTimeoutHandler != null && foregroundTimeoutRunnable != null) {
+ foregroundTimeoutHandler.removeCallbacks(foregroundTimeoutRunnable);
+ }
}
}
@@ -1070,8 +1076,14 @@ public class SdlRouterService extends Service{
}
// Bitmap icon = BitmapFactory.decodeByteArray(SdlLogo.SDL_LOGO_STRING, 0, SdlLogo.SDL_LOGO_STRING.length);
- Notification.Builder builder = new Notification.Builder(this);
- if(0 != (getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE)){ //If we are in debug mode, include what app has the router service open
+ Notification.Builder builder;
+ if(android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.O){
+ builder = new Notification.Builder(this);
+ } else {
+ builder = new Notification.Builder(this, SDL_NOTIFICATION_CHANNEL_ID);
+ }
+
+ if(0 != (getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE)){ //If we are in debug mode, include what app has the router service open
ComponentName name = new ComponentName(this, this.getClass());
builder.setContentTitle("SDL: " + name.getPackageName());
}else{
@@ -1102,50 +1114,57 @@ public class SdlRouterService extends Service{
builder.setUsesChronometer(true);
builder.setChronometerCountDown(true);
}
-
- Notification notification;
- if(android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.JELLY_BEAN){
- notification = builder.getNotification();
-
- }else{
- if (Build.VERSION.SDK_INT>=Build.VERSION_CODES.O) {
- //Now we need to add a notification channel
- NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
- if(notificationManager != null) {
- String channelId = SDL_NOTIFICATION_CHANNEL_ID;
- int importance = NotificationManager.IMPORTANCE_DEFAULT;
- NotificationChannel notificationChannel = new NotificationChannel(channelId, SDL_NOTIFICATION_CHANNEL_NAME, importance);
- notificationChannel.enableLights(false);
- notificationChannel.enableVibration(false);
- notificationManager.createNotificationChannel(notificationChannel);
- builder.setChannelId(channelId);
- }else{
- Log.e(TAG, "Unable to retrieve notification Manager service");
- }
+ synchronized (NOTIFICATION_LOCK) {
+ Notification notification;
+ if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.JELLY_BEAN) {
+ notification = builder.getNotification();
+
+ } else {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+ //Now we need to add a notification channel
+ NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
+ if (notificationManager != null) {
+ NotificationChannel notificationChannel = new NotificationChannel(SDL_NOTIFICATION_CHANNEL_ID, SDL_NOTIFICATION_CHANNEL_NAME, NotificationManager.IMPORTANCE_LOW);
+ notificationChannel.enableLights(false);
+ notificationChannel.enableVibration(false);
+ notificationManager.createNotificationChannel(notificationChannel);
+ } else {
+ Log.e(TAG, "Unable to retrieve notification Manager service");
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) {
+ stopSelf(); //A valid notification channel must be supplied for SDK 27+
+ }
+ }
+ }
+ notification = builder.build();
}
- notification = builder.build();
- }
- if(notification == null){
- Log.e(TAG, "Notification was null");
- return;
- }
- startForeground(FOREGROUND_SERVICE_ID, notification);
- isForeground = true;
+ if (notification == null) {
+ Log.e(TAG, "Notification was null");
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) {
+ stopSelf(); //A valid notification must be supplied for SDK 27+
+ }
+ return;
+ }
+ startForeground(FOREGROUND_SERVICE_ID, notification);
+ isForeground = true;
+ }
}
private void exitForeground(){
- if(isForeground){
- if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.O){
- NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
- if(notificationManager!=null){
- notificationManager.deleteNotificationChannel(TransportConstants.SDL_NOTIFICATION_CHANNEL_ID);
+ synchronized (NOTIFICATION_LOCK) {
+ if (isForeground && !isTransportConnected) { //Ensure that the service is in the foreground and no longer connected to a transport
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+ NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
+ if (notificationManager != null
+ && notificationManager.getNotificationChannel(SDL_NOTIFICATION_CHANNEL_ID) != null ) {
+ notificationManager.deleteNotificationChannel(TransportConstants.SDL_NOTIFICATION_CHANNEL_ID);
+ }
}
- }
- this.stopForeground(true);
- isForeground = false;
+ this.stopForeground(true);
+ isForeground = false;
+ }
}
}
@@ -1977,6 +1996,7 @@ public class SdlRouterService extends Service{
private byte[] createForceUnregisterApp(byte sessionId,byte version){
UnregisterAppInterface request = new UnregisterAppInterface();
request.setCorrelationID(UNREGISTER_APP_INTERFACE_CORRELATION_ID);
+ request.format(null,true);
byte[] msgBytes = JsonRPCMarshaller.marshall(request, version);
ProtocolMessage pm = new ProtocolMessage();
pm.setData(msgBytes);
diff --git a/sdl_android/src/main/java/com/smartdevicelink/util/Version.java b/sdl_android/src/main/java/com/smartdevicelink/util/Version.java
index 8621c8cfd..6861d1504 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/util/Version.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/util/Version.java
@@ -11,6 +11,12 @@ public class Version {
patch = 0;
}
+ public Version(int major, int minor, int patch){
+ this.major = major;
+ this.minor = minor;
+ this.patch = patch;
+ }
+
public Version(String versionString){
String[] versions = versionString.split("\\.");
if(versions.length!=3){
diff --git a/sdl_android/src/main/res/values/sdl.xml b/sdl_android/src/main/res/values/sdl.xml
index a4f2f6a5f..679a8cf61 100644
--- a/sdl_android/src/main/res/values/sdl.xml
+++ b/sdl_android/src/main/res/values/sdl.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="sdl_router_service_version_name" translatable="false">sdl_router_version</string>
- <integer name="sdl_router_service_version_value">6</integer>
+ <integer name="sdl_router_service_version_value">7</integer>
<string name="sdl_router_service_is_custom_name" translatable="false">sdl_custom_router</string>
</resources>