summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTuan Nguyen <tuan.nguyen617@gmail.com>2018-09-24 14:35:08 -0700
committerTuan Nguyen <tuan.nguyen617@gmail.com>2018-09-24 14:35:08 -0700
commitf4745d5d1613d74303caf5d40039f92c20e0f959 (patch)
treee3682fe6a86035e767fb390c483b70c874da7815
parentdaa18cfa70dfafdbc81f9cc30cdbafc82a78536c (diff)
parentf4c86b5dc4f91d2275a9a92e0806c49bb31f4231 (diff)
downloadsdl_android-feature/issue_654_audio_stream_manager.tar.gz
Merge branch 'feature/issue_782_Android_Managers' into feature/issue_654_audio_stream_review_fixfeature/issue_654_audio_stream_manager
* feature/issue_782_Android_Managers: (133 commits) call context setter per review comments Always pass context to SdlSecurityBase Fix getting context issue in SdlProxyBase fixed typo in javadocs Add SystemCapabilityManager to SdlManager Add addOnRPCNotificationListener method to SdlManager Reformat setting app icon code in SdlManager predefined layout tests Add setAppIcon() to SdlManager add predefined layout enum make SdlManager.dispose() a public method Update Travis file to support Android 27 Updated version info for hotfix Refactor and synch notificaiton for RS manually merge sdlmanager fixes per review Fix NPE in RegisterAppInterface Set the fullAppId using fomrat method only when rpcVersion is equal or more than 5 Add test for false positivie in SCM cap supported Fix #844 ... # Conflicts: # sdl_android/src/main/java/com/smartdevicelink/api/SdlManager.java # sdl_android/src/main/java/com/smartdevicelink/api/StreamingStateMachine.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/SdlManagerTests.java32
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/api/VideoStreamingManagerTests.java285
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/api/lockscreen/LockScreenConfigTests.java46
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/api/lockscreen/LockScreenManagerTests.java57
-rw-r--r--sdl_android/src/androidTest/java/com/smartdevicelink/test/Test.java98
-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.java26
-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/ProxyBridge.java18
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/api/SdlManager.java246
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/api/SdlManagerListener.java21
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/api/StreamingStateMachine.java142
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/api/VideoStreamingManager.java536
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/api/lockscreen/LockScreenConfig.java114
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/api/lockscreen/LockScreenManager.java254
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/api/lockscreen/SDLLockScreenActivity.java130
-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.java237
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/SystemCapabilityManager.java90
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/interfaces/ISdl.java36
-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/proxy/rpc/listeners/OnRPCListener.java55
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnRPCResponseListener.java130
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/security/SdlSecurityBase.java21
-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/drawable-hdpi/sdl_lockscreen_icon.pngbin0 -> 2570 bytes
-rw-r--r--sdl_android/src/main/res/drawable-mdpi/sdl_lockscreen_icon.pngbin0 -> 1791 bytes
-rw-r--r--sdl_android/src/main/res/drawable-xhdpi/sdl_lockscreen_icon.pngbin0 -> 3487 bytes
-rw-r--r--sdl_android/src/main/res/drawable-xxhdpi/sdl_lockscreen_icon.pngbin0 -> 5172 bytes
-rw-r--r--sdl_android/src/main/res/drawable-xxxhdpi/sdl_lockscreen_icon.pngbin0 -> 6666 bytes
-rw-r--r--sdl_android/src/main/res/layout/activity_sdllock_screen.xml44
-rw-r--r--sdl_android/src/main/res/values/sdl.xml2
-rw-r--r--sdl_android/src/main/res/values/strings.xml6
99 files changed, 8490 insertions, 481 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/SdlManagerTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/api/SdlManagerTests.java
index 2a3566191..af9d38b38 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/api/SdlManagerTests.java
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/api/SdlManagerTests.java
@@ -85,19 +85,34 @@ public class SdlManagerTests extends AndroidTestCase {
private SdlManager createSampleManager(String appName, String appId){
SdlManager manager;
+ SdlManagerListener listener = new SdlManagerListener() {
+ @Override
+ public void onStart() {
+ listenerCalledCounter++;
+ }
+
+ @Override
+ public void onDestroy() {
+
+ }
+
+ @Override
+ public void onError(String info, Exception e) {
+
+ }
+ };
+
// build manager object - use all setters, will test using getters below
- SdlManager.Builder builder = new SdlManager.Builder();
- builder.setAppId(appId);
- builder.setAppName(appName);
+ SdlManager.Builder builder = new SdlManager.Builder(getTestContext(),appId,appName,listener);
builder.setShortAppName(appName);
builder.setAppTypes(appType);
builder.setTransportType(transport);
- builder.setContext(getTestContext());
builder.setLanguage(Language.EN_US);
builder.setDayColorScheme(templateColorScheme);
builder.setNightColorScheme(templateColorScheme);
builder.setVrSynonyms(Test.GENERAL_VECTOR_STRING);
builder.setTtsName(Test.GENERAL_VECTOR_TTS_CHUNKS);
+ builder.setLockScreenConfig(Test.GENERAL_LOCKSCREENCONFIG);
manager = builder.build();
// mock SdlProxyBase and set it manually
@@ -140,18 +155,13 @@ public class SdlManagerTests extends AndroidTestCase {
assertEquals(templateColorScheme, sdlManager.getNightColorScheme());
assertEquals(Test.GENERAL_VECTOR_STRING, sdlManager.getVrSynonyms());
assertEquals(Test.GENERAL_VECTOR_TTS_CHUNKS, sdlManager.getTtsChunks());
+ assertEquals(Test.GENERAL_LOCKSCREENCONFIG, sdlManager.getLockScreenConfig());
}
public void testStartingManager(){
listenerCalledCounter = 0;
- sdlManager.start(new CompletionListener() {
- @Override
- public void onComplete(boolean success) {
- assertTrue(success);
- listenerCalledCounter++;
- }
- });
+ sdlManager.start();
// Create and force all sub managers to be ready manually. Because SdlManager will not start until all sub managers are ready.
// Note : SdlManager.initialize() will not be called automatically by proxy as in real life because we have mock proxy not a real one
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/api/VideoStreamingManagerTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/api/VideoStreamingManagerTests.java
new file mode 100644
index 000000000..1f7904fe1
--- /dev/null
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/api/VideoStreamingManagerTests.java
@@ -0,0 +1,285 @@
+package com.smartdevicelink.api;
+
+import android.content.Context;
+import android.os.Bundle;
+import android.support.annotation.NonNull;
+import android.test.AndroidTestCase;
+import android.util.Log;
+import android.view.Display;
+import android.view.MotionEvent;
+import android.view.Surface;
+import android.view.View;
+
+import com.smartdevicelink.encoder.VirtualDisplayEncoder;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.protocol.enums.SessionType;
+import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.proxy.interfaces.ISdlServiceListener;
+import com.smartdevicelink.proxy.interfaces.IVideoStreamListener;
+import com.smartdevicelink.proxy.interfaces.OnSystemCapabilityListener;
+import com.smartdevicelink.proxy.rpc.OnHMIStatus;
+import com.smartdevicelink.proxy.rpc.OnTouchEvent;
+import com.smartdevicelink.proxy.rpc.TouchEvent;
+import com.smartdevicelink.proxy.rpc.enums.HMILevel;
+import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType;
+import com.smartdevicelink.proxy.rpc.enums.TouchType;
+import com.smartdevicelink.proxy.rpc.listeners.OnRPCNotificationListener;
+import com.smartdevicelink.streaming.video.SdlRemoteDisplay;
+import com.smartdevicelink.streaming.video.VideoStreamingParameters;
+import com.smartdevicelink.test.Test;
+import com.smartdevicelink.util.Version;
+
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
+
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyBoolean;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+/**
+ * This is a unit test class for the SmartDeviceLink video streaming manager class :
+ * {@link com.smartdevicelink.api.VideoStreamingManager}
+ */
+public class VideoStreamingManagerTests extends AndroidTestCase {
+ public static final String TAG = "VideoStreamingManagerTests";
+ private Context mTestContext;
+ private static boolean touchEventOccured = false;
+
+ // SETUP / HELPERS
+
+ @Override
+ public void setUp() throws Exception{
+ super.setUp();
+ mTestContext = this.getContext();
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ // TEST CLASSES
+
+ public static class TestPresentation extends SdlRemoteDisplay {
+ View simulatedView = new View(this.getContext());
+
+ public TestPresentation(Context context, Display display) {
+ super(context, display);
+ }
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(simulatedView);
+ }
+
+ @Override
+ public boolean onTouchEvent(@NonNull MotionEvent event) {
+ touchEventOccured = true;
+ return super.onTouchEvent(event);
+ }
+ }
+
+ // TESTS
+
+ public void testInitialization(){
+ ISdl internalInterface = mock(ISdl.class);
+
+ Answer<Void> onAddServiceListener = new Answer<Void>() {
+ @Override
+ public Void answer(InvocationOnMock invocation) {
+ Object[] args = invocation.getArguments();
+ SessionType sessionType = (SessionType) args[0];
+ ISdlServiceListener sdlServiceListener = (ISdlServiceListener) args[1];
+ assertEquals(sessionType, SessionType.NAV);
+ assertNotNull(sdlServiceListener);
+ return null;
+ }
+ };
+
+ doAnswer(onAddServiceListener).when(internalInterface).addServiceListener(any(SessionType.class), any(ISdlServiceListener.class));
+
+ VideoStreamingManager videoStreamingManager = new VideoStreamingManager(internalInterface);
+ videoStreamingManager.start(new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ assertTrue(success);
+ }
+ });
+ }
+
+ public void testHMILevelNotFull(){
+ ISdl internalInterface = mock(ISdl.class);
+
+ when(internalInterface.getWiProVersion()).thenReturn((byte)5);
+ when(internalInterface.isCapabilitySupported(SystemCapabilityType.VIDEO_STREAMING)).thenReturn(true);
+
+ final VideoStreamingManager videoStreamingManager = new VideoStreamingManager(internalInterface);
+ videoStreamingManager.start(new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ assertNull(videoStreamingManager.startVideoService(
+ new VideoStreamingParameters(), false));
+ }
+ });
+ }
+
+ public void testRemoteDisplayStream(){
+ ISdl internalInterface = mock(ISdl.class);
+
+ final Set<Object> listenerSet = new HashSet<>();
+
+ when(internalInterface.getWiProVersion()).thenReturn((byte)5);
+ when(internalInterface.isCapabilitySupported(SystemCapabilityType.VIDEO_STREAMING)).thenReturn(true);
+
+ Answer<Void> onGetCapability = new Answer<Void>() {
+ @Override
+ public Void answer(InvocationOnMock invocation) {
+ Object[] args = invocation.getArguments();
+ OnSystemCapabilityListener systemCapabilityListener = (OnSystemCapabilityListener) args[1];
+ systemCapabilityListener.onCapabilityRetrieved(Test.GENERAL_VIDEOSTREAMINGCAPABILITY);
+ return null;
+ }
+ };
+
+ doAnswer(onGetCapability).when(internalInterface).getCapability(eq(SystemCapabilityType.VIDEO_STREAMING), any(OnSystemCapabilityListener.class));
+
+ Answer<Void> onAddServiceListener = new Answer<Void>() {
+ @Override
+ public Void answer(InvocationOnMock invocation) {
+ Object[] args = invocation.getArguments();
+ listenerSet.add(args[1]);
+ return null;
+ }
+ };
+
+ doAnswer(onAddServiceListener).when(internalInterface).addServiceListener(eq(SessionType.NAV), any(ISdlServiceListener.class));
+
+ final OnRPCNotificationListener[] hmiListener = {null};
+
+ Answer<Void> onAddHMIListener = new Answer<Void>() {
+ @Override
+ public Void answer(InvocationOnMock invocation) {
+ Object[] args = invocation.getArguments();
+ hmiListener[0] = (OnRPCNotificationListener) args[1];
+ listenerSet.add(args[1]);
+ return null;
+ }
+ };
+
+ doAnswer(onAddHMIListener).when(internalInterface).addOnRPCNotificationListener(eq(FunctionID.ON_HMI_STATUS), any(OnRPCNotificationListener.class));
+
+ Answer<Void> onAddTouchListener = new Answer<Void>() {
+ @Override
+ public Void answer(InvocationOnMock invocation) {
+ Object[] args = invocation.getArguments();
+ listenerSet.add(args[1]);
+ return null;
+ }
+ };
+
+ doAnswer(onAddTouchListener).when(internalInterface).addOnRPCNotificationListener(eq(FunctionID.ON_TOUCH_EVENT), any(OnRPCNotificationListener.class));
+
+ Answer<Void> onRemoveRPCNotificationListener = new Answer<Void>() {
+ @Override
+ public Void answer(InvocationOnMock invocation) {
+ Object[] args = invocation.getArguments();
+ listenerSet.remove(args[1]);
+ return null;
+ }
+ };
+
+ doAnswer(onRemoveRPCNotificationListener).when(internalInterface).removeOnRPCNotificationListener(eq(FunctionID.ON_HMI_STATUS), any(OnRPCNotificationListener.class));
+ doAnswer(onRemoveRPCNotificationListener).when(internalInterface).removeOnRPCNotificationListener(eq(FunctionID.ON_TOUCH_EVENT), any(OnRPCNotificationListener.class));
+
+ Answer<Void> onRemoveServiceListener = new Answer<Void>() {
+ @Override
+ public Void answer(InvocationOnMock invocation) {
+ Object[] args = invocation.getArguments();
+ listenerSet.remove(args[1]);
+ return null;
+ }
+ };
+
+ doAnswer(onRemoveServiceListener).when(internalInterface).removeServiceListener(eq(SessionType.NAV), any(ISdlServiceListener.class));
+
+ when(internalInterface.startVideoStream(anyBoolean(), any(VideoStreamingParameters.class))).thenReturn(new IVideoStreamListener() {
+ @Override
+ public void sendFrame(byte[] data, int offset, int length, long presentationTimeUs) throws ArrayIndexOutOfBoundsException {}
+ @Override
+ public void sendFrame(ByteBuffer data, long presentationTimeUs) {}
+ });
+
+ when(internalInterface.getCapability(SystemCapabilityType.VIDEO_STREAMING)).thenReturn(Test.GENERAL_VIDEOSTREAMINGCAPABILITY);
+
+ final VideoStreamingManager videoStreamingManager = new VideoStreamingManager(internalInterface);
+ videoStreamingManager.start(new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ assertTrue(success);
+ assertTrue(listenerSet.size() == 3);
+
+ OnHMIStatus fullNotification = new OnHMIStatus();
+ fullNotification.setHmiLevel(HMILevel.HMI_FULL);
+ hmiListener[0].onNotified(fullNotification);
+
+ videoStreamingManager.startRemoteDisplayStream(mTestContext, TestPresentation.class, null, false);
+
+ //assertTrue(touchEventOccured);
+
+ videoStreamingManager.dispose();
+ assertTrue(listenerSet.isEmpty());
+ }
+ });
+
+ }
+
+ public void testConvertTouchEvent(){
+ ISdl internalInterface = mock(ISdl.class);
+
+ final VideoStreamingManager videoStreamingManager = new VideoStreamingManager(internalInterface);
+ videoStreamingManager.start(new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ assertTrue(success);
+ OnTouchEvent testOnTouchEvent = new OnTouchEvent();
+ TouchEvent touchEvent = Test.GENERAL_TOUCHEVENT;
+ testOnTouchEvent.setEvent(Collections.singletonList(touchEvent));
+ testOnTouchEvent.setType(Test.GENERAL_TOUCHTYPE);
+ MotionEvent motionEvent;
+
+ // Touch one pointer (100)
+ motionEvent = videoStreamingManager.convertTouchEvent(testOnTouchEvent);
+ assertEquals(motionEvent.getAction(), MotionEvent.ACTION_DOWN);
+
+ // Touch another pointer (101) without release
+ touchEvent.setId(Test.GENERAL_INT + 1);
+ testOnTouchEvent.setEvent(Collections.singletonList(touchEvent));
+ motionEvent = videoStreamingManager.convertTouchEvent(testOnTouchEvent);
+ assertEquals(motionEvent.getAction(), MotionEvent.ACTION_POINTER_DOWN);
+
+ // Release one of the pointers (101)
+ testOnTouchEvent.setType(TouchType.END);
+ motionEvent = videoStreamingManager.convertTouchEvent(testOnTouchEvent);
+ assertEquals(motionEvent.getAction(), MotionEvent.ACTION_POINTER_UP);
+
+ // Release the other pointer (100)
+ touchEvent.setId(Test.GENERAL_INT);
+ testOnTouchEvent.setEvent(Collections.singletonList(touchEvent));
+ motionEvent = videoStreamingManager.convertTouchEvent(testOnTouchEvent);
+ assertEquals(motionEvent.getAction(), MotionEvent.ACTION_UP);
+ }
+ });
+ }
+}
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/api/lockscreen/LockScreenConfigTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/api/lockscreen/LockScreenConfigTests.java
new file mode 100644
index 000000000..a5d2a0eec
--- /dev/null
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/api/lockscreen/LockScreenConfigTests.java
@@ -0,0 +1,46 @@
+package com.smartdevicelink.api.lockscreen;
+
+import android.test.AndroidTestCase;
+
+import com.smartdevicelink.test.Test;
+
+
+/**
+ * This is a unit test class for the SmartDeviceLink library manager class :
+ * {@link com.smartdevicelink.api.lockscreen.LockScreenConfig}
+ *
+ * We currently do not need to test null values, as each currently is a primitive
+ */
+public class LockScreenConfigTests extends AndroidTestCase {
+
+ private LockScreenConfig lockScreenConfig;
+
+ @Override
+ public void setUp() throws Exception {
+ super.setUp();
+
+ // set info for all the setters
+ lockScreenConfig = new LockScreenConfig();
+ lockScreenConfig.setCustomView(Test.GENERAL_INT);
+ lockScreenConfig.setAppIcon(Test.GENERAL_INT);
+ lockScreenConfig.setBackgroundColor(Test.GENERAL_INT);
+ lockScreenConfig.showDeviceLogo(true);
+ lockScreenConfig.setEnabled(true);
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ public void testLockScreenConfig() {
+
+ // get the info and make sure its correct
+ assertEquals(Test.GENERAL_INT, lockScreenConfig.getCustomView());
+ assertEquals(Test.GENERAL_INT, lockScreenConfig.getAppIcon());
+ assertEquals(Test.GENERAL_INT, lockScreenConfig.getBackgroundColor());
+ assertEquals(true, lockScreenConfig.isEnabled());
+ assertEquals(true, lockScreenConfig.isDeviceLogoEnabled());
+ }
+
+} \ No newline at end of file
diff --git a/sdl_android/src/androidTest/java/com/smartdevicelink/api/lockscreen/LockScreenManagerTests.java b/sdl_android/src/androidTest/java/com/smartdevicelink/api/lockscreen/LockScreenManagerTests.java
new file mode 100644
index 000000000..41f791d80
--- /dev/null
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/api/lockscreen/LockScreenManagerTests.java
@@ -0,0 +1,57 @@
+package com.smartdevicelink.api.lockscreen;
+
+import android.content.Context;
+import android.test.AndroidTestCase;
+import android.test.mock.MockContext;
+
+import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.proxy.rpc.enums.LockScreenStatus;
+import com.smartdevicelink.test.Test;
+
+import static org.mockito.Mockito.mock;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library manager class :
+ * {@link com.smartdevicelink.api.lockscreen.LockScreenManager}
+ */
+public class LockScreenManagerTests extends AndroidTestCase {
+
+ private LockScreenManager lockScreenManager;
+
+ @Override
+ public void setUp() throws Exception{
+ super.setUp();
+
+ ISdl internalInterface = mock(ISdl.class);
+
+ Context context = new MockContext();
+ // create config
+ LockScreenConfig lockScreenConfig = new LockScreenConfig();
+ lockScreenConfig.setCustomView(Test.GENERAL_INT);
+ lockScreenConfig.setAppIcon(Test.GENERAL_INT);
+ lockScreenConfig.setBackgroundColor(Test.GENERAL_INT);
+ lockScreenConfig.showDeviceLogo(true);
+ lockScreenConfig.setEnabled(true);
+
+ lockScreenManager = new LockScreenManager(lockScreenConfig, context, internalInterface);
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ public void testVariables() {
+ assertEquals(Test.GENERAL_INT, lockScreenManager.customView);
+ assertEquals(Test.GENERAL_INT, lockScreenManager.lockScreenIcon);
+ assertEquals(Test.GENERAL_INT, lockScreenManager.lockScreenColor);
+ assertEquals(true, lockScreenManager.deviceLogoEnabled);
+ assertEquals(true, lockScreenManager.lockScreenEnabled);
+ assertNull(lockScreenManager.deviceLogo);
+ }
+
+ public void testGetLockScreenStatus(){
+ assertEquals(LockScreenStatus.OFF, lockScreenManager.getLockScreenStatus());
+ }
+
+}
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 76bc71696..a3938982c 100644
--- a/sdl_android/src/androidTest/java/com/smartdevicelink/test/Test.java
+++ b/sdl_android/src/androidTest/java/com/smartdevicelink/test/Test.java
@@ -1,8 +1,12 @@
package com.smartdevicelink.test;
+import android.graphics.Color;
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;
@@ -12,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;
@@ -43,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;
@@ -77,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;
@@ -97,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;
@@ -281,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();
@@ -305,6 +338,7 @@ public class Test {
public static final Rectangle GENERAL_RECTANGLE = new Rectangle();
public static final HapticRect GENERAL_HAPTIC_RECT = new HapticRect();
public static final FuelType GENERAL_FUELTYPE = FuelType.GASOLINE;
+ public static final LockScreenConfig GENERAL_LOCKSCREENCONFIG = new LockScreenConfig();
public static final List<Long> GENERAL_LONG_LIST = Arrays.asList(new Long[]{ 1L, 2L });
public static final List<Turn> GENERAL_TURN_LIST = new ArrayList<Turn>();
@@ -343,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();
@@ -433,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);
@@ -661,6 +720,7 @@ public class Test {
GENERAL_VIDEOSTREAMINGCAPABILITY.setMaxBitrate(GENERAL_INT);
GENERAL_VIDEOSTREAMINGCAPABILITY.setPreferredResolution(GENERAL_IMAGERESOLUTION);
GENERAL_VIDEOSTREAMINGCAPABILITY.setSupportedFormats(GENERAL_VIDEOSTREAMINGFORMAT_LIST);
+ GENERAL_VIDEOSTREAMINGCAPABILITY.setIsHapticSpatialDataSupported(GENERAL_BOOLEAN);
GENERAL_CLIMATECONTROLCAPABILITIES.setModuleName(GENERAL_STRING);
GENERAL_CLIMATECONTROLCAPABILITIES.setFanSpeedAvailable(GENERAL_BOOLEAN);
@@ -706,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);
@@ -744,6 +835,11 @@ public class Test {
GENERAL_DAYCOLORSCHEME.setSecondaryColor(GENERAL_RGBCOLOR);
GENERAL_DAYCOLORSCHEME.setBackgroundColor(GENERAL_RGBCOLOR);
+ GENERAL_LOCKSCREENCONFIG.setAppIcon(R.drawable.sdl_lockscreen_icon);
+ GENERAL_LOCKSCREENCONFIG.setBackgroundColor(Color.BLUE);
+ GENERAL_LOCKSCREENCONFIG.setEnabled(true);
+ GENERAL_LOCKSCREENCONFIG.setCustomView(R.layout.activity_sdllock_screen);
+
try {
JSON_HMIPERMISSIONS.put(HMIPermissions.KEY_ALLOWED, GENERAL_HMILEVEL_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 8833c9323..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
@@ -26,6 +26,7 @@ import com.smartdevicelink.proxy.rpc.enums.HmiZoneCapabilities;
import com.smartdevicelink.proxy.rpc.enums.SpeechCapabilities;
import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType;
import com.smartdevicelink.proxy.rpc.listeners.OnMultipleRequestListener;
+import com.smartdevicelink.proxy.rpc.listeners.OnRPCListener;
import com.smartdevicelink.proxy.rpc.listeners.OnRPCNotificationListener;
import com.smartdevicelink.streaming.audio.AudioStreamingCodec;
import com.smartdevicelink.streaming.audio.AudioStreamingParams;
@@ -33,6 +34,7 @@ import com.smartdevicelink.streaming.video.VideoStreamingParameters;
import com.smartdevicelink.test.Test;
import com.smartdevicelink.test.Validator;
import com.smartdevicelink.util.CorrelationIdGenerator;
+import com.smartdevicelink.util.Version;
import java.util.List;
@@ -137,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(){}
@@ -177,6 +185,12 @@ public class SystemCapabilityManagerTests extends AndroidTestCase {
public boolean removeOnRPCNotificationListener(FunctionID notificationId, OnRPCNotificationListener listener) {return false;}
@Override
+ public void addOnRPCListener(FunctionID responseId, OnRPCListener listener) { }
+
+ @Override
+ public boolean removeOnRPCListener(FunctionID responseId, OnRPCListener listener) { return false; }
+
+ @Override
public Object getCapability(SystemCapabilityType systemCapabilityType){return null;}
@Override
@@ -188,11 +202,23 @@ public class SystemCapabilityManagerTests extends AndroidTestCase {
}
@Override
+ public byte getWiProVersion() {
+ return 0;
+ }
+
+
+ @Override
public boolean isCapabilitySupported(SystemCapabilityType systemCapabilityType){
return false;
}
@Override
+ public void addOnSystemCapabilityListener(SystemCapabilityType systemCapabilityType, OnSystemCapabilityListener listener) { }
+
+ @Override
+ public boolean removeOnSystemCapabilityListener(SystemCapabilityType systemCapabilityType, OnSystemCapabilityListener listener) { return false; }
+
+ @Override
public void startAudioService(boolean isEncrypted, AudioStreamingCodec codec,
AudioStreamingParams params) {}
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/ProxyBridge.java b/sdl_android/src/main/java/com/smartdevicelink/api/ProxyBridge.java
index c1e85cafa..eca5fe3a8 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/api/ProxyBridge.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/api/ProxyBridge.java
@@ -77,32 +77,34 @@ import com.smartdevicelink.proxy.rpc.UnsubscribeVehicleDataResponse;
import com.smartdevicelink.proxy.rpc.UnsubscribeWayPointsResponse;
import com.smartdevicelink.proxy.rpc.UpdateTurnListResponse;
import com.smartdevicelink.proxy.rpc.enums.SdlDisconnectedReason;
+import com.smartdevicelink.proxy.rpc.listeners.OnRPCListener;
import java.util.concurrent.CopyOnWriteArrayList;
public class ProxyBridge implements IProxyListener{
private final Object RPC_LISTENER_LOCK = new Object();
- protected SparseArray<CopyOnWriteArrayList<OnRPCListener>> rpcListeners = null;
- final LifecycleListener lifecycleListener;
+ private SparseArray<CopyOnWriteArrayList<OnRPCListener>> rpcListeners = null;
+ private final LifecycleListener lifecycleListener;
@Override
public void onProxyOpened() {}
@Override
public void onRegisterAppInterfaceResponse(RegisterAppInterfaceResponse response) {
+ onRPCReceived(response);
if(response.getSuccess()){
lifecycleListener.onProxyConnected();
}
}
@Override
- public void onOnAppInterfaceUnregistered(OnAppInterfaceUnregistered notification) {}
+ public void onOnAppInterfaceUnregistered(OnAppInterfaceUnregistered notification) {
+ onRPCReceived(notification);
+ }
@Override
- public void onUnregisterAppInterfaceResponse(UnregisterAppInterfaceResponse response) {}
-
- public interface OnRPCListener {
- void onRpcReceived(int functionID, RPCMessage message);
+ public void onUnregisterAppInterfaceResponse(UnregisterAppInterfaceResponse response) {
+ onRPCReceived(response);
}
protected interface LifecycleListener{
@@ -124,7 +126,7 @@ public class ProxyBridge implements IProxyListener{
CopyOnWriteArrayList<OnRPCListener> listeners = rpcListeners.get(id);
if(listeners!=null && listeners.size()>0) {
for (OnRPCListener listener : listeners) {
- listener.onRpcReceived(id,message);
+ listener.onReceived(message);
}
return true;
}
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 43550704c..3a332e8dd 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/api/SdlManager.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/api/SdlManager.java
@@ -7,12 +7,16 @@ import android.util.Log;
import com.smartdevicelink.api.PermissionManager.PermissionManager;
import com.smartdevicelink.api.audio.AudioStreamManager;
+import com.smartdevicelink.api.datatypes.SdlArtwork;
+import com.smartdevicelink.api.lockscreen.LockScreenConfig;
+import com.smartdevicelink.api.lockscreen.LockScreenManager;
import com.smartdevicelink.exception.SdlException;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.protocol.enums.SessionType;
import com.smartdevicelink.proxy.RPCMessage;
import com.smartdevicelink.proxy.RPCRequest;
import com.smartdevicelink.proxy.SdlProxyBase;
+import com.smartdevicelink.proxy.SystemCapabilityManager;
import com.smartdevicelink.proxy.callbacks.OnServiceEnded;
import com.smartdevicelink.proxy.callbacks.OnServiceNACKed;
import com.smartdevicelink.proxy.interfaces.IAudioStreamListener;
@@ -21,6 +25,7 @@ import com.smartdevicelink.proxy.interfaces.ISdlServiceListener;
import com.smartdevicelink.proxy.interfaces.IVideoStreamListener;
import com.smartdevicelink.proxy.interfaces.OnSystemCapabilityListener;
import com.smartdevicelink.proxy.rpc.SdlMsgVersion;
+import com.smartdevicelink.proxy.rpc.SetAppIcon;
import com.smartdevicelink.proxy.rpc.TTSChunk;
import com.smartdevicelink.proxy.rpc.TemplateColorScheme;
import com.smartdevicelink.proxy.rpc.enums.AppHMIType;
@@ -28,11 +33,13 @@ import com.smartdevicelink.proxy.rpc.enums.Language;
import com.smartdevicelink.proxy.rpc.enums.SdlDisconnectedReason;
import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType;
import com.smartdevicelink.proxy.rpc.listeners.OnMultipleRequestListener;
+import com.smartdevicelink.proxy.rpc.listeners.OnRPCListener;
import com.smartdevicelink.proxy.rpc.listeners.OnRPCNotificationListener;
import com.smartdevicelink.streaming.audio.AudioStreamingCodec;
import com.smartdevicelink.streaming.audio.AudioStreamingParams;
import com.smartdevicelink.streaming.video.VideoStreamingParameters;
import com.smartdevicelink.transport.BaseTransportConfig;
+import com.smartdevicelink.util.Version;
import java.util.ArrayList;
import java.util.List;
@@ -54,32 +61,30 @@ public class SdlManager{
private static String TAG = "Sdl Manager";
private SdlProxyBase proxy;
-
- // Required parameters for builder
private String appId, appName, shortAppName;
private boolean isMediaApp;
private Language hmiLanguage;
+ private SdlArtwork appIcon;
private Vector<AppHMIType> hmiTypes;
private BaseTransportConfig transport;
private Context context;
private Vector<String> vrSynonyms;
private Vector<TTSChunk> ttsChunks;
private TemplateColorScheme dayColorScheme, nightColorScheme;
-
- private CompletionListener initListener;
+ private SdlManagerListener managerListener;
private int state = -1;
- //public LockScreenConfig lockScreenConfig;
+ public LockScreenConfig lockScreenConfig;
// Managers
private PermissionManager permissionManager;
+ private VideoStreamingManager videoStreamingManager;
private FileManager fileManager;
private AudioStreamManager audioStreamManager;
+ private LockScreenManager lockScreenManager;
/*
- private VideoStreamingManager videoStreamingManager;
- private LockscreenManager lockscreenManager;
private ScreenManager screenManager;
*/
@@ -112,7 +117,7 @@ public class SdlManager{
}
});
- // Sub manager listener
+ // Sub manager listener
private final CompletionListener subManagerListener = new CompletionListener() {
@Override
public synchronized void onComplete(boolean success) {
@@ -122,18 +127,34 @@ public class SdlManager{
if(
permissionManager != null && permissionManager.getState() != BaseSubManager.SETTING_UP &&
fileManager != null && fileManager.getState() != BaseSubManager.SETTING_UP &&
- audioStreamManager != null && audioStreamManager.getState() != BaseSubManager.SETTING_UP
+ audioStreamManager != null && audioStreamManager.getState() != BaseSubManager.SETTING_UP &&
+ (videoStreamingManager == null || (videoStreamingManager != null && videoStreamingManager.getState() != BaseSubManager.SETTING_UP)) &&
+ lockScreenManager != null && lockScreenManager.getState() != BaseSubManager.SETTING_UP
/*
- videoStreamingManager != null && videoStreamingManager.getState() != BaseSubManager.SETTING_UP &&
-
- lockscreenManager != null && lockscreenManager.getState() != BaseSubManager.SETTING_UP &&
screenManager != null && screenManager.getState() != BaseSubManager.SETTING_UP
*/
){
state = BaseSubManager.READY;
- if(initListener != null){
- initListener.onComplete(true);
- initListener = null;
+ if(managerListener != null){
+ managerListener.onStart();
+ }
+
+ // Set the app icon
+ if (SdlManager.this.appIcon != null && SdlManager.this.appIcon.getName() != null) {
+ if (!fileManager.hasUploadedFile(SdlManager.this.appIcon)) {
+ fileManager.uploadArtwork(SdlManager.this.appIcon, new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ if (success) {
+ SetAppIcon msg = new SetAppIcon(SdlManager.this.appIcon.getName());
+ _internalInterface.sendRPCRequest(msg);
+ }
+ }
+ });
+ } else {
+ SetAppIcon msg = new SetAppIcon(SdlManager.this.appIcon.getName());
+ _internalInterface.sendRPCRequest(msg);
+ }
}
}
}
@@ -145,6 +166,11 @@ public class SdlManager{
this.permissionManager = new PermissionManager(_internalInterface);
this.permissionManager.start(subManagerListener);
+ if(getAppTypes().contains(AppHMIType.NAVIGATION) || getAppTypes().contains(AppHMIType.PROJECTION)){
+ this.videoStreamingManager = new VideoStreamingManager(_internalInterface);
+ this.videoStreamingManager.start(subManagerListener);
+ }
+
this.fileManager = new FileManager(_internalInterface, context);
this.fileManager.start(subManagerListener);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
@@ -153,32 +179,41 @@ public class SdlManager{
} else {
this.audioStreamManager = null;
}
+
+ if (lockScreenConfig.isEnabled()) {
+ this.lockScreenManager = new LockScreenManager(lockScreenConfig, context, _internalInterface);
+ this.lockScreenManager.start(subManagerListener);
+ }
+
/*
- this.lockscreenManager = new LockscreenManager(lockScreenConfig, context, _internalInterface);
- this.lockscreenManager.start(subManagerListener);
this.screenManager = new ScreenManager(_internalInterface, this.fileManager);
this.screenManager.start(subManagerListener);
- this.videoStreamingManager = new VideoStreamingManager(context, _internalInterface);
- this.videoStreamingManager.start(subManagerListener);
-
*/
}
- private void dispose() {
+ public void dispose() {
this.permissionManager.dispose();
+ if(this.videoStreamingManager != null) {
+ this.videoStreamingManager.dispose();
+ }
this.fileManager.dispose();
+ if (this.lockScreenManager != null) {
+ this.lockScreenManager.dispose();
+ }
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
if (this.audioStreamManager != null) {
this.audioStreamManager.dispose();
}
}
- /*
- this.lockscreenManager.dispose();
+ /*
this.screenManager.dispose();
- this.videoStreamingManager.dispose();
*/
+ if(managerListener != null){
+ managerListener.onDestroy();
+ managerListener = null;
+ }
}
/**
@@ -195,15 +230,18 @@ public class SdlManager{
SdlManager sdlManager;
/**
- * Main Builder for SDL Manager<br>
- *
- * The following setters are <strong>REQUIRED:</strong><br>
- *
- * • setAppId <br>
- * • setAppName
+ * Builder for the SdlManager. Parameters in the constructor are required.
+ * @param context the current context
+ * @param appId the app's ID
+ * @param appName the app's name
+ * @param listener a SdlManagerListener object
*/
- public Builder(){
+ public Builder(@NonNull Context context, @NonNull final String appId, @NonNull final String appName, @NonNull final SdlManagerListener listener){
sdlManager = new SdlManager();
+ setContext(context);
+ setAppId(appId);
+ setAppName(appName);
+ setManagerListener(listener);
}
/**
@@ -260,11 +298,24 @@ public class SdlManager{
return this;
}
- /*
+ /**
+ * Sets the LockScreenConfig for the session. <br>
+ * <strong>Note: If not set, the default configuration will be used.</strong>
+ * @param lockScreenConfig - configuration options
+ */
public Builder setLockScreenConfig (final LockScreenConfig lockScreenConfig){
sdlManager.lockScreenConfig = lockScreenConfig;
return this;
- }*/
+ }
+
+ /**
+ * Sets the icon for the app on HU <br>
+ * @param sdlArtwork
+ */
+ public Builder setAppIcon(final SdlArtwork sdlArtwork){
+ sdlManager.appIcon = sdlArtwork;
+ return this;
+ }
/**
* Sets the vector of AppHMIType <br>
@@ -319,7 +370,17 @@ public class SdlManager{
return this;
}
+ /**
+ * Set the SdlManager Listener
+ * @param listener the listener
+ */
+ public Builder setManagerListener(@NonNull final SdlManagerListener listener){
+ sdlManager.managerListener = listener;
+ return this;
+ }
+
public SdlManager build() {
+
if (sdlManager.appName == null) {
throw new IllegalArgumentException("You must specify an app name by calling setAppName");
}
@@ -328,6 +389,10 @@ public class SdlManager{
throw new IllegalArgumentException("You must specify an app ID by calling setAppId");
}
+ if (sdlManager.managerListener == null) {
+ throw new IllegalArgumentException("You must set a SdlManagerListener object");
+ }
+
if (sdlManager.hmiTypes == null) {
Vector<AppHMIType> hmiTypesDefault = new Vector<>();
hmiTypesDefault.add(AppHMIType.DEFAULT);
@@ -335,6 +400,11 @@ public class SdlManager{
sdlManager.isMediaApp = false;
}
+ if (sdlManager.lockScreenConfig == null){
+ // if lock screen params are not set, use default
+ sdlManager.lockScreenConfig = new LockScreenConfig();
+ }
+
if (sdlManager.hmiLanguage == null){
sdlManager.hmiLanguage = Language.EN_US;
}
@@ -350,6 +420,7 @@ public class SdlManager{
throw new IllegalStateException("SdlManager is not ready for use, be sure to initialize with start() method, implement callback, and use SubManagers in the SdlManager's callback");
}
}
+
// MANAGER GETTERS
/**
@@ -373,17 +444,17 @@ public class SdlManager{
}
- /**
- * Gets the VideoStreamingManager. <br>
- * <strong>Note: VideoStreamingManager should be used only after SdlManager.start() CompletionListener callback is completed successfully.</strong>
- * @return a VideoStreamingManager object
- */
- /*
+ /**
+ * Gets the VideoStreamingManager. <br>
+ * <strong>Note: VideoStreamingManager should be used only after SdlManager.start() CompletionListener callback is completed successfully.</strong>
+ * @return a VideoStreamingManager object
+ */
+
public VideoStreamingManager getVideoStreamingManager() {
checkSdlManagerState();
return videoStreamingManager;
}
- */
+
/**
* Gets the AudioStreamManager. <br>
@@ -395,11 +466,11 @@ public class SdlManager{
return audioStreamManager;
}
- /**
- * Gets the ScreenManager. <br>
- * <strong>Note: ScreenManager should be used only after SdlManager.start() CompletionListener callback is completed successfully.</strong>
- * @return a ScreenManager object
- */
+ /**
+ * Gets the ScreenManager. <br>
+ * <strong>Note: ScreenManager should be used only after SdlManager.start() CompletionListener callback is completed successfully.</strong>
+ * @return a ScreenManager object
+ */
/*
public ScreenManager getScreenManager() {
checkSdlManagerState();
@@ -407,17 +478,25 @@ public class SdlManager{
}
*/
- /**
- * Gets the LockScreenManager. <br>
- * <strong>Note: LockScreenManager should be used only after SdlManager.start() CompletionListener callback is completed successfully.</strong>
- * @return a LockScreenManager object
- */
- /*
- public LockscreenManager getLockscreenManager() {
+ /**
+ * Gets the LockScreenManager. <br>
+ * <strong>Note: LockScreenManager should be used only after SdlManager.start() CompletionListener callback is completed successfully.</strong>
+ * @return a LockScreenManager object
+ */
+ public LockScreenManager getLockScreenManager() {
checkSdlManagerState();
- return lockscreenManager;
+ return lockScreenManager;
+ }
+
+
+ /**
+ * Gets the SystemCapabilityManager. <br>
+ * <strong>Note: SystemCapabilityManager should be used only after SdlManager.start() CompletionListener callback is completed successfully.</strong>
+ * @return a SystemCapabilityManager object
+ */
+ public SystemCapabilityManager getSystemCapabilityManager(){
+ return proxy.getSystemCapabilityManager();
}
- */
// PROTECTED GETTERS
@@ -442,6 +521,8 @@ public class SdlManager{
protected BaseTransportConfig getTransport() { return transport; }
+ protected LockScreenConfig getLockScreenConfig() { return lockScreenConfig; }
+
// SENDING REQUESTS
/**
@@ -509,26 +590,41 @@ public class SdlManager{
}
}
+ /**
+ * Add an OnRPCNotificationListener
+ * @param listener listener that will be called when a notification is received
+ */
+ public void addOnRPCNotificationListener(FunctionID notificationId, OnRPCNotificationListener listener){
+ proxy.addOnRPCNotificationListener(notificationId,listener);
+ }
+
+ /**
+ * Remove an OnRPCNotificationListener
+ * @param listener listener that was previously added
+ */
+ public void removeOnRPCNotificationListener(FunctionID notificationId, OnRPCNotificationListener listener){
+ proxy.removeOnRPCNotificationListener(notificationId, listener);
+ }
+
// LIFECYCLE / OTHER
// STARTUP
/**
* Starts up a SdlManager, and calls provided callback called once all BaseSubManagers are done setting up
- * @param listener CompletionListener that is called once the SdlManager state transitions
- * from SETTING_UP to READY or ERROR
*/
@SuppressWarnings("unchecked")
- public void start(@NonNull CompletionListener listener){
- initListener = listener;
+ public void start(){
if (proxy == null) {
try {
- proxy = new SdlProxyBase(proxyBridge, appName, shortAppName, isMediaApp, hmiLanguage,
+ proxy = new SdlProxyBase(proxyBridge, context, appName, shortAppName, isMediaApp, hmiLanguage,
hmiLanguage, hmiTypes, appId, transport, vrSynonyms, ttsChunks, dayColorScheme,
nightColorScheme) {
};
} catch (SdlException e) {
- listener.onComplete(false);
+ if (managerListener != null) {
+ managerListener.onError("Unable to start manager", e);
+ }
}
}
}
@@ -594,7 +690,7 @@ public class SdlManager{
@Override
public void startAudioService(boolean isEncrypted, AudioStreamingCodec codec,
- AudioStreamingParams params) {
+ AudioStreamingParams params) {
if(proxy.getIsConnected()){
proxy.startAudioStream(isEncrypted, codec, params);
}
@@ -609,7 +705,7 @@ public class SdlManager{
@Override
public IAudioStreamListener startAudioStream(boolean isEncrypted, AudioStreamingCodec codec,
- AudioStreamingParams params) {
+ AudioStreamingParams params) {
return proxy.startAudioStream(isEncrypted, codec, params);
}
@@ -649,6 +745,16 @@ public class SdlManager{
}
@Override
+ public void addOnRPCListener(final FunctionID responseId, final OnRPCListener listener) {
+ proxyBridge.addRpcListener(responseId, listener);
+ }
+
+ @Override
+ public boolean removeOnRPCListener(final FunctionID responseId, final OnRPCListener listener) {
+ return proxyBridge.removeOnRPCListener(responseId, listener);
+ }
+
+ @Override
public Object getCapability(SystemCapabilityType systemCapabilityType){
return proxy.getCapability(systemCapabilityType);
}
@@ -664,6 +770,16 @@ public class SdlManager{
}
@Override
+ public void addOnSystemCapabilityListener(SystemCapabilityType systemCapabilityType, OnSystemCapabilityListener listener) {
+ proxy.addOnSystemCapabilityListener(systemCapabilityType, listener);
+ }
+
+ @Override
+ public boolean removeOnSystemCapabilityListener(SystemCapabilityType systemCapabilityType, OnSystemCapabilityListener listener) {
+ return proxy.removeOnSystemCapabilityListener(systemCapabilityType, listener);
+ }
+
+ @Override
public SdlMsgVersion getSdlMsgVersion(){
try {
return proxy.getSdlMsgVersion();
@@ -672,6 +788,12 @@ public class SdlManager{
}
return null;
}
+
+ @Override
+ public byte getWiProVersion() {
+ return proxy.getWiProVersion();
+ }
+
};
}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/api/SdlManagerListener.java b/sdl_android/src/main/java/com/smartdevicelink/api/SdlManagerListener.java
new file mode 100644
index 000000000..7349ab645
--- /dev/null
+++ b/sdl_android/src/main/java/com/smartdevicelink/api/SdlManagerListener.java
@@ -0,0 +1,21 @@
+package com.smartdevicelink.api;
+
+public interface SdlManagerListener {
+
+ /**
+ * Called when a manager is ready for use
+ */
+ void onStart();
+
+ /**
+ * Called when the manager is destroyed
+ */
+ void onDestroy();
+
+ /**
+ * Called when the manager encounters an error
+ * @param info info regarding the error
+ * @param e the exception
+ */
+ void onError(String info, Exception e);
+}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/api/StreamingStateMachine.java b/sdl_android/src/main/java/com/smartdevicelink/api/StreamingStateMachine.java
index 7207dd7d0..04c99e93c 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/api/StreamingStateMachine.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/api/StreamingStateMachine.java
@@ -1,72 +1,72 @@
-package com.smartdevicelink.api;
-
-import android.support.annotation.IntDef;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-public class StreamingStateMachine {
- @IntDef({NONE, READY, STARTED, STOPPED, ERROR})
- @Retention(RetentionPolicy.SOURCE)
- public @interface StreamingState {}
- public static final int NONE = 0x00, READY = 0x30, STARTED = 0x60, STOPPED = 0x90, ERROR = 0xC0;
-
- private @StreamingState int state = NONE;
- private final Object STATE_LOCK = new Object();
-
- public StreamingStateMachine(){}
-
- public void transitionToState(int state) {
- if(state != NONE && state != READY && state != STARTED
- && state != STOPPED && state != ERROR) {
- return;
- }
- synchronized (STATE_LOCK) {
- if(isValidTransition(this.state, state)){
- this.state = state;
- }
- }
- }
-
- public @StreamingState int getState() {
- synchronized (STATE_LOCK) {
- return state;
- }
- }
-
- private boolean isValidTransition(int prev_state, int next_state){
- if(prev_state == next_state){
- return false;
- }
- switch (prev_state){
- case NONE:
- if((next_state == READY) || (next_state == ERROR)){
- return true;
- }
- break;
- case READY:
- if((next_state == STARTED) || (next_state == ERROR)){
- return true;
- }
- break;
- case STARTED:
- if((next_state == STOPPED) || (next_state == ERROR)){
- return true;
- }
- break;
- case STOPPED:
- if((next_state == STARTED) || (next_state == NONE)){
- return true;
- }
- break;
- case ERROR:
- if(next_state == NONE){
- return true;
- }
- break;
- default:
- break;
- }
- return false;
- }
+package com.smartdevicelink.api;
+
+import android.support.annotation.IntDef;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+public class StreamingStateMachine {
+ @IntDef({NONE, READY, STARTED, STOPPED, ERROR})
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface StreamingState {}
+ public static final int NONE = 0x00, READY = 0x30, STARTED = 0x60, STOPPED = 0x90, ERROR = 0xC0;
+
+ private @StreamingState int state = NONE;
+ private final Object STATE_LOCK = new Object();
+
+ public StreamingStateMachine(){}
+
+ public void transitionToState(int state) {
+ if(state != NONE && state != READY && state != STARTED
+ && state != STOPPED && state != ERROR) {
+ return;
+ }
+ synchronized (STATE_LOCK) {
+ if(isValidTransition(this.state, state)){
+ this.state = state;
+ }
+ }
+ }
+
+ public @StreamingState int getState() {
+ synchronized (STATE_LOCK) {
+ return state;
+ }
+ }
+
+ private boolean isValidTransition(int prev_state, int next_state){
+ if(prev_state == next_state){
+ return false;
+ }
+ switch (prev_state){
+ case NONE:
+ if((next_state == READY) || (next_state == ERROR)){
+ return true;
+ }
+ break;
+ case READY:
+ if((next_state == STARTED) || (next_state == ERROR)){
+ return true;
+ }
+ break;
+ case STARTED:
+ if((next_state == STOPPED) || (next_state == ERROR)){
+ return true;
+ }
+ break;
+ case STOPPED:
+ if((next_state == STARTED) || (next_state == NONE)){
+ return true;
+ }
+ break;
+ case ERROR:
+ if(next_state == NONE){
+ return true;
+ }
+ break;
+ default:
+ break;
+ }
+ return false;
+ }
} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/api/VideoStreamingManager.java b/sdl_android/src/main/java/com/smartdevicelink/api/VideoStreamingManager.java
new file mode 100644
index 000000000..34a1c17dc
--- /dev/null
+++ b/sdl_android/src/main/java/com/smartdevicelink/api/VideoStreamingManager.java
@@ -0,0 +1,536 @@
+package com.smartdevicelink.api;
+
+import android.annotation.TargetApi;
+import android.content.Context;
+import android.os.SystemClock;
+import android.util.DisplayMetrics;
+import android.util.Log;
+import android.util.SparseIntArray;
+import android.view.Display;
+import android.view.InputDevice;
+import android.view.MotionEvent;
+import android.view.Surface;
+
+import com.smartdevicelink.SdlConnection.SdlSession;
+import com.smartdevicelink.encoder.SdlEncoder;
+import com.smartdevicelink.encoder.VirtualDisplayEncoder;
+import com.smartdevicelink.haptic.HapticInterfaceManager;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.protocol.enums.SessionType;
+import com.smartdevicelink.proxy.RPCNotification;
+import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.proxy.interfaces.ISdlServiceListener;
+import com.smartdevicelink.proxy.interfaces.IVideoStreamListener;
+import com.smartdevicelink.proxy.interfaces.OnSystemCapabilityListener;
+import com.smartdevicelink.proxy.rpc.DisplayCapabilities;
+import com.smartdevicelink.proxy.rpc.ImageResolution;
+import com.smartdevicelink.proxy.rpc.OnHMIStatus;
+import com.smartdevicelink.proxy.rpc.OnTouchEvent;
+import com.smartdevicelink.proxy.rpc.TouchCoord;
+import com.smartdevicelink.proxy.rpc.TouchEvent;
+import com.smartdevicelink.proxy.rpc.VideoStreamingCapability;
+import com.smartdevicelink.proxy.rpc.enums.HMILevel;
+import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType;
+import com.smartdevicelink.proxy.rpc.enums.TouchType;
+import com.smartdevicelink.proxy.rpc.listeners.OnRPCNotificationListener;
+import com.smartdevicelink.streaming.video.SdlRemoteDisplay;
+import com.smartdevicelink.streaming.video.VideoStreamingParameters;
+
+import java.lang.ref.WeakReference;
+import java.util.List;
+import java.util.concurrent.FutureTask;
+
+@TargetApi(19)
+public class VideoStreamingManager extends BaseSubManager{
+ private static String TAG = "VideoStreamingManager";
+
+ private WeakReference<Context> context;
+ private volatile VirtualDisplayEncoder virtualDisplayEncoder;
+ private Class<? extends SdlRemoteDisplay> remoteDisplayClass = null;
+ private SdlRemoteDisplay remoteDisplay;
+ private float[] touchScalar = {1.0f,1.0f}; //x, y
+ private HapticInterfaceManager hapticManager;
+ private SdlMotionEvent sdlMotionEvent = null;
+ private HMILevel hmiLevel;
+ private StreamingStateMachine stateMachine;
+ private VideoStreamingParameters parameters;
+ private IVideoStreamListener streamListener;
+
+ // INTERNAL INTERFACES
+
+ private final ISdlServiceListener serviceListener = new ISdlServiceListener() {
+ @Override
+ public void onServiceStarted(SdlSession session, SessionType type, boolean isEncrypted) {
+ if(SessionType.NAV.equals(type)){
+ stateMachine.transitionToState(StreamingStateMachine.READY);
+ }
+ }
+
+ @Override
+ public void onServiceEnded(SdlSession session, SessionType type) {
+ if(SessionType.NAV.equals(type)){
+ stateMachine.transitionToState(StreamingStateMachine.NONE);
+ if(remoteDisplay!=null){
+ stopStreaming();
+ }
+ }
+ }
+
+ @Override
+ public void onServiceError(SdlSession session, SessionType type, String reason) {
+ stateMachine.transitionToState(StreamingStateMachine.ERROR);
+ transitionToState(BaseSubManager.ERROR);
+ }
+ };
+
+ private final OnRPCNotificationListener hmiListener = new OnRPCNotificationListener() {
+ @Override
+ public void onNotified(RPCNotification notification) {
+ if(notification != null){
+ hmiLevel = ((OnHMIStatus)notification).getHmiLevel();
+ }
+ }
+ };
+
+ private final OnRPCNotificationListener touchListener = new OnRPCNotificationListener() {
+ @Override
+ public void onNotified(RPCNotification notification) {
+ if(notification != null && remoteDisplay != null){
+ MotionEvent event = convertTouchEvent((OnTouchEvent)notification);
+ if(event!=null){
+ remoteDisplay.handleMotionEvent(event);
+ }
+ }
+ }
+ };
+
+ // MANAGER APIs
+
+ public VideoStreamingManager(ISdl internalInterface){
+ super(internalInterface);
+
+ virtualDisplayEncoder = new VirtualDisplayEncoder();
+ hmiLevel = HMILevel.HMI_NONE;
+
+ // Listen for video service events
+ internalInterface.addServiceListener(SessionType.NAV, serviceListener);
+ // Take care of the touch events
+ internalInterface.addOnRPCNotificationListener(FunctionID.ON_TOUCH_EVENT, touchListener);
+ // Listen for HMILevel changes
+ internalInterface.addOnRPCNotificationListener(FunctionID.ON_HMI_STATUS, hmiListener);
+
+ stateMachine = new StreamingStateMachine();
+ transitionToState(BaseSubManager.READY);
+ }
+
+ /**
+ * Starts streaming a remote display to the module if there is a connected session. This method of streaming requires the device to be on API level 19 or higher
+ * @param context a context that can be used to create the remote display
+ * @param remoteDisplayClass class object of the remote display. This class will be used to create an instance of the remote display and will be projected to the module
+ * @param parameters streaming parameters to be used when streaming. If null is sent in, the default/optimized options will be used.
+ * If you are unsure about what parameters to be used it is best to just send null and let the system determine what
+ * works best for the currently connected module.
+ *
+ * @param encrypted a flag of if the stream should be encrypted. Only set if you have a supplied encryption library that the module can understand.
+ */
+ public void startRemoteDisplayStream(Context context, Class<? extends SdlRemoteDisplay> remoteDisplayClass, VideoStreamingParameters parameters, final boolean encrypted){
+ this.context = new WeakReference<>(context);
+ this.remoteDisplayClass = remoteDisplayClass;
+ 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.getWiProVersion() >= 5) {
+ internalInterface.getCapability(SystemCapabilityType.VIDEO_STREAMING, new OnSystemCapabilityListener() {
+ @Override
+ public void onCapabilityRetrieved(Object capability) {
+ VideoStreamingParameters params = new VideoStreamingParameters();
+ params.update((VideoStreamingCapability)capability); //Streaming parameters are ready time to stream
+ startStreaming(params, encrypted);
+ }
+
+ @Override
+ public void onError(String info) {
+ stateMachine.transitionToState(StreamingStateMachine.ERROR);
+ Log.e(TAG, "Error retrieving video streaming capability: " + info);
+ }
+ });
+ }else{
+ //We just use default video streaming params
+ VideoStreamingParameters params = new VideoStreamingParameters();
+ DisplayCapabilities dispCap = (DisplayCapabilities)internalInterface.getCapability(SystemCapabilityType.DISPLAY);
+ if(dispCap !=null){
+ params.setResolution(dispCap.getScreenParams().getImageResolution());
+ }
+ startStreaming(params, encrypted);
+ }
+ }else{
+ startStreaming(parameters, encrypted);
+ }
+ }
+
+ /**
+ * Opens a video service (service type 11) and subsequently provides an IVideoStreamListener
+ * to the app to send video data. The supplied VideoStreamingParameters will be set as desired paramaters
+ * that will be used to negotiate
+ *
+ * @param parameters Video streaming parameters including: codec which will be used for streaming (currently, only
+ * VideoStreamingCodec.H264 is accepted), height and width of the video in pixels.
+ * @param encrypted Specify true if packets on this service have to be encrypted
+ *
+ * @return IVideoStreamListener interface if service is opened successfully and streaming is
+ * started, null otherwise
+ */
+ protected IVideoStreamListener startVideoService(VideoStreamingParameters parameters, boolean encrypted){
+ if(hmiLevel != HMILevel.HMI_FULL){
+ Log.e(TAG, "Cannot start video service if HMILevel is not FULL.");
+ return null;
+ }
+ IVideoStreamListener listener = internalInterface.startVideoStream(encrypted, parameters);
+ if(listener != null){
+ stateMachine.transitionToState(StreamingStateMachine.STARTED);
+ }else{
+ stateMachine.transitionToState(StreamingStateMachine.ERROR);
+ }
+ return listener;
+ }
+
+ /**
+ * Starts video service, sets up encoder, haptic manager, and remote display. Begins streaming the remote display.
+ * @param parameters Video streaming parameters including: codec which will be used for streaming (currently, only
+ * VideoStreamingCodec.H264 is accepted), height and width of the video in pixels.
+ * @param encrypted Specify true if packets on this service have to be encrypted
+ */
+ private void startStreaming(VideoStreamingParameters parameters, boolean encrypted){
+ this.parameters = parameters;
+ this.streamListener = startVideoService(parameters, encrypted);
+ if(streamListener == null){
+ Log.e(TAG, "Error starting video service");
+ stateMachine.transitionToState(StreamingStateMachine.ERROR);
+ return;
+ }
+ VideoStreamingCapability capability = (VideoStreamingCapability) internalInterface.getCapability(SystemCapabilityType.VIDEO_STREAMING);
+ if(capability != null && capability.getIsHapticSpatialDataSupported()){
+ hapticManager = new HapticInterfaceManager(internalInterface);
+ }
+ startEncoder();
+ }
+
+ /**
+ * Initializes and starts the virtual display encoder and creates the remote display
+ */
+ private void startEncoder(){
+ try {
+ virtualDisplayEncoder.init(this.context.get(), streamListener, parameters);
+ //We are all set so we can start streaming at at this point
+ virtualDisplayEncoder.start();
+ //Encoder should be up and running
+ createRemoteDisplay(virtualDisplayEncoder.getVirtualDisplay());
+ stateMachine.transitionToState(StreamingStateMachine.STARTED);
+ } catch (Exception e) {
+ stateMachine.transitionToState(StreamingStateMachine.ERROR);
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Stops streaming from the remote display. To restart, call
+ * @see #resumeStreaming()
+ */
+ public void stopStreaming(){
+ if(remoteDisplay!=null){
+ remoteDisplay.stop();
+ }
+ if(virtualDisplayEncoder!=null){
+ virtualDisplayEncoder.shutDown();
+ }
+ stateMachine.transitionToState(StreamingStateMachine.STOPPED);
+ }
+
+ /**
+ * Resumes streaming after calling
+ * @see #startRemoteDisplayStream(android.content.Context, Class, com.smartdevicelink.streaming.video.VideoStreamingParameters, boolean)
+ * followed by a call to
+ * @see #stopStreaming()
+ */
+ public void resumeStreaming(){
+ if(stateMachine.getState() != StreamingStateMachine.STOPPED){
+ return;
+ }
+ startEncoder();
+ }
+
+ /**
+ * Stops streaming, ends video streaming service and removes service listeners.
+ */
+ public void dispose(){
+ stopStreaming();
+
+ hapticManager = null;
+ remoteDisplay = null;
+ parameters = null;
+ virtualDisplayEncoder = null;
+ if(internalInterface!=null){
+ internalInterface.stopVideoService();
+ }
+
+ // Remove listeners
+ internalInterface.removeServiceListener(SessionType.NAV, serviceListener);
+ internalInterface.removeOnRPCNotificationListener(FunctionID.ON_TOUCH_EVENT, touchListener);
+ internalInterface.removeOnRPCNotificationListener(FunctionID.ON_HMI_STATUS, hmiListener);
+
+ stateMachine.transitionToState(StreamingStateMachine.NONE);
+ }
+
+ // PUBLIC METHODS FOR CHECKING STATE
+
+ /**
+ * Check if a video service is currently active
+ * @return boolean (true = active, false = inactive)
+ */
+ public boolean isServiceActive(){
+ return (stateMachine.getState() == StreamingStateMachine.READY) ||
+ (stateMachine.getState() == StreamingStateMachine.STARTED) ||
+ (stateMachine.getState() == StreamingStateMachine.STOPPED);
+ }
+
+ /**
+ * Check if video is currently streaming and visible
+ * @return boolean (true = yes, false = no)
+ */
+ public boolean isStreaming(){
+ return (stateMachine.getState() == StreamingStateMachine.STARTED) ||
+ (hmiLevel == HMILevel.HMI_FULL);
+ }
+
+ /**
+ * Check if video streaming has been paused due to app moving to background or manually stopped
+ * @return boolean (true = not paused, false = paused)
+ */
+ public boolean isPaused(){
+ return (stateMachine.getState() == StreamingStateMachine.STARTED) ||
+ (hmiLevel != HMILevel.HMI_FULL);
+ }
+
+ /**
+ * Gets the current video streaming state as defined in @StreamingStateMachine
+ * @return int representing StreamingStateMachine.StreamingState
+ */
+ public @StreamingStateMachine.StreamingState int currentVideoStreamState(){
+ return stateMachine.getState();
+ }
+
+ // HELPER METHODS
+
+ private void createRemoteDisplay(final Display disp){
+ try{
+ if (disp == null){
+ return;
+ }
+
+ // Dismiss the current presentation if the display has changed.
+ if (remoteDisplay != null && remoteDisplay.getDisplay() != disp) {
+ remoteDisplay.dismissPresentation();
+ }
+
+ FutureTask<Boolean> fTask = new FutureTask<Boolean>( new SdlRemoteDisplay.Creator(context.get(), disp, remoteDisplay, remoteDisplayClass, new SdlRemoteDisplay.Callback(){
+ @Override
+ public void onCreated(final SdlRemoteDisplay remoteDisplay) {
+ //Remote display has been created.
+ //Now is a good time to do parsing for spatial data
+ VideoStreamingManager.this.remoteDisplay = remoteDisplay;
+ if(hapticManager != null) {
+ remoteDisplay.getMainView().post(new Runnable() {
+ @Override
+ public void run() {
+ hapticManager.refreshHapticData(remoteDisplay.getMainView());
+ }
+ });
+ }
+ //Get touch scalars
+ ImageResolution resolution = null;
+ 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 {
+ DisplayCapabilities dispCap = (DisplayCapabilities) internalInterface.getCapability(SystemCapabilityType.DISPLAY);
+ if (dispCap != null) {
+ resolution = (dispCap.getScreenParams().getImageResolution());
+ }
+ }
+ if(resolution != null){
+ DisplayMetrics displayMetrics = new DisplayMetrics();
+ disp.getMetrics(displayMetrics);
+ touchScalar[0] = ((float)displayMetrics.widthPixels) / resolution.getResolutionWidth();
+ touchScalar[1] = ((float)displayMetrics.heightPixels) / resolution.getResolutionHeight();
+ }
+
+ }
+
+ @Override
+ public void onInvalidated(final SdlRemoteDisplay remoteDisplay) {
+ //Our view has been invalidated
+ //A good time to refresh spatial data
+ if(hapticManager != null) {
+ remoteDisplay.getMainView().post(new Runnable() {
+ @Override
+ public void run() {
+ hapticManager.refreshHapticData(remoteDisplay.getMainView());
+ }
+ });
+ }
+ }
+ } ));
+ Thread showPresentation = new Thread(fTask);
+
+ showPresentation.start();
+ } catch (Exception ex) {
+ Log.e(TAG, "Unable to create Virtual Display.");
+ }
+ }
+
+ protected MotionEvent convertTouchEvent(OnTouchEvent touchEvent){
+ List<TouchEvent> eventList = touchEvent.getEvent();
+ if (eventList == null || eventList.size() == 0) return null;
+
+ TouchType touchType = touchEvent.getType();
+ if (touchType == null){ return null;}
+
+ int eventListSize = eventList.size();
+
+ MotionEvent.PointerProperties[] pointerProperties = new MotionEvent.PointerProperties[eventListSize];
+ MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[eventListSize];
+
+ TouchEvent event;
+ MotionEvent.PointerProperties properties;
+ MotionEvent.PointerCoords coords;
+ TouchCoord touchCoord;
+
+ for(int i = 0; i < eventListSize; i++){
+ event = eventList.get(i);
+ if(event == null || event.getId() == null || event.getTouchCoordinates() == null){
+ continue;
+ }
+
+ properties = new MotionEvent.PointerProperties();
+ properties.id = event.getId();
+ properties.toolType = MotionEvent.TOOL_TYPE_FINGER;
+
+
+ List<TouchCoord> coordList = event.getTouchCoordinates();
+ if (coordList == null || coordList.size() == 0){ continue; }
+
+ touchCoord = coordList.get(coordList.size() -1);
+ if(touchCoord == null){ continue; }
+
+ coords = new MotionEvent.PointerCoords();
+ coords.x = touchCoord.getX() * touchScalar[0];
+ coords.y = touchCoord.getY() * touchScalar[1];
+ coords.orientation = 0;
+ coords.pressure = 1.0f;
+ coords.size = 1;
+
+ //Add the info to lists only after we are sure we have all available info
+ pointerProperties[i] = properties;
+ pointerCoords[i] = coords;
+
+ }
+
+
+ if(sdlMotionEvent == null) {
+ if (touchType == TouchType.BEGIN) {
+ sdlMotionEvent = new SdlMotionEvent();
+ }else{
+ return null;
+ }
+ }
+
+ int eventAction = sdlMotionEvent.getMotionEvent(touchType, pointerProperties);
+ long startTime = sdlMotionEvent.startOfEvent;
+
+ //If the motion event should be finished we should clear our reference
+ if(eventAction == MotionEvent.ACTION_UP || eventAction == MotionEvent.ACTION_CANCEL){
+ sdlMotionEvent = null;
+ }
+
+ return MotionEvent.obtain(startTime, SystemClock.uptimeMillis(), eventAction, eventListSize, pointerProperties, pointerCoords, 0, 0,1,1,0,0, InputDevice.SOURCE_TOUCHSCREEN,0);
+ }
+
+ /**
+ * Keeps track of the current motion event for VPM
+ */
+ private static class SdlMotionEvent{
+ long startOfEvent;
+ SparseIntArray pointerStatuses = new SparseIntArray();
+
+ SdlMotionEvent(){
+ startOfEvent = SystemClock.uptimeMillis();
+ }
+
+ /**
+ * Handles the SDL Touch Event to keep track of pointer status and returns the appropirate
+ * Android MotionEvent according to this events status
+ * @param touchType The SDL TouchType that was received from the module
+ * @param pointerProperties the parsed pointer properties built from the OnTouchEvent RPC
+ * @return the correct native Andorid MotionEvent action to dispatch
+ */
+ synchronized int getMotionEvent(TouchType touchType, MotionEvent.PointerProperties[] pointerProperties){
+ int motionEvent = MotionEvent.ACTION_DOWN;
+ switch (touchType){
+ case BEGIN:
+ if(pointerStatuses.size() == 0){
+ //The motion event has just begun
+ motionEvent = MotionEvent.ACTION_DOWN;
+ }else{
+ motionEvent = MotionEvent.ACTION_POINTER_DOWN;
+ }
+ setPointerStatuses(motionEvent, pointerProperties);
+ break;
+ case MOVE:
+ motionEvent = MotionEvent.ACTION_MOVE;
+ setPointerStatuses(motionEvent, pointerProperties);
+
+ break;
+ case END:
+ //Clears out pointers that have ended
+ setPointerStatuses(MotionEvent.ACTION_UP, pointerProperties);
+
+ if(pointerStatuses.size() == 0){
+ //The motion event has just ended
+ motionEvent = MotionEvent.ACTION_UP;
+ }else{
+ motionEvent = MotionEvent.ACTION_POINTER_UP;
+ }
+ break;
+ case CANCEL:
+ //Assuming this cancels the entire event
+ motionEvent = MotionEvent.ACTION_CANCEL;
+ pointerStatuses.clear();
+ break;
+ default:
+ break;
+ }
+ return motionEvent;
+ }
+
+ private void setPointerStatuses(int motionEvent, MotionEvent.PointerProperties[] pointerProperties){
+
+ for(int i = 0; i < pointerProperties.length; i ++){
+ MotionEvent.PointerProperties properties = pointerProperties[i];
+ if(properties != null){
+ if(motionEvent == MotionEvent.ACTION_UP || motionEvent == MotionEvent.ACTION_POINTER_UP){
+ pointerStatuses.delete(properties.id);
+ }else if(motionEvent == MotionEvent.ACTION_DOWN && properties.id == 0){
+ pointerStatuses.put(properties.id, MotionEvent.ACTION_DOWN);
+ }else{
+ pointerStatuses.put(properties.id, motionEvent);
+ }
+
+ }
+ }
+ }
+ }
+
+} \ No newline at end of file
diff --git a/sdl_android/src/main/java/com/smartdevicelink/api/lockscreen/LockScreenConfig.java b/sdl_android/src/main/java/com/smartdevicelink/api/lockscreen/LockScreenConfig.java
new file mode 100644
index 000000000..43445ec52
--- /dev/null
+++ b/sdl_android/src/main/java/com/smartdevicelink/api/lockscreen/LockScreenConfig.java
@@ -0,0 +1,114 @@
+package com.smartdevicelink.api.lockscreen;
+
+/**
+ * <strong>LockScreenConfig</strong> <br>
+ *
+ * This is set during SdlManager instantiation. <br>
+ *
+ * <li> enable - if false, don't worry about the other parameters. You are responsible for creating and managing a lockscreen.
+ * If true, also set the backgroundColor and appIcon if you want. If you don't set the backgroundColor or appIcon, it will use the defaults.</li>
+ *
+ * <li> backgroundColor - if using the default lockscreen, you can set this to a color of your choosing </li>
+ *
+ * <li> appIcon - if using the default lockscreen, you can set your own app icon</li>
+ *
+ * <li> customView - If you would like to provide your own view, you can pass it in here.</li>
+ */
+public class LockScreenConfig {
+
+ private boolean enable, deviceLogo;
+ private int backgroundColor, appIconInt, customViewInt;
+
+ public LockScreenConfig(){
+ // set default values
+ this.enable = true;
+ this.deviceLogo = false;
+ }
+
+ /**
+ * If set to true, SDL will manage the showing and dismissing of the lock screen for you. <br>
+ *
+ * If false, you must manage the lock screen
+ * @param enable boolean
+ */
+ public void setEnabled(boolean enable){
+ this.enable = enable;
+ }
+
+ /**
+ * Gets whether the lock screen is being managed for you
+ * @return boolean
+ */
+ public boolean isEnabled() {
+ return enable;
+ }
+
+ /**
+ * Set the resource int of the background color. Colors should define colors in your Colors.xml file
+ * @param resourceColor resource int of the color
+ */
+ public void setBackgroundColor(int resourceColor){
+ this.backgroundColor = resourceColor;
+ }
+
+ /**
+ * Gets the int reference to the custom lock screen background color
+ * @return the color reference
+ */
+ public int getBackgroundColor() {
+ return backgroundColor;
+ }
+
+ /**
+ * int of the drawable icon.
+ * @param appIconInt the drawable of the icon to be displayed on the lock screen
+ */
+ public void setAppIcon(int appIconInt) {
+ this.appIconInt = appIconInt;
+ }
+
+ /**
+ * Gets the resource reference of the icon to be displayed on the lock screen
+ * @return the icon reference
+ */
+ public int getAppIcon() {
+ return appIconInt;
+ }
+
+ /**
+ * Sets the reference to the custom layout to be used for the lock screen <br>
+ * <strong>If set, the color and icon setters will be ignored</strong>
+ * @param customViewInt the layout
+ */
+ public void setCustomView(int customViewInt) {
+ this.customViewInt = customViewInt;
+ }
+
+ /**
+ * Gets the reference to the custom lockscreen layout to be used
+ * @return the layout reference
+ */
+ public int getCustomView() {
+ return customViewInt;
+ }
+
+ /**
+ * Whether or not to show the device's logo on the default lock screen <br>
+ * The logo will come from the connected hardware, if set by the manufacturer <br>
+ * If using a Custom View, this will be ignored.
+ * @param deviceLogo - boolean
+ */
+ public void showDeviceLogo(boolean deviceLogo) {
+ this.deviceLogo = deviceLogo;
+ }
+
+ /**
+ * Get whether or not the device's Logo is shown on the default lock screen <br>
+ * The logo will come from the connected hardware, if set by the manufacturer <br>
+ * @return deviceLogo - boolean
+ */
+ public boolean isDeviceLogoEnabled() {
+ return deviceLogo;
+ }
+
+}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/api/lockscreen/LockScreenManager.java b/sdl_android/src/main/java/com/smartdevicelink/api/lockscreen/LockScreenManager.java
new file mode 100644
index 000000000..02f15af98
--- /dev/null
+++ b/sdl_android/src/main/java/com/smartdevicelink/api/lockscreen/LockScreenManager.java
@@ -0,0 +1,254 @@
+package com.smartdevicelink.api.lockscreen;
+
+import android.app.ActivityManager;
+import android.content.Context;
+import android.content.Intent;
+import android.graphics.Bitmap;
+import android.os.Build;
+import android.util.Log;
+
+import com.smartdevicelink.api.BaseSubManager;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.proxy.RPCNotification;
+import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.proxy.rpc.OnDriverDistraction;
+import com.smartdevicelink.proxy.rpc.OnHMIStatus;
+import com.smartdevicelink.proxy.rpc.OnSystemRequest;
+import com.smartdevicelink.proxy.rpc.enums.DriverDistractionState;
+import com.smartdevicelink.proxy.rpc.enums.HMILevel;
+import com.smartdevicelink.proxy.rpc.enums.LockScreenStatus;
+import com.smartdevicelink.proxy.rpc.enums.RequestType;
+import com.smartdevicelink.proxy.rpc.listeners.OnRPCNotificationListener;
+import com.smartdevicelink.util.HttpUtils;
+
+import java.io.IOException;
+import java.lang.ref.WeakReference;
+
+/**
+ * <strong>LockscreenManager</strong> <br>
+ *
+ * Note: This class must be accessed through the SdlManager. Do not instantiate it by itself. <br>
+ *
+ * The LockscreenManager handles the logic of showing and hiding the lock screen. <br>
+ *
+ */
+public class LockScreenManager extends BaseSubManager {
+
+ private static final String TAG = "LockScreenManager";
+ private WeakReference<Context> context;
+ private HMILevel hmiLevel;
+ private OnRPCNotificationListener systemRequestListener, ddListener, hmiListener;
+ private String deviceIconUrl;
+ private boolean driverDistStatus;
+ protected boolean lockScreenEnabled, deviceLogoEnabled;
+ protected int lockScreenIcon, lockScreenColor, customView;
+ protected Bitmap deviceLogo;
+
+ public LockScreenManager(LockScreenConfig lockScreenConfig, Context context, ISdl internalInterface){
+
+ super(internalInterface);
+ this.context = new WeakReference<>(context);
+
+ // set initial class variables
+ hmiLevel = HMILevel.HMI_NONE;
+ driverDistStatus = false;
+
+ // setup the manager
+ lockScreenIcon = lockScreenConfig.getAppIcon();
+ lockScreenColor = lockScreenConfig.getBackgroundColor();
+ customView = lockScreenConfig.getCustomView();
+ lockScreenEnabled = lockScreenConfig.isEnabled();
+ deviceLogoEnabled = lockScreenConfig.isDeviceLogoEnabled();
+
+ setupListeners();
+
+ // transition state
+ transitionToState(READY);
+ }
+
+ @Override
+ public void dispose(){
+ // send broadcast to close lock screen if open
+ if (context.get() != null) {
+ context.get().sendBroadcast(new Intent(SDLLockScreenActivity.CLOSE_LOCK_SCREEN_ACTION));
+ }
+ // remove listeners
+ internalInterface.removeOnRPCNotificationListener(FunctionID.ON_HMI_STATUS, hmiListener);
+ internalInterface.removeOnRPCNotificationListener(FunctionID.ON_DRIVER_DISTRACTION, ddListener);
+ if (deviceLogoEnabled) {
+ internalInterface.removeOnRPCNotificationListener(FunctionID.ON_SYSTEM_REQUEST, systemRequestListener);
+ }
+ deviceLogo = null;
+ deviceIconUrl = null;
+
+ // transition state
+ transitionToState(SHUTDOWN);
+ }
+
+ ////
+ // SETUP
+ ////
+
+ /**
+ * Adds 3 listeners that help determine whether or not a lockscreen should be shown.
+ * This will change the variables that we hold in the manager to the newest values and then
+ * usually call launchLockScreenActivity
+ *
+ * 1. ON_HMI_STATUS
+ * 2. ON_DRIVER_DISTRACTION
+ * 3. ON_SYSTEM_REQUEST (used for device Icon Downloading)
+ */
+ private void setupListeners(){
+ // add hmi listener
+ hmiListener = new OnRPCNotificationListener() {
+ @Override
+ public void onNotified(RPCNotification notification) {
+ hmiLevel = ((OnHMIStatus)notification).getHmiLevel();
+ launchLockScreenActivity();
+ }
+ };
+ internalInterface.addOnRPCNotificationListener(FunctionID.ON_HMI_STATUS, hmiListener);
+
+ // set up driver distraction listener
+ ddListener = new OnRPCNotificationListener() {
+ @Override
+ public void onNotified(RPCNotification notification) {
+ // do something with the status
+ if (notification != null) {
+ OnDriverDistraction ddState = (OnDriverDistraction) notification;
+
+ if (ddState.getState() == DriverDistractionState.DD_ON){
+ // launch lock screen
+ driverDistStatus = true;
+ launchLockScreenActivity();
+ }else{
+ // close lock screen
+ driverDistStatus = false;
+ if (context.get() != null) {
+ context.get().sendBroadcast(new Intent(SDLLockScreenActivity.CLOSE_LOCK_SCREEN_ACTION));
+ }
+ }
+ }
+ }
+ };
+ internalInterface.addOnRPCNotificationListener(FunctionID.ON_DRIVER_DISTRACTION, ddListener);
+
+ // set up system request listener
+ if (deviceLogoEnabled) {
+ systemRequestListener = new OnRPCNotificationListener() {
+ @Override
+ public void onNotified(RPCNotification notification) {
+ // do something with the status
+ final OnSystemRequest msg = (OnSystemRequest) notification;
+ if (msg.getRequestType() == RequestType.LOCK_SCREEN_ICON_URL &&
+ msg.getUrl() != null) {
+ // send intent to activity to download icon from core
+ deviceIconUrl = msg.getUrl();
+ downloadDeviceIcon(deviceIconUrl);
+ }
+ }
+ };
+ internalInterface.addOnRPCNotificationListener(FunctionID.ON_SYSTEM_REQUEST, systemRequestListener);
+ }
+ }
+
+ ////
+ // LAUNCH LOCK SCREEN LOGIC
+ ////
+
+ /**
+ * 1. Check if user wants us to manage lock screen
+ * 2. If so, get the HMI level and LockScreenStatus from the method below
+ * 3. Build intent and start the SDLLockScreenActivity
+ *
+ * X. If the status is set to OFF, Send broadcast to close lock screen if it is open
+ */
+ private void launchLockScreenActivity(){
+ // intent to open SDLLockScreenActivity
+ // pass in icon, background color, and custom view
+ if (lockScreenEnabled && isForegrounded() && context.get() != null) {
+ LockScreenStatus status = getLockScreenStatus();
+ if (status == LockScreenStatus.REQUIRED) {
+ Intent showLockScreenIntent = new Intent(context.get(), SDLLockScreenActivity.class);
+ showLockScreenIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+
+ // Extra parameters for customization of the lock screen view
+ showLockScreenIntent.putExtra(SDLLockScreenActivity.LOCKSCREEN_ICON_EXTRA, lockScreenIcon);
+ showLockScreenIntent.putExtra(SDLLockScreenActivity.LOCKSCREEN_COLOR_EXTRA, lockScreenColor);
+ showLockScreenIntent.putExtra(SDLLockScreenActivity.LOCKSCREEN_CUSTOM_VIEW_EXTRA, customView);
+ showLockScreenIntent.putExtra(SDLLockScreenActivity.LOCKSCREEN_DEVICE_LOGO_EXTRA, deviceLogoEnabled);
+ showLockScreenIntent.putExtra(SDLLockScreenActivity.LOCKSCREEN_DEVICE_LOGO_BITMAP, deviceLogo);
+ context.get().startActivity(showLockScreenIntent);
+ } else if (status == LockScreenStatus.OFF) {
+ context.get().sendBroadcast(new Intent(SDLLockScreenActivity.CLOSE_LOCK_SCREEN_ACTION));
+ }
+ }
+ }
+
+ private boolean isForegrounded() {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
+ ActivityManager.RunningAppProcessInfo myProcess = new ActivityManager.RunningAppProcessInfo();
+ ActivityManager.getMyMemoryState(myProcess);
+ return myProcess.importance == ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND;
+ }
+ return true;
+ }
+
+ ////
+ // HELPERS
+ ////
+
+ /**
+ * Step through some logic to determine if we need to show the lock screen or not
+ * This function is usually triggered on some sort of notification.
+ *
+ * @return Whether or not the Lock Screen is required
+ */
+ protected synchronized LockScreenStatus getLockScreenStatus() {
+
+ if ( (hmiLevel == null) || (hmiLevel.equals(HMILevel.HMI_NONE))) {
+ return LockScreenStatus.OFF;
+ }
+ else if ( hmiLevel.equals(HMILevel.HMI_BACKGROUND)) {
+ if (!driverDistStatus) {
+ //we don't have driver distraction, lock screen is entirely based on if user is using the app on the head unit
+ return LockScreenStatus.OFF;
+ } else {
+ return LockScreenStatus.REQUIRED;
+ }
+ }
+ else if ( (hmiLevel.equals(HMILevel.HMI_FULL)) || (hmiLevel.equals(HMILevel.HMI_LIMITED))) {
+ if (!driverDistStatus) {
+ return LockScreenStatus.OPTIONAL;
+ } else {
+ return LockScreenStatus.REQUIRED;
+ }
+ }
+ return LockScreenStatus.OFF;
+ }
+
+ private void downloadDeviceIcon(final String url){
+
+ if (deviceLogo != null || context.get() == null){
+ return;
+ }
+
+ new Thread(new Runnable(){
+ @Override
+ public void run(){
+ try{
+ deviceLogo = HttpUtils.downloadImage(url);
+ Intent intent = new Intent(SDLLockScreenActivity.LOCKSCREEN_DEVICE_LOGO_DOWNLOADED);
+ intent.putExtra(SDLLockScreenActivity.LOCKSCREEN_DEVICE_LOGO_EXTRA, deviceLogoEnabled);
+ intent.putExtra(SDLLockScreenActivity.LOCKSCREEN_DEVICE_LOGO_BITMAP, deviceLogo);
+ if (context.get() != null) {
+ context.get().sendBroadcast(intent);
+ }
+ }catch(IOException e){
+ Log.e(TAG, "device Icon Error Downloading");
+ }
+ }
+ }).start();
+ }
+
+}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/api/lockscreen/SDLLockScreenActivity.java b/sdl_android/src/main/java/com/smartdevicelink/api/lockscreen/SDLLockScreenActivity.java
new file mode 100644
index 000000000..03671035b
--- /dev/null
+++ b/sdl_android/src/main/java/com/smartdevicelink/api/lockscreen/SDLLockScreenActivity.java
@@ -0,0 +1,130 @@
+package com.smartdevicelink.api.lockscreen;
+
+import android.app.Activity;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.graphics.Bitmap;
+
+import android.os.Bundle;
+import android.view.Window;
+import android.widget.ImageView;
+import android.widget.RelativeLayout;
+
+import com.smartdevicelink.R;
+
+public class SDLLockScreenActivity extends Activity {
+
+ private static final String TAG = "SDLLockScreenActivity";
+ public static final String LOCKSCREEN_COLOR_EXTRA = "LOCKSCREEN_COLOR_EXTRA";
+ public static final String LOCKSCREEN_ICON_EXTRA = "LOCKSCREEN_ICON_EXTRA";
+ public static final String LOCKSCREEN_DEVICE_LOGO_EXTRA = "LOCKSCREEN_DEVICE_LOGO_EXTRA";
+ public static final String LOCKSCREEN_DEVICE_LOGO_BITMAP = "LOCKSCREEN_DEVICE_LOGO_BITMAP";
+ public static final String LOCKSCREEN_CUSTOM_VIEW_EXTRA = "LOCKSCREEN_CUSTOM_VIEW_EXTRA";
+ public static final String LOCKSCREEN_DEVICE_LOGO_DOWNLOADED = "LOCKSCREEN_DEVICE_LOGO_DOWNLOADED";
+ public static final String CLOSE_LOCK_SCREEN_ACTION = "CLOSE_LOCK_SCREEN";
+
+ private final BroadcastReceiver lockScreenBroadcastReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ if (intent != null){
+ String action = intent.getAction();
+ if (action != null){
+ if (action.equalsIgnoreCase(CLOSE_LOCK_SCREEN_ACTION)){
+ finish();
+ } else if (action.equalsIgnoreCase(LOCKSCREEN_DEVICE_LOGO_DOWNLOADED)){
+ boolean deviceLogoEnabled = intent.getBooleanExtra(LOCKSCREEN_DEVICE_LOGO_EXTRA, true);
+ Bitmap deviceLogo = intent.getParcelableExtra(LOCKSCREEN_DEVICE_LOGO_BITMAP);
+ if (deviceLogoEnabled && deviceLogo != null){
+ setDeviceLogo(deviceLogo);
+ }
+ }
+ }
+ }
+ }
+ };
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ this.requestWindowFeature(Window.FEATURE_NO_TITLE);
+
+ // set any parameters that came from the lock screen manager
+ initializeActivity(getIntent());
+
+ // create intent filter
+ IntentFilter lockscreenFilter = new IntentFilter();
+ lockscreenFilter.addAction(CLOSE_LOCK_SCREEN_ACTION);
+ lockscreenFilter.addAction(LOCKSCREEN_DEVICE_LOGO_DOWNLOADED);
+
+ // register broadcast receivers
+ registerReceiver(lockScreenBroadcastReceiver, lockscreenFilter);
+ }
+
+ @Override
+ protected void onDestroy() {
+ unregisterReceiver(lockScreenBroadcastReceiver);
+ super.onDestroy();
+ }
+
+ @Override
+ public void onBackPressed() {
+ }
+
+ @Override
+ protected void onNewIntent(Intent intent) {
+ super.onNewIntent(intent);
+ setIntent(intent);
+ }
+
+ public void initializeActivity(Intent intent){
+ if (intent != null){
+ boolean deviceLogoEnabled = intent.getBooleanExtra(LOCKSCREEN_DEVICE_LOGO_EXTRA, true);
+ int customColor = intent.getIntExtra(LOCKSCREEN_COLOR_EXTRA, 0);
+ int customIcon = intent.getIntExtra(LOCKSCREEN_ICON_EXTRA, 0);
+ int customView = intent.getIntExtra(LOCKSCREEN_CUSTOM_VIEW_EXTRA, 0);
+ Bitmap deviceIcon = intent.getParcelableExtra(LOCKSCREEN_DEVICE_LOGO_BITMAP);
+
+ if (customView != 0){
+ setCustomView(customView);
+ } else {
+ setContentView(R.layout.activity_sdllock_screen);
+
+ if (customColor != 0){
+ changeBackgroundColor(customColor);
+ }
+
+ if (customIcon != 0){
+ changeIcon(customIcon);
+ }
+
+ if (deviceLogoEnabled && deviceIcon != null){
+ setDeviceLogo(deviceIcon);
+ }
+ }
+ }
+ }
+
+ private void changeBackgroundColor(int customColor) {
+ RelativeLayout layout = findViewById(R.id.lockscreen_relative_layout);
+ layout.setBackgroundColor(getResources().getColor(customColor));
+ }
+
+ private void changeIcon(int customIcon) {
+ ImageView lockscreen_iv = findViewById(R.id.lockscreen_image);
+ lockscreen_iv.setBackgroundResource(customIcon);
+ }
+
+ private void setDeviceLogo(Bitmap deviceLogo) {
+ ImageView device_iv = findViewById(R.id.device_image);
+ if (deviceLogo != null) {
+ device_iv.setImageBitmap(deviceLogo);
+ }
+ }
+
+ private void setCustomView(int customView) {
+ setContentView(customView);
+ }
+
+}
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 f8a1cb474..0bef4f24c 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBase.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBase.java
@@ -1,31 +1,5 @@
package com.smartdevicelink.proxy;
-import java.io.BufferedReader;
-import java.io.DataOutputStream;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-import java.net.HttpURLConnection;
-import java.net.MalformedURLException;
-import java.net.ProtocolException;
-import java.net.URL;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Vector;
-import java.util.concurrent.Callable;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.concurrent.Executors;
-import java.util.concurrent.FutureTask;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.zip.CRC32;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
import android.annotation.TargetApi;
import android.app.Service;
import android.content.Context;
@@ -51,7 +25,6 @@ import com.smartdevicelink.Dispatcher.ProxyMessageDispatcher;
import com.smartdevicelink.SdlConnection.ISdlConnectionListener;
import com.smartdevicelink.SdlConnection.SdlConnection;
import com.smartdevicelink.SdlConnection.SdlSession;
-import com.smartdevicelink.proxy.rpc.TemplateColorScheme;
import com.smartdevicelink.encoder.VirtualDisplayEncoder;
import com.smartdevicelink.exception.SdlException;
import com.smartdevicelink.exception.SdlExceptionCause;
@@ -101,12 +74,13 @@ import com.smartdevicelink.proxy.rpc.enums.TouchType;
import com.smartdevicelink.proxy.rpc.enums.UpdateMode;
import com.smartdevicelink.proxy.rpc.listeners.OnMultipleRequestListener;
import com.smartdevicelink.proxy.rpc.listeners.OnPutFileUpdateListener;
+import com.smartdevicelink.proxy.rpc.listeners.OnRPCListener;
import com.smartdevicelink.proxy.rpc.listeners.OnRPCNotificationListener;
import com.smartdevicelink.proxy.rpc.listeners.OnRPCResponseListener;
import com.smartdevicelink.security.SdlSecurityBase;
+import com.smartdevicelink.streaming.StreamRPCPacketizer;
import com.smartdevicelink.streaming.audio.AudioStreamingCodec;
import com.smartdevicelink.streaming.audio.AudioStreamingParams;
-import com.smartdevicelink.streaming.StreamRPCPacketizer;
import com.smartdevicelink.streaming.video.SdlRemoteDisplay;
import com.smartdevicelink.streaming.video.VideoStreamingParameters;
import com.smartdevicelink.trace.SdlTrace;
@@ -118,6 +92,31 @@ import com.smartdevicelink.transport.enums.TransportType;
import com.smartdevicelink.util.CorrelationIdGenerator;
import com.smartdevicelink.util.DebugTool;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.io.BufferedReader;
+import java.io.DataOutputStream;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.UnsupportedEncodingException;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.ProtocolException;
+import java.net.URL;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Vector;
+import java.util.concurrent.Callable;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.Executors;
+import java.util.concurrent.FutureTask;
+import java.util.concurrent.ScheduledExecutorService;
+
@SuppressWarnings({"WeakerAccess", "Convert2Diamond"})
public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase> {
@@ -127,12 +126,13 @@ 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;
protected Service _appService = null;
+ private Context _appContext;
private String sPoliciesURL = ""; //for testing only
// Protected Correlation IDs
@@ -241,6 +241,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
private final CopyOnWriteArrayList<IPutFileResponseListener> _putFileListenerList = new CopyOnWriteArrayList<IPutFileResponseListener>();
protected byte _wiproVersion = 1;
+ protected com.smartdevicelink.util.Version rpcSpecVersion;
protected SparseArray<OnRPCResponseListener> rpcResponseListeners = null;
protected SparseArray<CopyOnWriteArrayList<OnRPCNotificationListener>> rpcNotificationListeners = null;
@@ -335,6 +336,18 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
}
@Override
+ public void addOnRPCListener(FunctionID responseId, OnRPCListener listener) {
+ DebugTool.logError("Proxy.addOnRPCResponseListener() is not implemented yet");
+
+ }
+
+ @Override
+ public boolean removeOnRPCListener(FunctionID responseId, OnRPCListener listener) {
+ DebugTool.logError("Proxy.removeOnRPCResponseListener() is not implemented yet");
+ return false;
+ }
+
+ @Override
public Object getCapability(SystemCapabilityType systemCapabilityType){
return SdlProxyBase.this.getCapability(systemCapabilityType);
}
@@ -355,11 +368,26 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
}
@Override
+ public byte getWiProVersion() {
+ return getWiProVersion();
+ }
+
+ @Override
public boolean isCapabilitySupported(SystemCapabilityType systemCapabilityType){
return SdlProxyBase.this.isCapabilitySupported(systemCapabilityType);
}
@Override
+ public void addOnSystemCapabilityListener(SystemCapabilityType systemCapabilityType, OnSystemCapabilityListener listener) {
+ SdlProxyBase.this.removeOnSystemCapabilityListener(systemCapabilityType, listener);
+ }
+
+ @Override
+ public boolean removeOnSystemCapabilityListener(SystemCapabilityType systemCapabilityType, OnSystemCapabilityListener listener) {
+ return SdlProxyBase.this.removeOnSystemCapabilityListener(systemCapabilityType, listener);
+ }
+
+ @Override
public void startAudioService(boolean isEncrypted, AudioStreamingCodec codec,
AudioStreamingParams params) {
if(getIsConnected()){
@@ -622,6 +650,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
* Used by the SdlManager
*
* @param listener Type of listener for this proxy base.
+ * @param context Application context.
* @param appName Client application name.
* @param shortAppName Client short application name.
* @param isMediaApp Flag that indicates that client application if media application or not.
@@ -636,10 +665,11 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
* @param ttsName TTS name.
* @throws SdlException
*/
- public SdlProxyBase(proxyListenerType listener, String appName,String shortAppName, Boolean isMediaApp, Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appType, String appID,
+ public SdlProxyBase(proxyListenerType listener, Context context, String appName,String shortAppName, Boolean isMediaApp, Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appType, String appID,
BaseTransportConfig transportConfig, Vector<String> vrSynonyms, Vector<TTSChunk> ttsName, TemplateColorScheme dayColorScheme, TemplateColorScheme nightColorScheme) throws SdlException {
performBaseCommon(listener, null, true, appName, ttsName, shortAppName, vrSynonyms, isMediaApp,
null, languageDesired, hmiDisplayLanguageDesired, appType, appID, null, dayColorScheme,nightColorScheme, false, false, null, null, transportConfig);
+ _appContext = context;
}
/**
@@ -1012,7 +1042,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
private void sendBroadcastIntent(Intent sendIntent)
{
- Service myService;
+ Service myService = null;
if (_proxyListener != null && _proxyListener instanceof Service)
{
myService = (Service) _proxyListener;
@@ -1021,13 +1051,18 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
{
myService = _appService;
}
+ Context myContext;
+ if (myService != null){
+ myContext = myService.getApplicationContext();
+ } else if (_appContext != null){
+ myContext = _appContext;
+ }
else
{
return;
}
try
{
- Context myContext = myService.getApplicationContext();
if (myContext != null) myContext.sendBroadcast(sendIntent);
}
catch(Exception ex)
@@ -1407,7 +1442,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
_systemCapabilityManager = new SystemCapabilityManager(_internalInterface);
// Setup SdlConnection
synchronized(CONNECTION_REFERENCE_LOCK) {
- this.sdlSession = SdlSession.createSession(_wiproVersion,_interfaceBroker, _transportConfig);
+ this.sdlSession = SdlSession.createSession(_wiproVersion,_interfaceBroker, _transportConfig);
}
synchronized(CONNECTION_REFERENCE_LOCK) {
@@ -1713,7 +1748,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
}
}
- private byte getWiProVersion() {
+ public byte getWiProVersion() {
return this._wiproVersion;
}
@@ -1723,10 +1758,9 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
public String serializeJSON(RPCMessage msg)
{
- String sReturn;
try
{
- sReturn = msg.serializeJSON(getWiProVersion()).toString(2);
+ return msg.serializeJSON(getWiProVersion()).toString(2);
}
catch (final Exception e)
{
@@ -1734,7 +1768,6 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
passErrorToProxyListener("Error serializing message.", e);
return null;
}
- return sReturn;
}
private void handleErrorsFromIncomingMessageDispatcher(String info, Exception e) {
@@ -1879,6 +1912,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
try {
SdlTrace.logRPCEvent(InterfaceActivityDirection.Transmit, request, SDL_LIB_TRACE_KEY);
+ request.format(rpcSpecVersion,true);
byte[] msgBytes = JsonRPCMarshaller.marshall(request, _wiproVersion);
ProtocolMessage pm = new ProtocolMessage();
@@ -2059,7 +2093,12 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
SdlSecurityBase sec;
Service svc = getService();
SdlSecurityBase.setAppService(svc);
-
+ if (svc != null && svc.getApplicationContext() != null){
+ SdlSecurityBase.setContext(svc.getApplicationContext());
+ } else {
+ SdlSecurityBase.setContext(_appContext);
+ }
+
for (Class<? extends SdlSecurityBase> cls : _secList)
{
try
@@ -2087,6 +2126,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();
@@ -2101,6 +2142,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;
}
@@ -2125,12 +2167,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)
{
@@ -2243,6 +2292,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);
@@ -2258,6 +2308,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;
}
@@ -2271,6 +2322,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();
@@ -2331,6 +2383,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() {
@@ -2348,6 +2401,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() {
@@ -2365,6 +2419,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() {
@@ -2382,6 +2437,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() {
@@ -2399,6 +2455,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() {
@@ -2416,6 +2473,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() {
@@ -2433,6 +2491,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() {
@@ -2450,6 +2509,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() {
@@ -2467,6 +2527,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() {
@@ -2484,6 +2545,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() {
@@ -2500,7 +2562,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);
@@ -2527,6 +2589,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() {
@@ -2544,6 +2607,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() {
@@ -2561,6 +2625,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() {
@@ -2578,6 +2643,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() {
@@ -2595,6 +2661,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() {
@@ -2617,7 +2684,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);
@@ -2650,6 +2717,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() {
@@ -2666,6 +2734,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() {
@@ -2682,6 +2751,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() {
@@ -2700,6 +2770,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() {
@@ -2716,6 +2787,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() {
@@ -2732,6 +2804,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() {
@@ -2748,6 +2821,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() {
@@ -2764,6 +2838,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() {
@@ -2780,7 +2855,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());
@@ -2805,6 +2880,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() {
@@ -2821,6 +2897,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() {
@@ -2837,6 +2914,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() {
@@ -2853,6 +2931,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() {
@@ -2869,6 +2948,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() {
@@ -2885,6 +2965,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() {
@@ -2901,6 +2982,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() {
@@ -2917,6 +2999,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() {
@@ -2932,6 +3015,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() {
@@ -2947,6 +3031,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() {
@@ -2962,6 +3047,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() {
@@ -2979,6 +3065,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() {
@@ -2996,6 +3083,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() {
@@ -3013,6 +3101,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() {
@@ -3029,6 +3118,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
@@ -3044,6 +3134,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
@@ -3058,6 +3149,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
@@ -3072,6 +3164,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
@@ -3086,6 +3179,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
@@ -3101,6 +3195,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
@@ -3115,6 +3210,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
@@ -3129,6 +3225,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() {
@@ -3171,6 +3268,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() {
@@ -3190,6 +3288,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() {
@@ -3215,6 +3314,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() {
@@ -3241,7 +3341,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() {
@@ -3277,6 +3378,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() {
@@ -3294,6 +3396,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() {
@@ -3311,6 +3414,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() {
@@ -3328,6 +3432,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() {
@@ -3345,6 +3450,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() {
@@ -3362,6 +3468,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() {
@@ -3387,7 +3494,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)))){
@@ -3407,6 +3514,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
lockScreenIconRequest = msg;
}
+ msg.format(rpcSpecVersion, true);
if (_callbackToUIThread) {
// Run in UI thread
_mainUIHandler.post(new Runnable() {
@@ -3423,6 +3531,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() {
@@ -3439,6 +3548,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() {
@@ -3462,6 +3572,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());
@@ -3491,6 +3602,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() {
@@ -3507,6 +3619,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() {
@@ -3523,6 +3636,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() {
@@ -3539,6 +3653,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() {
@@ -3555,6 +3670,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() {
@@ -3935,7 +4051,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
public OutputStream startRPCStream(RPCRequest msg) {
if (sdlSession == null) return null;
- return sdlSession.startRPCStream(msg, SessionType.RPC, sdlSession.getSessionId(), _wiproVersion);
+ return sdlSession.startRPCStream(msg, SessionType.RPC, sdlSession.getSessionId(), _wiproVersion);
}
public void endRPCStream() {
@@ -6916,6 +7032,14 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
sendRPCRequest(msg);
}
+ /**
+ * Gets the SystemCapabilityManager. <br>
+ * @return a SystemCapabilityManager object
+ */
+ public SystemCapabilityManager getSystemCapabilityManager() {
+ return _systemCapabilityManager;
+ }
+
@SuppressWarnings("unused")
public boolean isCapabilitySupported(SystemCapabilityType systemCapabilityType) {
return _systemCapabilityManager != null && _systemCapabilityManager.isCapabilitySupported(systemCapabilityType);
@@ -6937,6 +7061,29 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
}
}
+ /**
+ * Add a listener to be called whenever a new capability is retrieved
+ * @param systemCapabilityType Type of capability desired
+ * @param listener callback to execute upon retrieving capability
+ */
+ public void addOnSystemCapabilityListener(final SystemCapabilityType systemCapabilityType, final OnSystemCapabilityListener listener) {
+ if(_systemCapabilityManager != null){
+ _systemCapabilityManager.addOnSystemCapabilityListener(systemCapabilityType, listener);
+ }
+ }
+
+ /**
+ * Remove an OnSystemCapabilityListener that was previously added
+ * @param systemCapabilityType Type of capability
+ * @param listener the listener that should be removed
+ */
+ public boolean removeOnSystemCapabilityListener(final SystemCapabilityType systemCapabilityType, final OnSystemCapabilityListener listener){
+ if(_systemCapabilityManager != null){
+ return _systemCapabilityManager.removeOnSystemCapabilityListener(systemCapabilityType, listener);
+ }
+ return false;
+ }
+
/* ******************* END Public Helper Methods *************************/
/**
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 710355c49..291d02a8f 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/SystemCapabilityManager.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/SystemCapabilityManager.java
@@ -1,6 +1,5 @@
package com.smartdevicelink.proxy;
-import com.smartdevicelink.exception.SdlException;
import com.smartdevicelink.proxy.interfaces.ISdl;
import com.smartdevicelink.proxy.interfaces.OnSystemCapabilityListener;
import com.smartdevicelink.proxy.rpc.GetSystemCapability;
@@ -12,31 +11,36 @@ import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType;
import com.smartdevicelink.proxy.rpc.listeners.OnRPCResponseListener;
import com.smartdevicelink.util.CorrelationIdGenerator;
-import java.security.InvalidParameterException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
public class SystemCapabilityManager {
- HashMap<SystemCapabilityType, Object> cachedSystemCapabilities = new HashMap<>();
- ISdl callback;
+ private final HashMap<SystemCapabilityType, Object> cachedSystemCapabilities;
+ private final HashMap<SystemCapabilityType, CopyOnWriteArrayList<OnSystemCapabilityListener>> onSystemCapabilityListeners;
+ private final Object LISTENER_LOCK;
+ private final ISdl callback;
public SystemCapabilityManager(ISdl callback){
this.callback = callback;
+ this.LISTENER_LOCK = new Object();
+ this.onSystemCapabilityListeners = new HashMap<>();
+ this.cachedSystemCapabilities = new HashMap<>();
}
public void parseRAIResponse(RegisterAppInterfaceResponse response){
if(response!=null && response.getSuccess()) {
- cachedSystemCapabilities.put(SystemCapabilityType.HMI, response.getHmiCapabilities());
- cachedSystemCapabilities.put(SystemCapabilityType.DISPLAY, response.getDisplayCapabilities());
- cachedSystemCapabilities.put(SystemCapabilityType.AUDIO_PASSTHROUGH, response.getAudioPassThruCapabilities());
- cachedSystemCapabilities.put(SystemCapabilityType.PCM_STREAMING, response.getPcmStreamingCapabilities());
- cachedSystemCapabilities.put(SystemCapabilityType.BUTTON, response.getButtonCapabilities());
- cachedSystemCapabilities.put(SystemCapabilityType.HMI_ZONE, response.getHmiZoneCapabilities());
- cachedSystemCapabilities.put(SystemCapabilityType.PRESET_BANK, response.getPresetBankCapabilities());
- cachedSystemCapabilities.put(SystemCapabilityType.SOFTBUTTON, response.getSoftButtonCapabilities());
- cachedSystemCapabilities.put(SystemCapabilityType.SPEECH, response.getSpeechCapabilities());
- cachedSystemCapabilities.put(SystemCapabilityType.VOICE_RECOGNITION, response.getVrCapabilities());
+ setCapability(SystemCapabilityType.HMI, response.getHmiCapabilities());
+ setCapability(SystemCapabilityType.DISPLAY, response.getDisplayCapabilities());
+ setCapability(SystemCapabilityType.AUDIO_PASSTHROUGH, response.getAudioPassThruCapabilities());
+ setCapability(SystemCapabilityType.PCM_STREAMING, response.getPcmStreamingCapabilities());
+ setCapability(SystemCapabilityType.BUTTON, response.getButtonCapabilities());
+ setCapability(SystemCapabilityType.HMI_ZONE, response.getHmiZoneCapabilities());
+ setCapability(SystemCapabilityType.PRESET_BANK, response.getPresetBankCapabilities());
+ setCapability(SystemCapabilityType.SOFTBUTTON, response.getSoftButtonCapabilities());
+ setCapability(SystemCapabilityType.SPEECH, response.getSpeechCapabilities());
+ setCapability(SystemCapabilityType.VOICE_RECOGNITION, response.getVrCapabilities());
}
}
@@ -46,8 +50,25 @@ public class SystemCapabilityManager {
* @param systemCapabilityType
* @param capability
*/
- public void setCapability(SystemCapabilityType systemCapabilityType, Object capability){
- cachedSystemCapabilities.put(systemCapabilityType,capability);
+ public synchronized void setCapability(SystemCapabilityType systemCapabilityType, Object capability){
+ cachedSystemCapabilities.put(systemCapabilityType, capability);
+ notifyListeners(systemCapabilityType, capability);
+ }
+
+ /**
+ * Notify listners in the list about the new retrieved capability
+ * @param systemCapabilityType
+ * @param capability
+ */
+ private void notifyListeners(SystemCapabilityType systemCapabilityType, Object capability) {
+ synchronized(LISTENER_LOCK){
+ CopyOnWriteArrayList<OnSystemCapabilityListener> listeners = onSystemCapabilityListeners.get(systemCapabilityType);
+ if(listeners != null && listeners.size() > 0) {
+ for (OnSystemCapabilityListener listener : listeners) {
+ listener.onCapabilityRetrieved(capability);
+ }
+ }
+ }
}
/**
@@ -57,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));
@@ -109,6 +131,40 @@ public class SystemCapabilityManager {
}
/**
+ * Add a listener to be called whenever a new capability is retrieved
+ * @param systemCapabilityType Type of capability desired
+ * @param listener callback to execute upon retrieving capability
+ */
+ public void addOnSystemCapabilityListener(final SystemCapabilityType systemCapabilityType, final OnSystemCapabilityListener listener){
+ getCapability(systemCapabilityType, listener);
+ synchronized(LISTENER_LOCK){
+ if (systemCapabilityType != null && listener != null) {
+ if (onSystemCapabilityListeners.get(systemCapabilityType) == null) {
+ onSystemCapabilityListeners.put(systemCapabilityType, new CopyOnWriteArrayList<OnSystemCapabilityListener>());
+ }
+ onSystemCapabilityListeners.get(systemCapabilityType).add(listener);
+ }
+ }
+ }
+
+ /**
+ * Remove an OnSystemCapabilityListener that was previously added
+ * @param systemCapabilityType Type of capability
+ * @param listener the listener that should be removed
+ */
+ public boolean removeOnSystemCapabilityListener(final SystemCapabilityType systemCapabilityType, final OnSystemCapabilityListener listener){
+ synchronized(LISTENER_LOCK){
+ if(onSystemCapabilityListeners!= null
+ && systemCapabilityType != null
+ && listener != null
+ && onSystemCapabilityListeners.get(systemCapabilityType) != null){
+ return onSystemCapabilityListeners.get(systemCapabilityType).remove(listener);
+ }
+ }
+ return false;
+ }
+
+ /**
* @param systemCapabilityType Type of capability desired
* passes GetSystemCapabilityType request to `callback` to be sent by proxy
*/
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 e88c64322..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
@@ -3,9 +3,11 @@ package com.smartdevicelink.proxy.interfaces;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.protocol.enums.SessionType;
import com.smartdevicelink.proxy.RPCRequest;
+import com.smartdevicelink.util.Version;
import com.smartdevicelink.proxy.rpc.SdlMsgVersion;
import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType;
import com.smartdevicelink.proxy.rpc.listeners.OnMultipleRequestListener;
+import com.smartdevicelink.proxy.rpc.listeners.OnRPCListener;
import com.smartdevicelink.proxy.rpc.listeners.OnRPCNotificationListener;
import com.smartdevicelink.streaming.audio.AudioStreamingCodec;
import com.smartdevicelink.streaming.audio.AudioStreamingParams;
@@ -150,6 +152,20 @@ public interface ISdl {
boolean removeOnRPCNotificationListener(FunctionID notificationId, OnRPCNotificationListener listener);
/**
+ * Add an OnRPCResponseListener for specified response
+ * @param responseId FunctionID of the response that is to be listened for
+ * @param listener listener that should be added for the response ID
+ */
+ void addOnRPCListener(FunctionID responseId, OnRPCListener listener);
+
+ /**
+ * Removes an OnRPCResponseListener for specified response
+ * @param responseId FunctionID of the response that was to be listened for
+ * @param listener listener that was previously added for the response ID
+ */
+ boolean removeOnRPCListener(FunctionID responseId, OnRPCListener listener);
+
+ /**
* Get SystemCapability Object
* @param systemCapabilityType
* @return Object
@@ -171,9 +187,29 @@ public interface ISdl {
boolean isCapabilitySupported(SystemCapabilityType systemCapabilityType);
/**
+ * Add a listener to be called whenever a new capability is retrieved
+ * @param systemCapabilityType Type of capability desired
+ * @param listener callback to execute upon retrieving capability
+ */
+ void addOnSystemCapabilityListener(SystemCapabilityType systemCapabilityType, OnSystemCapabilityListener listener);
+
+ /**
+ * Remove an OnSystemCapabilityListener that was previously added
+ * @param systemCapabilityType Type of capability
+ * @param listener the listener that should be removed
+ */
+ boolean removeOnSystemCapabilityListener(SystemCapabilityType systemCapabilityType, OnSystemCapabilityListener listener);
+
+ /**
* Get SdlMsgVersion
* @return SdlMsgVersion
*/
SdlMsgVersion getSdlMsgVersion();
+ /**
+ * Get WiPro version
+ * @return byte value representing WiPro version
+ */
+ 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/proxy/rpc/listeners/OnRPCListener.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnRPCListener.java
new file mode 100644
index 000000000..8de606b7c
--- /dev/null
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnRPCListener.java
@@ -0,0 +1,55 @@
+package com.smartdevicelink.proxy.rpc.listeners;
+
+import com.smartdevicelink.proxy.RPCMessage;
+
+public abstract class OnRPCListener {
+
+ /**
+ * Generic listener for all RPCs including Requests, response, and notificaiton
+ */
+ public final static int UPDATE_LISTENER_TYPE_ALL_RPCS = -1;
+
+ /**
+ * Generic listener type that will work for most RPCs
+ */
+ public final static int UPDATE_LISTENER_TYPE_BASE_RPC = 0;
+ /**
+ * Listener type specific to putfile
+ */
+ public final static int UPDATE_LISTENER_TYPE_PUT_FILE = 1;
+ /**
+ * Listener type specific to sendRequests and sendSequentialRequests
+ */
+ public final static int UPDATE_LISTENER_TYPE_MULTIPLE_REQUESTS = 2;
+
+ /**
+ * Stores what type of listener this instance is. This prevents of from having to use reflection
+ */
+ int listenerType;
+
+ /**
+ * This is the base listener for all RPCs.
+ */
+ public OnRPCListener(){
+ setListenerType(UPDATE_LISTENER_TYPE_ALL_RPCS);
+ }
+
+ protected final void setListenerType(int type){
+ this.listenerType = type;
+ }
+ /**
+ * This is used to see what type of listener this instance is. It is needed
+ * because some RPCs require additional callbacks. Types are constants located in this class
+ * @return the type of listener this is
+ */
+ public int getListenerType(){
+ return this.listenerType;
+ }
+
+ /**
+ * This is the only method that must be extended.
+ * @param message This will be the response message received from the core side. It should be cast into a corresponding RPC Response type. ie, if setting this
+ * for a PutFile request, the message parameter should be cast to a PutFileResponse class.
+ */
+ public abstract void onReceived(final RPCMessage message);
+}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnRPCResponseListener.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnRPCResponseListener.java
index c21244926..2c40fe0df 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnRPCResponseListener.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnRPCResponseListener.java
@@ -1,77 +1,53 @@
-package com.smartdevicelink.proxy.rpc.listeners;
-
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-public abstract class OnRPCResponseListener {
- /**
- * Generic listener type that will work for most RPCs
- */
- public final static int UPDATE_LISTENER_TYPE_BASE_RPC = 0;
- /**
- * Listener type specific to putfile
- */
- public final static int UPDATE_LISTENER_TYPE_PUT_FILE = 1;
- /**
- * Listener type specific to sendRequests and sendSequentialRequests
- */
- public final static int UPDATE_LISTENER_TYPE_MULTIPLE_REQUESTS = 2;
-
- /**
- * Stores what type of listener this instance is. This prevents of from having to use reflection
- */
- int listenerType;
-
- /**
- * This is the base listener for all RPCs.
- */
- public OnRPCResponseListener(){
- setListenerType(UPDATE_LISTENER_TYPE_BASE_RPC);
- }
-
- protected final void setListenerType(int type){
- this.listenerType = type;
- }
- /**
- * This is used to see what type of listener this instance is. It is needed
- * because some RPCs require additional callbacks. Types are constants located in this class
- * @return the type of listener this is
- */
- public int getListenerType(){
- return this.listenerType;
- }
-
- /* *****************************************************************
- ************************* Event Callbacks *************************
- *******************************************************************/
-
- /**
- * This method will be called once the packet has been entered into the queue of messages to send
- * @param correlationId
- */
- public void onStart(int correlationId){
-
- };
-
- /**
- * This is the only method that must be extended. Other methods that are able to be extended are
- * onStart and onError.
- * @param correlationId
- * @param response This will be the response message received from the core side. It should be cast into a corresponding RPC Response type. ie, if setting this
- * for a PutFile request, the message parameter should be cast to a PutFileResponse class.
- */
- public abstract void onResponse(int correlationId, final RPCResponse response);
-
- /**
- * Called when there was some sort of error during the original request.
- * @param correlationId
- * @param resultCode
- * @param info
- */
- public void onError(int correlationId, Result resultCode, String info){
-
- };
-
-
-
-}
+package com.smartdevicelink.proxy.rpc.listeners;
+
+import com.smartdevicelink.proxy.RPCMessage;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
+
+public abstract class OnRPCResponseListener extends OnRPCListener {
+
+
+ public OnRPCResponseListener(){
+ setListenerType(OnRPCListener.UPDATE_LISTENER_TYPE_BASE_RPC);
+ }
+
+ public final void onReceived(final RPCMessage message){
+ if (message != null && message instanceof RPCResponse){
+ onResponse(((RPCResponse) message).getCorrelationID(), (RPCResponse)message);
+ }
+ }
+
+ /* *****************************************************************
+ ************************* Event Callbacks *************************
+ *******************************************************************/
+
+ /**
+ * This method will be called once the packet has been entered into the queue of messages to send
+ * @param correlationId
+ */
+ public void onStart(int correlationId){
+
+ };
+
+ /**
+ * This is the only method that must be extended. Other methods that are able to be extended are
+ * onStart and onError.
+ * @param correlationId
+ * @param response This will be the response message received from the core side. It should be cast into a corresponding RPC Response type. ie, if setting this
+ * for a PutFile request, the message parameter should be cast to a PutFileResponse class.
+ */
+ public abstract void onResponse(int correlationId, final RPCResponse response);
+
+ /**
+ * Called when there was some sort of error during the original request.
+ * @param correlationId
+ * @param resultCode
+ * @param info
+ */
+ public void onError(int correlationId, Result resultCode, String info){
+
+ };
+
+
+
+}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/security/SdlSecurityBase.java b/sdl_android/src/main/java/com/smartdevicelink/security/SdlSecurityBase.java
index b5efacaf1..b3f324267 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/security/SdlSecurityBase.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/security/SdlSecurityBase.java
@@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.List;
import android.app.Service;
+import android.content.Context;
import com.smartdevicelink.SdlConnection.SdlSession;
import com.smartdevicelink.protocol.enums.SessionType;
@@ -16,6 +17,7 @@ public abstract class SdlSecurityBase {
protected boolean isInitSuccess = false;
protected byte sessionId = 0;
protected static Service appService = null;
+ protected static Context context;
protected List<SessionType> startServiceList = new ArrayList<SessionType>();
public SdlSecurityBase() {
@@ -84,12 +86,25 @@ public abstract class SdlSecurityBase {
appId = val;
}
+ @Deprecated
public static Service getAppService() {
- return appService;
+ return appService;
}
-
+
+ @Deprecated
public static void setAppService(Service val) {
- appService = val;
+ appService = val;
+ if (val != null && val.getApplicationContext() != null){
+ setContext(val.getApplicationContext());
+ }
+ }
+
+ public static Context getContext() {
+ return context;
+ }
+
+ public static void setContext(Context val) {
+ context = val;
}
public List<String> getMakeList() {
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/drawable-hdpi/sdl_lockscreen_icon.png b/sdl_android/src/main/res/drawable-hdpi/sdl_lockscreen_icon.png
new file mode 100644
index 000000000..625eb35ea
--- /dev/null
+++ b/sdl_android/src/main/res/drawable-hdpi/sdl_lockscreen_icon.png
Binary files differ
diff --git a/sdl_android/src/main/res/drawable-mdpi/sdl_lockscreen_icon.png b/sdl_android/src/main/res/drawable-mdpi/sdl_lockscreen_icon.png
new file mode 100644
index 000000000..d13a55e0b
--- /dev/null
+++ b/sdl_android/src/main/res/drawable-mdpi/sdl_lockscreen_icon.png
Binary files differ
diff --git a/sdl_android/src/main/res/drawable-xhdpi/sdl_lockscreen_icon.png b/sdl_android/src/main/res/drawable-xhdpi/sdl_lockscreen_icon.png
new file mode 100644
index 000000000..d7de7cabe
--- /dev/null
+++ b/sdl_android/src/main/res/drawable-xhdpi/sdl_lockscreen_icon.png
Binary files differ
diff --git a/sdl_android/src/main/res/drawable-xxhdpi/sdl_lockscreen_icon.png b/sdl_android/src/main/res/drawable-xxhdpi/sdl_lockscreen_icon.png
new file mode 100644
index 000000000..bd0c40e67
--- /dev/null
+++ b/sdl_android/src/main/res/drawable-xxhdpi/sdl_lockscreen_icon.png
Binary files differ
diff --git a/sdl_android/src/main/res/drawable-xxxhdpi/sdl_lockscreen_icon.png b/sdl_android/src/main/res/drawable-xxxhdpi/sdl_lockscreen_icon.png
new file mode 100644
index 000000000..21962c148
--- /dev/null
+++ b/sdl_android/src/main/res/drawable-xxxhdpi/sdl_lockscreen_icon.png
Binary files differ
diff --git a/sdl_android/src/main/res/layout/activity_sdllock_screen.xml b/sdl_android/src/main/res/layout/activity_sdllock_screen.xml
new file mode 100644
index 000000000..dd2c2a6bb
--- /dev/null
+++ b/sdl_android/src/main/res/layout/activity_sdllock_screen.xml
@@ -0,0 +1,44 @@
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/lockscreen_relative_layout"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:background="#2c3d4d">
+
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/lockscreen_linear_layout"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:gravity="center_horizontal|center_vertical">
+
+ <ImageView
+ android:id="@+id/lockscreen_image"
+ android:layout_width="120dp"
+ android:layout_height="120dp"
+ android:scaleType="fitXY"
+ android:layout_gravity="center_horizontal"
+ android:contentDescription="@string/lockscreen_image_description"
+ android:background="@drawable/sdl_lockscreen_icon"/>
+
+ <ImageView
+ android:id="@+id/device_image"
+ android:layout_width="120dp"
+ android:layout_height="120dp"
+ android:layout_marginTop="30dp"
+ android:scaleType="fitXY"
+ android:layout_gravity="center_horizontal"
+ android:contentDescription="@string/lockscreen_device_image_description"/>
+
+ </LinearLayout>
+
+ <TextView
+ android:id="@+id/lockscreen_text"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:text="@string/lockscreen_text"
+ android:textSize="18sp"
+ android:gravity="center|bottom"
+ android:textColor="#FFFFFF"
+ android:paddingBottom="10dp"/>
+
+</RelativeLayout> \ No newline at end of file
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>
diff --git a/sdl_android/src/main/res/values/strings.xml b/sdl_android/src/main/res/values/strings.xml
new file mode 100644
index 000000000..1d55ec24d
--- /dev/null
+++ b/sdl_android/src/main/res/values/strings.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="lockscreen_text">Locked for your safety</string>
+ <string name="lockscreen_image_description">SDL Icon</string>
+ <string name="lockscreen_device_image_description">Device Icon</string>
+</resources> \ No newline at end of file